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.
- 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
- In the Comment field, add the date of the request, or something to help track
- 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.
- Add CNAME records pointing to 'skwotfarm.squat.net.' (don't forget the
leading dot)
- 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
- 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
- Symlink:
# ln -s /var/www/$mysite.squat.net/wp-content/uploads/ /usr/share/wordpress/wp-content/uploads/$mysite
- 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.
- 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;
- 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 forwww.$mysite.squat.net
# dehydrated -c
- 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
- 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
- Add a line in /root/Changelog