Skip to content

Instantly share code, notes, and snippets.

@ohrionmartin
Forked from Llewellynvdm/Apache-proxy-setup.md
Last active July 2, 2021 10:39
Show Gist options
  • Save ohrionmartin/e07bb49cacafa787fd69864b27e013db to your computer and use it in GitHub Desktop.
Save ohrionmartin/e07bb49cacafa787fd69864b27e013db to your computer and use it in GitHub Desktop.
Easy Joomla! 3.9.27 Docker Composer File

Apache Proxy Setup Instructions for Ubuntu 20.04

First Upate System:

$ sudo apt update
$ sudo apt upgrade -y

Install Apache:

$ sudo apt install -y apache2

Install build-essential:

$ sudo apt install -y build-essential

Install dependacies:

$ sudo apt install -y libapache2-mod-proxy-html libxml2-dev

Configure Apache:

$ sudo a2enmod proxy
$ sudo a2enmod proxy_http
$ sudo a2enmod proxy_ajp
$ sudo a2enmod rewrite
$ sudo a2enmod deflate
$ sudo a2enmod headers
$ sudo a2enmod proxy_balancer
$ sudo a2enmod proxy_connect
$ sudo a2enmod proxy_html

Add the local.conf (details) to the correct path:

$ sudo nano /etc/apache2/sites-available/local.conf

Turn off the default website:

$ sudo a2dissite 000-default.conf

Turn on the local configurations:

$ sudo a2ensite local.conf

Restart Apache:

$ sudo service apache2 restart

That is all that is needed, you can add more proxies to the local.conf as needed, and just reload Apache each time.

version: '2'
services:
JCB_web:
# image created for this task
image: vdmio/joomla:3.9.27-Stable
container_name: JCB_joomla
restart: unless-stopped
environment:
WEBSITEDOMAIN: jcb.yourdomain.com
WEBSITESNAME: "Joomla Component JCB"
WEBSITESUNAME: "Your Name"
WEBSITESUSERNAME: username
WEBSITESUSERPASS: diegeheimewagwoord
WEBSITESPASSRESET: 0
WEBSITESEMAIL: "joomla@yourdomain.com"
DBDRIVER: mysqli
DBHOST: JCB_mysql
DBUSER: JCB
DBPASS: diegeheimewagwoord
DBROOTPASS: diegeheimewagwoord
DBNAME: JCB
DBPREFIX: jcb
SMTPHOST: JCB_mailcatcher
STARTUP_COMMAND_1: deploy_joomla
links:
- JCB_mysql
- JCB_mailcatcher
depends_on:
- JCB_mysql
volumes:
# To set persistence
- '~/JCB_joomla:/var/www/html'
# To remove persistence
# - web-root:/var/www/html
networks:
- JCB-NETWORK
ports:
- 180:80
- 443:443
JCB_mysql:
image: mysql:5.7
container_name: JCB_mysql
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: diegeheimewagwoord
volumes:
# To set persistence
- '~/JCB_db-data:/var/lib/mysql'
# To remove persistence
# - db-data:/var/www/html
networks:
- JCB-NETWORK
JCB_phpmyadmin:
image: phpmyadmin/phpmyadmin
container_name: JCB_phpmyadmin
restart: unless-stopped
environment:
PMA_HOST: JCB_mysql
PMA_PORT: 3306
# PMA_USER: root
# PMA_PASSWORD: diegeheimewagwoord
links:
- JCB_mysql
networks:
- JCB-NETWORK
ports:
- 181:80
JCB_mailcatcher:
image: schickling/mailcatcher
restart: unless-stopped
container_name: JCB_mailcatcher
networks:
- JCB-NETWORK
ports:
- 182:1080
networks:
JCB-NETWORK:
driver: bridge
ipam:
config:
- subnet: 172.16.12.0/24
# To remove persistence
# volumes:
# web-root:
# db-data
<VirtualHost *:80>
ProxyPreserveHost On
ServerName jcb.yourdomain.com
ProxyPass / http://127.0.0.1:180/
ProxyPassReverse / http://127.0.0.1:180/
</VirtualHost>
<VirtualHost *:80>
ProxyPreserveHost On
ServerName db.yourdomain.com
ProxyPass / http://127.0.0.1:181/
ProxyPassReverse / http://127.0.0.1:181/
</VirtualHost>
<VirtualHost *:80>
ProxyPreserveHost On
ServerName mail.yourdomain.com
ProxyPass / http://127.0.0.1:182/
ProxyPassReverse / http://127.0.0.1:182/
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment