tomcat deployment remove the project name

 

 Remove the project name and port:

First, enter the conf directory under the installation directory of tomcat, my directory is /usr/local/apache-tomcat-xxx/conf, edit the file server.xml.

 

 

1. Remove the port number 8080.

Put the server.xml in

 <Connector port="8080" protocol="HTTP/1.1"

               connectionTimeout="40000"

               redirectPort="8443"  enableLookups="false"  minProcessors="10" maxProcessors="1024" acceptCount="1024" />

change to

 <Connector port="80" protocol="HTTP/1.1"

               connectionTimeout="40000"

               redirectPort="8443"  enableLookups="false"  minProcessors="10" maxProcessors="1024" acceptCount="1024" />

That is, just change "8080" to "80" port.

 

2. Remove the project name projectName.

In server.xml, add <Context path="" docBase="/usr/local/p1/sifangzhifu" debug="0"/> between tags of <host>...</host>

 

 

Restart tomcat and enter http://192.168.1.120/

You can directly access your project.

 

Mapping domain name access:

Modify Host

 

<Host name="www.test.com"  debug="0" appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"> 

 

<Context path="/" docBase="/test"  debug="0" reloadable="true"></Context> 

 

</Host> 

 

In this way, you can access the project whose project name is test through the domain name www.test.com.

 

If there are multiple domain names bound to the host, just add host directly

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326225307&siteId=291194637