Thursday 11 April 2013

Virtual Host Setup In Window System

How to set up virtual host?

http://localhost will access to all the projects in the file,
http://zf11.localhost will access to only one project and also set the document_path upto that's public folder

Please take the backup of files, before alter to avoid any issue further.

Do the Following simple steps,

1)  Tell the system, what to do when called http://zf11.localhost
FilePath: C:\Windows\System32\drivers\etc\hosts
Add the Following, in above file   localhost   zf11.localhost

2) Tell the apache, to include extra file
FilePath: C:\wamp\bin\apache\Apache2.2.17\conf\http.conf
Uncomment the following line
Include conf/extra/httpd-vhosts.conf

3) Tell the apache, what to do when request come from http://zf11.localhost
FilePath: C:\wamp\bin\apache\Apache2.2.17\conf\extra\conf\extra\httpd-vhosts.conf
Add the following line,  in the end

<VirtualHost *:80>
    DocumentRoot "C:/wamp/www/zf1_11/public_html"
    ServerName zf11.localhost
    <Directory "C:/wamp/www/zf1_11/public_html">
        AllowOverride All
        Order allow,deny
        Allow from all