I have a Apache server running on my desktop and I was wondering how I can get more than one virtual host, eg
http://localhost/ is currently pointed to my main folder but I'd like another one,
http://localhost2/ or w/e, to point to another folder for a specific site.
I've been told it is possible but I can't find a tutorial that has actualy worked.
Running:
Apache 2
PHP 5
Any help appreciated, thanks.
Solution:
In the
hosts file it should look like:
code:
127.0.0.1 name1
127.0.0.2 name2
127.0.0.3 name3
And in the
httpd.conf file it should be like this:
code:
<VirtualHost 127.0.0.1>
DocumentRoot C:/path
ServerName name1
</VirtualHost>
<VirtualHost 127.0.0.2>
DocumentRoot C:/path/to2
ServerName name2
</VirtualHost>
<VirtualHost 127.0.0.3>
DocumentRoot C:/path/to/it
ServerName name3
</VirtualHost>