Skip to content

Instantly share code, notes, and snippets.

@juliojsb
Last active November 29, 2015 13:52
Show Gist options
  • Save juliojsb/b2671d36c2cdea04d0b9 to your computer and use it in GitHub Desktop.
Save juliojsb/b2671d36c2cdea04d0b9 to your computer and use it in GitHub Desktop.
An example of Name based Virtual Hosting in Apache
# Name based Virtual Hosting
Listen 80
# Site 1
<VirtualHost *:80>
DocumentRoot "/var/www/html/site1"
ServerName www.site1.com
</VirtualHost>
# Site 2
<VirtualHost *:80>
DocumentRoot "/var/www/html/site2"
ServerName www.site2.com
</VirtualHost>
# Site 3
<VirtualHost *:80>
DocumentRoot "/var/www/html/site3"
ServerName www.site3.com
</VirtualHost>
# Site 4
<VirtualHost *:80>
DocumentRoot "/var/www/html/site4"
ServerName www.site4.com
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment