First Upate System:
$ sudo apt update
$ sudo apt upgrade -yInstall Apache:
$ sudo apt install -y apache2Install build-essential:
$ sudo apt install -y build-essentialInstall dependacies:
$ sudo apt install -y libapache2-mod-proxy-html libxml2-devInstall Lego to setup Letsencypt Certificates (if you want SSL)
$ cd /tmp
$ curl -Ls https://api.github.com/repos/xenolf/lego/releases/latest | grep browser_download_url | grep linux_amd64 | cut -d '"' -f 4 | wget -i -
$ tar xf lego_vX.Y.Z_linux_amd64.tar.gz
$ sudo mkdir -p /home/user/cloud/letsencrypt
$ sudo mv lego /home/user/cloud/letsencrypt/lego
$ rm lego_vX.Y.Z_linux_amd64.tar.gzreadmore...
Configure Apache:
$ sudo a2enmod proxy
$ sudo a2enmod proxy_http
$ sudo a2enmod proxy_ajp
$ sudo a2enmod rewrite
$ sudo a2enmod deflate
$ sudo a2enmod headers
$ sudo a2enmod ssl
$ sudo a2enmod proxy_balancer
$ sudo a2enmod proxy_connect
$ sudo a2enmod proxy_htmlAdd the local.conf (details) to the correct path:
$ sudo nano /etc/apache2/sites-available/local.confOR Add the local-ssl.conf (details) to the correct path:
$ sudo nano /etc/apache2/sites-available/local-ssl.confTurn off the default website:
$ sudo a2dissite 000-default.confTurn on the local configurations:
$ sudo a2ensite local.confOR Turn on the local configurations:
$ sudo a2ensite local-ssl.confSetup the SSL with your docker container?
Depends on where in the container your application will get the keys.
Usually mounting files directly from the /home/user/cloud/letsencrypt/certificates folder, into your comtainer via the docker-compose.yml file will do.
Example:
volumes:
- '/home/user/cloud/letsencrypt/certificates/jcb.yourdomain.com.crt:/opt/bitnami/apache/conf/server.crt'
- '/home/user/cloud/letsencrypt/certificates/jcb.yourdomain.com.key:/opt/bitnami/apache/conf/server.key'readmore...
Restart Apache:
$ sudo service apache2 restartThat is all that is needed, you can add more proxies to the local.conf as needed, and just reload Apache each time.
@Llewellynvdm
The correct path to add
local.confis in the /etc/apache2/sites-availabledirectory instead of /etc/apache2/sites-enabled