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

3 Comments

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

    thanks for sharing, it’s very usefull

  • By Omar Salim, November 14, 2011 @ 10:20 am

    makasih.. sangat bermanfaat

  • By Website Builder, July 4, 2012 @ 6:10 pm

    I used to be suggested this website by means of my cousin. I am now not certain whether this submit is written by him as no one else understand such unique approximately my trouble. You’re amazing! Thank you!

Other Links to this Post

RSS feed for comments on this post. TrackBack URI

Leave a comment

WordPress Themes