State of this part of the doc: works.

In this doc, replace $mysite by the subdomain you want to use (for example, "mysquat" to create "mysquat.squat.net"), and $user by the username that will be used on the system. These are usualy the same, but sometimes not.

  1. Edit DNS at https://dns.puscii.nl (see edit-dns):
    • Add CNAME records pointing to 'skwotfarm.squat.net.' (don't forget the leading dot)
      • one for $mysite
      • if you want www to work, and one for www.$mysite
    • We use CNAME records so that if the servers IP change we will have only one record to change for all websites, and there is a CAA record for skwotfarm.squat.net that is needed.
  2. Create the user with a home dir in /home/:
    • the username should be the same as blog subdomain, but sometimes it is not possible
    • # adduser --disabled-login --gecos "" --shell /bin/false $user
  3. Create folders:
    • # mysite=<squat!net subdomain> (that's without the .squat.net part)
    • # mkdir -p /var/www/$mysite.squat.net/wp-content/{uploads,theme}
    • # chown -R $user:$user /var/www/$mysite.squat.net
  4. Symlink:
    • # ln -s /var/www/$mysite.squat.net/wp-content/uploads/ /usr/share/wordpress/wp-content/uploads/$mysite
  5. WP config:
    • # cp /etc/wordpress/config-{help,$mysite}.squat.net.php
    • → Edit the newly created file and change DBNAME, DBUSER, DBPASSWORD, SECRET_KEY (put random stuff there), UPLOADS, $upload_path and $upload_url_path)
    • → Write down the password you've chosen for the database, we'll need it later on.
  6. Database stuff (replace $dbname by the name of the database to create, it should be the same as subdomain. Don't use special chars)
    • # mysql
    • > create database $dbname;
    • > grant all on $dbname.* to '$dbname'@'localhost' identified by '$password';
    • > flush privileges;
    • > quit;
  7. Create an SSL certificate:
    • # vim /etc/dehydrated/domains.txt
    • → at the end of the line, add $mysite.squat.net and if you created a CNAME record for www, add another line for www.$mysite.squat.net
    • # dehydrated -c
  8. Apache config:
    • # vim /etc/apache2/sites-enabled/wordpress.conf
    • → Add a line at the end of the file, matching the user and group you just created and the URL associated
    • If you have created a CNAME record for www:
      • # vim /etc/apache2/sites-enabled/redirects.conf
      • Add a line at the end of the file, to redirect www.$mysite.squat.net to $mysite.squat.net
    • # systemctl reload apache2
  9. Connect to https://$mysite.squat.net and create a new admin user with credentials you'll give out to the group who asked for the website.
    • Make sure they change their password right after first login
    • Or check the tickbox to enforce password change after first login in the admin panel
    • TODO: have a mail template to send to requesting user
  10. Add a line in /root/Changelog