omcat default startup is 8080, if you want to change to 80, you need to modify the Server.xml file:
# vim/usr/local/tomcat/conf/server.xml
Found:
<connector port= "8080" protocol= "http/1.1"
Modified to:
<connector port= "protocol="
Save, restart Tomcat:
Service tomcat stop
Service Tomcat start
The script does not support restart, so you can only stop and then start.
below to define a think
# cd/usr/local/tomcat/conf/
# vim Server.xml
Find </Host> next line insert new <Host> content as follows:
< Host name= "www.154.com" appbase= "/data/tomcatweb"
Unpackwars= "false" autodeploy= "true"
Xmlvalidation= "false "Xmlnamespaceaware=" false "
<context path=" "docbase=" "debug=" 0 "reloadable=" true "crosscontext=" true "/ #注意将docBase的路径, this side is the empty form, indicating that the root directory is in the directory specified by AppBase. Remember: do not think. Or./such a form.
#<context path= "" docbase= "./" debug= "0" reloadable= "true" crosscontext= "true"/>
#里面的docBase If it is a direct emptying, the site root directory is the path that appbase points to "/data/tomcatweb" if specified as./root #那就是 /data/tomcatweb/root. In this way, you will have to put the corresponding website script into the appropriate directory.
</Host>
then the WebAppsThe contents of the entire directory are copied to the new directory.
cp-r/usr/local/tomcat/webapps/*/data/tomcatweb/
after saving, restart Tomcat:
# service Tomcat Stop
# service Tomcat start
The following test JSP parsing
# vim/data/tomcatweb/111.jsp
The contents are as follows:
Now time is : <%=new java.util.Date ()%>
</center></body>
then visit
# curl-xlocalhost:80 www.111.com/111.jsp
See if the results are similar:
Now time is:wed Jan 22:33:37 CST
</center></body>
[size=13.3333px] If there is an error, welcome to shoot Bricks
Tomcat 8.0 virtual machine configuration documentation