Previously wrote an article about configuring a virtual host in a Linux environment;
Now there is another scene; write multiple projects locally at the same time; The local WAMP environment has only one www directory, so it is painful to modify the directory frequently;
So happiness is so unprepared to come, the following describes how to configure the local Wamp multi-directory;
Sample environment:
Wampserver Version: 2.2
Wamp Directory: e:/tongbu/wamp/
Local domain name: localhost
test.com
Local directory: e:/tongbu/wamp/www/
e:/tongbu/wamp/test/
1: Modify the e:/tongbu/wamp/bin/apache/apache2.2.21/conf/httpd.conf file
Find include conf/extra/httpd-vhosts.conf Delete Comment # number approximately 474 lines
Then add the following:
<directory "e:/tongbu/wamp/test/" >
Options Indexes FollowSymLinks
AllowOverride All
Order Allow,deny
Allow from all
</Directory>
2: Modify the e:/tongbu/wamp/bin/apache/apache2.2.21/conf/extra/httpd-vhosts.conf file
Modify the content between <virtualhost *:80></virtualhost> as follows:
<virtualhost *:80>
ServerName localhost
Serveralias localhost
DocumentRoot e:/tongbu/wamp/www/
</VirtualHost>
<virtualhost *:80>
ServerName test.com
Serveralias www.test.com
DocumentRoot e:/tongbu/wamp/test/
</VirtualHost>
3: Modify the C:windows/system32/drivers/etc/hosts file
Add content as follows:
127.0.0.1 localhost
127.0.0.1 test.com
Create the test folder under Wamp directory e:/tongbu/wamp/, and access localhost and test.com locally
The Green Font section changes to its local directory according to the situation;
If you need to configure multiple virtual hosts in the Linux environment to mount Multi-site simultaneous operation can be referenced: The Linux environment Apache configuration multiple Virtual host Mount multi-site simultaneous operation
This article for Bai Jun Remote original article, reprinted without contact with me, but please specify from Bai Jun remote blog baijunyao.com
Set up a local wamp environment to mount multiple sites concurrently running