Skip to content

Instantly share code, notes, and snippets.

@SkaTeMasTer
Last active February 16, 2019 06:41
Show Gist options
  • Save SkaTeMasTer/9fdf8a16b06c06d50d1fbc297da322f9 to your computer and use it in GitHub Desktop.
Save SkaTeMasTer/9fdf8a16b06c06d50d1fbc297da322f9 to your computer and use it in GitHub Desktop.
How to on Bitnami Apache Instance (a la Amazon) help with adding new sub-domains to Apache2.
(1) Find Apache httpd.conf (Bitnami’s setup it’s /opts/bitnami/apache2/conf).
$ sudo nano /opts/bitnami/apache2/conf/httpd.conf
(2) Set up subdomains, you must the add new Virtual Host directive properties:
(a) required: a <VirtualHost> for the main www,
(b) optional: add another <VirtualHost> directive for each every desired sub-domain
(c) double-check the DocumentRoot directories are correct
(3) Lastly, simply restarting Apache daemon to affect your additions.
$ sudo /opt/bitnami/ctlscript.sh
=======================
SAMPLE CONFIG BELOW
========================
#___[httpd.conf]______________________________________________________________________________
# ___[www]_________________________
<VirtualHost *:80>
ServerName www.leechsoftware.com
DocumentRoot "/opt/bitnami/apache2/htdocs"
</VirtualHost>
# ____[images]________________________
<VirtualHost *:80>
ServerName images.leechsoftware.com
DocumentRoot "/opt/bitnami/apache2/htdocs/images.leechsoftware.com"
</VirtualHost>
# _____[blog]_______________________
<VirtualHost *:80>
ServerName blog.leechsoftware.com
DocumentRoot "/opt/bitnami/apache2/htdocs/blog"
</VirtualHost>
#__________________________________________________________________________________________________
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment