The realization of configuring multiple domain names under wampserver is mainly through modifying the Apache configuration file httpd.conf, modifying the httpd-vhosts.com file, and modifying the hosts file.For details, please see below.
When I was learning cross-domain,I wrote an article calledUse multi-port access under wampserverArticle, the default localhost uses port 80. The core that can be accessed using multiple ports is to create a new port.That is to create a new http service, so we can create a new service file pointing to port 8080 under the apache configuration file.Then create a new folder (to store the code), start the service,It's ok.
Today I am going to talk about how to implement the configuration of multiple domain names.Generally, after the installation of wampserver, there will be a www folder. The newly created files can be accessed using localhost + relative address, but for example, I created a new folder called google under www.We can use localhost/google/to access this folder or the files in the folder,But how do I do it if I want to visit it?
In fact, this is much simpler than the previous multi-port access.
1.Modify the Apache configuration file httpd.conf
First we open the apache configuration file httpd.conf. For example, mine is in the f:\ wamp \ bin \ apache \ apache2.2.17 \ conf folder.Find this line:
Remove the comment (delete the leading pound sign).
2.Modify the httpd-vhosts.conf file
Open the httpd-vhosts.conf file in the f:\ wamp \ bin \ apache \ apache2.2.17 \ conf \ extra folder, and add this section,such as:
documentroot "f:\ wamp \ www \ google"
3.Modify the hosts file
Open c:\ windows \ system32 \ drivers \ etc \ hosts and add a sentence:
4.New Google folder
Create a new folder called google under the www folder.Add an arbitrary file in it,For example index&s=al, then you can access it with.
5.Modify the httpd-vhosts.conf file again
At this time, if you go to localhost and find that you cannot access it again,You need to modify the httpd-vhosts.conf file again and add:
documentroot "f:\ wamp \ www"
Visit localhost/index.html, and it's ok!
When looking for relevant information,I found that basically this step is added,That is, in the httpd.conf file, find this paragraph:
order deny, allow
deny from all
Modify it to:
options followsymlinks includes
order deny, allow
allow from all
But I did not modify it and it will work.If the expected results are not achieved after the above steps,Maybe try adding this step.
The above content is how to configure multiple domain names under wampserver.Hope everyone likes it.
- server - about netlify settings in muumuu domain
- Method for multiple domain name configuration of one nginx server
- Nginx implements different server header information output methods for different domain names
- Method of HTTP 301 jump to domain name with www in Nginx server
- Win7 system log prompts a liberation method for the name resolution of the name "domain name" after a DNS server that
- Detailed explanation of Tomcat server binding multiple domain names and virtual directories
- Example of configuring a personalized secondary domain name and multiple domain names under the Nginx server
- The nginx server is configured to solve the cross-domain problem of the API
- Configure the Apache server to block all illegal domain names from accessing its own server