Today the Wamp configuration to understand, need to remember, or else forget to learn again. In fact, the configuration method is very simple, my wamp installed in the F plate, if you install in C disk, change the path on it, follow me to do, you can configure well. is divided into three steps:
One: Modify the F:\wamp\bin\apache\apache2.4.9\conf\extra folder under the httpd-vhosts.conf file, need to modify the place I have marked the file as follows:
Learning English should be able to understand, these two are written by someone else, when you configure the time can be directly modified above, can also be preceded by "#" comment out. Let me explain: serveradmin is the administrator's mailbox (can be removed or not modified); DocumentRoot is the directory of the site, I modified to "f:/wamp/www/demo1"; servername is the name of the site, I modified for demo1.com; Serveralias is the alias of the site, can be modified to www.demo1.com; ErrorLog is the error log (can be removed or not modified), the directory itself specified, Customlog is the access log (can be removed or not modified), the directory itself specified.
I set up three sites under the WWW folder in Wamp.
1:localhost (default), modify the DocumentRoot path for DocumentRoot "f:/wamp/www/" but this site can optionally specify any directory;
2:demo1.com, modify the DocumentRoot path for DocumentRoot "F:/wamp/www/demo1";
3:demo2.com, modify the DocumentRoot path for DocumentRoot "F:/wamp/www/demo2";
Remember that you do not need to comment out the place, there is no comment on the line, Apache can not start normally, modified as follows:
Note: The above is to configure the necessary modules for multi-site, but we also need to apply or open this module in the Apachep configuration file;
Second: In the Apache configuration file to open the multi-site module, that is, to open the configured modules above
The Apache configuration file is:
F:/wamp/bin/apache/apache2.4.9/conf/httpd.conf. Be sure to back up the file before you configure it, otherwise a step error may not start, my Apache version is 2.4.9, so we open this file, search for the word httpd-vhost, then remove the previous comment, and remove the configuration as shown in the following figure:
Then find the Onlineoffline Word, modify the permissions, the purpose is to allow all external access to access to the server;
Modified code:
Third: Finally we modify the host file, so that the configured site has a domain name point
Add three sentences after the host file as shown in the following illustration:
If you follow the information I configured above, you can definitely configure the success, a total of three steps, the key is to carefully remember each step of the operation and they represent the meaning. A direct comment on the answer.