Implementing SSL (https)
This assumes that andes is deployed and connected to a cradlepoint.
- Add a domain name for this deployment using a prefix (e.g. my_new_andes.andes-dfo-mpo.ca) and point this to the cradelpoint IP.
- Enable port forwarding on the cradlepoint for ports 22 (ssh), 80 (http) and 443 (https) between the cradlepoint’s IP and the servers static IP.
- Follow the guide at https://certbot.eff.org/instructions?ws=apache&os=ubuntufocal, start by install snap core and certbot:
sudo snap install core; sudo snap refresh core sudo snap install --classic certbot sudo ln -s /snap/bin/certbot /usr/bin/certbot
- Allow all traffic in through the cradle point, this is necessary for letsencrypt to verify the server.
- Comment out (#) the wsgi lines in /etc/apache2/sites-available/000-default.conf
# WSGIDaemonProcess andes python-path=/var/www/andes_root/andes python-home=/var/www/andes_root/venv # WSGIProcessGroup andes # WSGIScriptAlias / /var/www/andes_root/andes/andes/wsgi.py
- Request the certificates using the domain name associated with the cradlepoint, select 000-default-conf-le-ssl.conf when offered the choice.
sudo certbot --apache
- If successful, close the cradlepoint to external traffic.
- Uncomment the WSGI lines in both /etc/apache2/sites-available/000-default.conf and /etc/apache2/sites-available/000-default-le-ssl.conf. Rename the DaemonProcess and ProcessGroup in one of the .conf to ensure uniqueness, e.g.
WSGIDaemonProcess andes1 python-path=/var/www/andes_root/andes python-home=/var/www/andes_root/venv WSGIProcessGroup andes1 WSGIScriptAlias / /var/www/andes_root/andes/andes/wsgi.py
- Restart Apache and verify that http and https work.