Because Cross-domain requests are used in learning, you have to add multi-site services in the WAMP integration environment.
1, first you want to ensure that the WAMP has been properly installed.
2, then in the Wamp installation directory to find Apache2 httpd.conf files, such as mine is under C:\wamp\bin\apache\Apache2.2.21\conf. Copy the file, rename it to httpd2.conf (any), and save it under the Conf folder (together with httpd.conf).
To modify httpd2.conf code:
Copy Code code as follows:
From
Listen 80
ServerName localhost:80
DocumentRoot "c:/wamp/www/"
<directory "c:/wamp/www/" >
To
Listen 8080//Apache service new listening port, can be modified according to its own needs
ServerName localhost:8080
DocumentRoot "c:/wamp/www2/"//WWW2 is the directory of our second website, parallel to www
<directory "c:/wamp/www2/" >
3, and then under the C:/wamp to create a new folder named WWW2.
4, the last is the installation of services. Write a bat file directly running on the line, the contents of the file:
Copy Code code as follows:
CD/D C:\wamp\bin\apache\Apache2.2.21\bin
Httpd.exe-k install-n "WWW2"-F "C:\wamp\bin\apache\Apache2.2.21\conf\httpd2.conf"
Alternatively, you can type a command at the command line, go to the bin directory shown above, and then copy the next line of content (note the specific directory and your actual agreement).
The service is installed!
Write a index.html file at random in the WWW2 directory:
<button> This is a button </button>
Notice
But the process may not be so smooth.
For example, when you install a service, you may have an error:
Search engine is a good thing, a wrong search, there are:
Originally a software installation conflict with Windows7 's user Account Control (UAC), simply turn off UAC (Control Panel-user account and home security-system and security-operations center, which has "change user Account Control Settings", Change to never notify, will be prompted to restart after completion, At this point need to restart the installation will be no problem, after installation can be modified back.
Then if it's not, but the service is installed correctly, maybe the service is not turned on, open the service center and turn on the service (command line down net start www2)
Ps:tomcat Configure multi-port access
Application scenario: When a server can only access to the above application through IP, we have multiple javaweb applications to put on a server, how to do?
first step: In Tomcat's conf/server.xml, configure multiple ports as follows:
<?xml version= "1.0"?> <!--application 1, Port port= "8080"--> <service "name=" > Catalina connectiontimeout= "20000" port= "8080" protocol= "http/1.1" redirectport= "8443"/> <connector port= "8009" Protocol= "ajp/1.3" redirectport= "8443"/> <engine defaulthost= "localhost" name= "Catalina" >
Step Two: Open the port in the server
Control Panel-> Firewall-> Advanced Settings-> Inbound rules-> new rule->
Port-> fill in the open port number
Attention matters
There is a domain name, you do not need to use this method
This method is accessed by using the ip+ port number
If the root in Tomcat is not occupied, you can configure the virtual path Access application
The above content is the whole narration of this article, hope to be helpful to everybody. The next article to share wampserver How to configure multiple domain names, the need for friends to continue to focus on cloud-dwelling community sites.