Below are the simple steps for Virtual host configuration process in windows. For this approach you need to change the files at 3 areas.
Change the Apache Httpd
In WAMP server open the apache path at C:/wamp/bin/apache/Apache2.2.11/conf/httpd.conf
Here we can check the below configuration.
<Directory "c:/wamp/www/">
Order Deny,Allow
Deny from all
Allow from all
</Directory>
And also remove the # at httpd virtual hosts configuration file path & rewrite module path. As like below
Include conf/extra/httpd-vhosts.conf
LoadModule rewrite_module modules/mod_rewrite.so
Change the Apache Httpd Virtual Host
In this file check the virtual host port number, located at C:/wamp/bin/apache/Apache2.2.11/conf/extra/httpd-vhosts.conf
NameVirtualHost *:80
And also add the below code. This is related to php application path.
<VirtualHost *:80>
DocumentRoot "C:/wamp/www/yahoo.com"
ServerName yahoo.com
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/wamp/www/rediff.com"
ServerName rediff.com
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/wamp/www/gmail.com"
ServerName gmail.com
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/wamp/www"
ServerName localhost
</VirtualHost>
Add the virtual host Url's
The above all virtual Url's are added at windows drivers path. Below is the path of the hosts provided location. Most properly this location is under C drive.
Windows/system32/drivers/etc/hosts
In this file add the below locations list.
127.0.0.1 localhost
127.0.0.1 yahoo.com
127.0.0.1 rediff.com
127.0.0.1 gmail.com
After adding the hosts restart the system. Now you can access the virtual hosts paths. like http://yahoo.com
that's enough....
Change the Apache Httpd
In WAMP server open the apache path at C:/wamp/bin/apache/Apache2.2.11/conf/httpd.conf
Here we can check the below configuration.
<Directory "c:/wamp/www/">
Order Deny,Allow
Deny from all
Allow from all
</Directory>
And also remove the # at httpd virtual hosts configuration file path & rewrite module path. As like below
Include conf/extra/httpd-vhosts.conf
LoadModule rewrite_module modules/mod_rewrite.so
Change the Apache Httpd Virtual Host
In this file check the virtual host port number, located at C:/wamp/bin/apache/Apache2.2.11/conf/extra/httpd-vhosts.conf
NameVirtualHost *:80
And also add the below code. This is related to php application path.
<VirtualHost *:80>
DocumentRoot "C:/wamp/www/yahoo.com"
ServerName yahoo.com
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/wamp/www/rediff.com"
ServerName rediff.com
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/wamp/www/gmail.com"
ServerName gmail.com
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/wamp/www"
ServerName localhost
</VirtualHost>
Add the virtual host Url's
The above all virtual Url's are added at windows drivers path. Below is the path of the hosts provided location. Most properly this location is under C drive.
Windows/system32/drivers/etc/hosts
In this file add the below locations list.
127.0.0.1 localhost
127.0.0.1 yahoo.com
127.0.0.1 rediff.com
127.0.0.1 gmail.com
After adding the hosts restart the system. Now you can access the virtual hosts paths. like http://yahoo.com
that's enough....
No comments:
Post a Comment