~ekez/negativefour

ref: a3ba218efef2773e5826b94d9ca3c096795b3ddc negativefour/docs/serve-setup.md -rw-r--r-- 1.4 KiB
a3ba218eZeke Medley Fix race condition between apache restart and status check 8 months ago
  1. Enable automatic updates
sudo apt install unattended-upgrades apt-listchanges
echo unattended-upgrades unattended-upgrades/enable_auto_updates boolean true | sudo debconf-set-selections
sudo dpkg-reconfigure -f noninteractive unattended-upgrades
  1. Update
sudo apt update
sudo apt upgrade
  1. Install emacs, apache2, and tor
sudo apt install emacs apache2
  1. Create directory for storing static webpages
mkdir -p /home/admin/www/html
  1. Add the following to /etc/apache2/apache2.conf to allow webpages to be served from the new directory.
# We store our html folders in /home/admin as I don't want to have to
# be root in order to add new files. Here we enable access to that
# directory.
<Directory /home/admin/www/>
	Options Indexes FollowSymLinks
	AllowOverride None
	Require all granted
</Directory>
  1. Set up certs
sudo apt install snapd
sudo snap install core; sudo snap refresh core
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
sudo snap set certbot trust-plugin-with-root=ok
sudo snap install certbot-dns-cloudflare
echo "dns_cloudflare_api_token = 4GZLSWz110jLJj-CO-ijKWOYPQ5VrWb1lGbaQV2d" > ~/.cf_api_token
chmod 600 .cf_api_token
sudo certbot certonly --dns-cloudflare --dns-cloudflare-credentials ~/.cf_api_token -d negativefour.app -d *.negativefour.app -i apache
  1. Load needed apache2 modules
sudo a2enmod headers rewrite
sudo a2enmod ssl