Monday, April 1, 2013

Configure apache virtual host


Make a entry to: C:\Windows\System32\drivers\etc\hosts
-----------------------------------------------------------
127.0.0.1    test.com
127.0.0.1    www.test.com

File Location:
-----------------------------------------------------------
C:\xampp\apache\conf\extra\httpd-vhosts

File Contents:

<VirtualHost 127.0.0.1:80>
    DocumentRoot "C:/xampp/htdocs"
    ServerName localhost
</VirtualHost>

<VirtualHost 127.0.0.1:80>
    ServerAdmin pritomkucse@gmail.com
    DocumentRoot "D:/src/test"
    ServerName test.com
    ServerAlias www.test.com
    ErrorLog "logs/test.error.log"   
    CustomLog "logs/test.custom.log"
    <Directory "D:/src/test">
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Order allow,deny
        Allow from all
        Require all granted
    </Directory>
</VirtualHost>

No comments:

Post a Comment