Skip to content

Instantly share code, notes, and snippets.

@juliojsb
Created November 29, 2015 13:54
Show Gist options
  • Save juliojsb/9246079bf82ef6e2c54f to your computer and use it in GitHub Desktop.
Save juliojsb/9246079bf82ef6e2c54f to your computer and use it in GitHub Desktop.
An example of IP based Virtual Hosting in Apache
# VirtualHosting based on IP
Listen 80
# Site 1
<VirtualHost 192.168.2.101:80>
DocumentRoot "/var/www/html/site1"
ServerName www.site1.com
</VirtualHost>
# Site 2
<VirtualHost 192.168.2.102:80>
DocumentRoot "/var/www/html/site2"
ServerName www.site2.org
</VirtualHost>
# Site 3
<VirtualHost 192.168.2.103:80>
DocumentRoot "/var/www/html/site3"
ServerName www.site3.com
</VirtualHost>
# Site 4
<VirtualHost 192.168.2.104:80>
DocumentRoot "/var/www/html/site4"
ServerName www.site4.org
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment