Tomcat 8.0 virtual machine configuration documentation

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.