How to setup virtualhost for multiple domain name on windows ? I will use it for my own test projects. I have 3 projects that I need to setup and at the moment I'm using xampplite for the portable apache.
- www.foo-bar.com --> direct to c:\xampplite\htdocs\foo-bar\
- www.abcdef.com --> directo to c:\xampplite\htdocs\abcdef\
- www.qwerty.com --> direct to c:\xampplite\htdocs\qwerty\web\
I also need to access on another project but it just like typing http://localhost/my-project/
how to write the vhost configuration for that ?
To get
C:/xampp/htdocs/my-project/
working I had to add the following (default?) VirtualHost toapache\conf\extra\httpd-vhosts.conf
(in step 2 of MicE tutorial).You need to do several steps in order to make this work.
1.) Update the
hosts
file. On Windows XP, you can find it underc:\WINDOWS\system32\drivers\etc\
. You should already see the first line from below, it takes care of your mentioned other project. - add the additional ones to make any requests to the mentioned virtual hosts routed back to your own machine.2.) Update the vhosts file in Apache configuration. Under your XAMPP folder, add the following to
apache\conf\extra\httpd-vhosts.conf
and if needed change the ports (i.e. if you use 8080 instead of port 80).3.) Do a quick configuration check. Open
{XAMPP-folder}\apache\conf\httpd.conf
your file and make sure that the following part is not commented out by a preceeding#
character:4.) Restart XAMPP.
... and you should be all setup now. Your other project should be accessible at the URI you mentioned if you just put it under
C:/xampplite/htdocs/my-project/
.