How direct access by entering the IP domain name

To tomcat application server as an example, we will deploy a testProject project to tomcat's webapps below, start tomcat, but by how we enter http: // domain to directly access the program you want it, here in www.testProject. com domain name as an example.

Modify tomcat's conf folder server.xml file:

1, the port number to 8080 80

<Connector port="80" protocol="HTTP/1.1"
    connectionTimeout="20000"
    redirectPort="8443" />    

2, the engine instead of the domain name you want defaultHost

<Engine name="Catalina" defaultHost="www.testProject.com">

3, the name was changed to Host the domain name you want

<Host name="www.testProject.com" appBase="webapps"

4, the <Host> </ Host> Internal added <Context /> tag, as follows:

<Host name="www.testProject.com"  appBase="webapps"

            unpackWARs="true" autoDeploy="true"><Context docBase="testProject" path="" reloadable="true" />

testProject is the project name, path to default

5, restart tomcat, enter http://www.testProject.com try it!

If the time of the visit appeared out of memory, then you need to increase the cache tomcat

Setting method:

Add two environment variables:

TOMCAT_OPTS    -Xms512m -Xmx1024m

CATALINA_OPTS  -Xms512m -Xmx1024m

Guess you like

Origin www.cnblogs.com/hecanlin/p/11084029.html