User Websites

Home Users Services Docs

Each user on Groupnix has access to their own website. If your user is USER, then your website can be found at https://u.buni.party/USER.

Filesystem Structure

Your user website is stored in ~/web. This directory has the following hierarchy:


~/web/
|__ noserv/
|   |__ secrets
|__ cgi-bin/
|   |__ hello.sh*
|__ index.html

Your web directory should be owned by your user but have the group www-data. It will also have the SGID bit. These two things should not be changed since they allow nginx (which is the HTTP server being used on Groupnix) to actually access your website and serve it. Additionally, you should not change the owner/group of any files you add in the web directory.

The cgi-bin directory can hold CGI scripts. This means that files in that directory (if they are marked executable) will be run as scripts instead of being served statically. This allows you to create dynamic websites. Note, however, that CGI scripts will run as the www-data user and so only have access to your ~/web directory, not your whole user directory.

Finally, the noserv directory contains anything that you do not want nginx to serve. So, if you have a file noserv/secrets, then the endpoint https://u.buni.party/USER/noserv/secrets will fail.

Using the Web

Given a URL, the web server will either try to find a matching file in your web directory or, if it finds a directory instead, will try to serve index.html in that directory. If the path is in the cgi-bin directory, the CGI script will be executed and its output will be served as the web page. It is important to note that paths in your HTML documents must be relative or absolute with respect to your current user. For instance, if you are USER and you want to link your stylesheet, you must use a relative path of the form style.css or an absolute path of the form /USER/style.css.