Description:
I add a domain name simulation in this machine, assuming that the host is directly configured to use it. The tomcat I used was apache-tomcat-7.0.42.
Add Domain name locally
This article describes how to change the configuration of Tomcat. Enable direct access to the Tomcat application via IP address or domain name.
First I have 4 domains configured on my own host
Configure the Server.xmlport number
1. Locate the home folder for Tomcat. Go to the Conf folder, locate the Server.xml file, and open:
2. Change Tomcat's monitor port to 80port: Ensure other server 80port is not occupied talent use
Found in Server.xml file:
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
Change into:
<Connector port="80" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
Configure single work folder single domain name
- Found in Server.xml file:
<Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true">
4. Replace the localhost in the content found in 3rd with the IP address or domain name you want to change.
In the middle of the label. Add for example the following content:
<Context path="" docBase="/rapidoProject"/>
Description: Host represents a virtual folder. Each virtual folder corresponding to a project, a project can be the corresponding multiple domain names
The Name property of host is found in multiple domain names and can be easily taken, meaning
The value of the docbase can also be an absolute path. I'm using a relative path here, relative to the AppBase WebApps.
Defines a common Web project Rapidoproject, in index.jsp content such as
Start Tomcat
Access to other domain names is invalid. Nothing is going back.
Configure a single working folder multi-domain
Now I use 2 domain names to point to the same project folder, change the host value such as the following
When visiting rapido.com, you will also be interviewed for the Rapidoproject project.
Configure multi-Work folder single/multi-domain
Next, configure multi-project multi-domain names using the same method. Add Host node Configuration
Configure the default Run virtual folder
Engine can configure the default host node
Changed to
Assuming that localhost is not changed by default, add a working folder that preserves the default of localhost by using the domain name change place
Tomcat configuring domain names and virtual folders