Jun 03 2010

How To Setup Virtual Host on Local Web Server using Apache on Windows

there are 2 files that needed to be edited in order to create virtual host on local computer .

1.  apache side  :

./apache/conf/httpd.conf

enable for include httpd-vhosts.conf :

Include conf/extra/httpd-vhosts.conf


./apache/conf/extra/httpd-vhosts.conf    , to configure the virtual host

ex :

NameVirtualHost 127.0.0.1

<VirtualHost 127.0.0.1>

DocumentRoot “E:/folder/to/web1/”

ServerName web1.local

</VirtualHost>

<VirtualHost 127.0.0.1>

DocumentRoot “E:/folder/to/web2/”

ServerName web2.local

</VirtualHost>

2. windows site, for the resolving dns

C:\Windows\system32\drivers\etc\hosts

127.0.0.1       creation.dedy.com
127.0.0.1       balivilla.local

127.0.0.1       web1.local

127.0.0.1       web2.local

then restart apache

1 Comment

  • By ekozul, June 22, 2010 @ 8:30 am

    thanks for sharing, it’s very usefull

Other Links to this Post

RSS feed for comments on this post. TrackBack URI

Leave a comment

WordPress Themes