Wamp is widely used. Its silly installation and configuration allow us to easily complete the previously cumbersome server environment setup process and directly access the Web application deployment, it is also very easy to maintain in the future.
However, Wamp only provides single-site erection by default, which is one of its shortcomings. However, this disadvantage can be overcome through some simple operations. There are many related articles on the Internet, but many of them are not suitable and the steps are cumbersome. After many failures and software reinstallation experiences, the following briefly summarizes the configuration process of Wamp for multiple sites.
The first necessary materials are: Wamp, mouse, keyboard, display ...... (Well, it's a joke. Let's get started .)
This section mainly introduces the configuration in Wamp 2.3. Currently, it seems to be the latest version. The configuration of other versions should be slightly different.
First, open httpd in the installation directory Wamp/bin/Apache/apache2.3.14/CONF/In the text editor. CONF file. For example, if the site directory is under D:/Wamp/www/, it is generally like the following:
DocumentRoot "D:/Wamp/www /"
<Directory "D:/Wamp/www/">
Options indexes followsymlinks execcgi
Order allow, deny
Allow from all
AllowOverride all
</Directory>
Add another site parameter above or below. For example, the root directory of the site is in the D:/Wamp/test/folder, as shown below:
DocumentRoot "D:/Wamp/test /"
<Directory "D:/Wamp/test/">
Options indexes followsymlinks execcgi
Order allow, deny
Allow from all
AllowOverride all
</Directory>
Add the following code at the bottom of the httpd. conf file (servername can be set by yourself ):
<Virtualhost *: 80>
DocumentRoot "D:/Wamp/www /"
Servername website
</Virtualhost>
<Virtualhost *: 80>
DocumentRoot "D:/Wamp/test /"
Servername Test
</Virtualhost>
Finally, you need to modify the host file, usually in the C:/Windows/system32/Drivers/etc directory, and add it at the bottom of the file (the website and test are the servername specified above ):
127.0.0.1 website
127.0.0.1 Test