Skip to content

Instantly share code, notes, and snippets.

@i-amolo
Forked from daveh/httpd-vhosts.conf
Created March 10, 2022 17:56
Show Gist options
  • Save i-amolo/8375883ecc50681935c242cec013ff98 to your computer and use it in GitHub Desktop.
Save i-amolo/8375883ecc50681935c242cec013ff98 to your computer and use it in GitHub Desktop.
How to set up a virtual host in Apache (WAMP, MAMP, XAMPP) (code to accompany https://youtu.be/kRfo5OPUC2M)
<VirtualHost *:80>
DocumentRoot "/www/project1"
ServerName site1.localhost
<Directory "/www/project1">
Require all granted
AllowOverride All
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/www/project2"
ServerName site2.localhost
<Directory "/www/project2">
Require all granted
AllowOverride All
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/path/to/original/web/root"
ServerName localhost
</VirtualHost>
# Virtual hosts
Include etc/extra/httpd-vhosts.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment