Multi-site configuration in Wamp

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.