Skip to content

Web Server

While previous lab webservers have been run on BYU OIT virtual machines, the BYU Cloud (yCloud) program is being terminated. This coincided with the original web server VM corrupting a bunch of stuff, so as of December 2017 we currently run a physical server in the Talmage Building server room.

The source code is kept at https://gitlab.com/idealabs/website, and explicit installation instructions are found in the Read-Me file.

Accounts

The server has user accounts for users to log on an make changes, and then a service account, or an account without a user, runs the web server application (Caddy) via systemd. The name of this account is www-data and there is also a group by that name. All files that should be handled by the webserver should be owned by this user and group. If you need to change ownership, use the following command:

1
$ sudo chown -R www-data:www-data /path/to/folder/that/needs/to/change

Caddy

At the time of writing, the website statically generated by Hugo and uses Caddy (v1) as the webserver. Caddy all runs as a service so they start at boot. To stop, start, restart, or check the status of it, you can use the following commands:

1
2
3
4
$ sudo systemctl stop caddy
$ sudo systemctl start caddy
$ sudo systemctl restart caddy
$ sudo systemctl status caddy

Managing Caddy via the Caddyfile

The Caddyfile manages the configuration of a running instance of Caddy. The Caddyfile that the established service uses is found at /etc/caddy/Caddyfile. Modify it as needed, then restart the Caddy service using the command above to have the changes loaded. You can see via the Caddyfile where the root of the website is located (/var/www/idealabs.byu.edu at the time of this writing), where logs are sent to, and the like.

I started using Caddy due to simplicity and ease of use. Caddy handles automatic registration of SSL certificates for all of the lab websites as well as routing subdomain traffic (like this wiki) as needed. The wiki is automatically updated whenever the git repo changes by means of a GitLab webhook, so awesome things like that are made very easy.

Website Files

The website files should be located in the /var/www directory. There's some directories in there that aren't currently in active use, but the following are the major ones:

  • logs: Directory for access and error logs for the website, wiki, and other sites
  • ssh_keys: Holds the SSH key that Caddy uses to pull the changes for the website and wiki
  • webserver: Directory for version control of key configuration and system files that the server uses
  • website: The contents of the website, as found at https://gitlab.com/idealabs/website
  • wiki: The contents of the wiki, as found at https://gitlab.com/idealabs/wiki

A few other key files are:

  • Caddyfile: /etc/caddy/Caddyfile
  • Caddy service file: /etc/systemd/system/caddy.service
  • Caddy executable: /usr/local/bin/caddy
  • Hugo executable: /usr/local/bin/hugo
  • Mkdocs executable: /usr/local/bin/mkdocs

Further details on editing the contents of the website and the wiki can be found at:

Hardware Specifications

This is an old machine that was saved from BYU Surplus, so don't try to do too much with it.

Resource Type Description Quantity
CPU Intel Core i7 960 - 4 Cores / 8 Threads @ 3.2 GHz 1
RAM ??? 24GB
Storage WD Gold 1TB Enterprise Class Hard Disk Drive - 7200 RPM 1: 1 TB
GPU Lol 0
PSU EVGA SuperNOVA 650W G2 220-G2-0650-Y1 1
Case Norco RPC-450 4U rackmount server case 1