Tomcat builds the web and provides Java page access!

Source: Internet
Author: User

Two. Configure Tomcat (case-sensitive) virtual host to build multiple web
1. Modify the configuration file Vim/usr/local/tomcat/conf/server.xml
Unpackwars= "true" autodeploy= "true" >
</Host>
Unpackwars= "true" autodeploy= "true" >
</Host>
2. Create a Web page
Configuration file can be seen in a file to be placed under Tomcat, combined with the default Web file to be placed under root; Create as follows
Mkdir-p/usr/local/tomcat/{a,b}/root (Create Virtual host Web page path)
echo AA >/usr/local/tomcat/a/root/index.html (write Web content)
echo BB >/usr/local/tomcat/b/root/index.html (write Web content)
The default condition to be placed in root can be manually modified, you need to send the following command to <Host> and </Host> Center
<context path= "" docbase= "base" reloadable= "true"/> So modified, is to put the Web page into the a/base file added

Three. Implementing path jumps
When the browser enters Www.a.com/test, the website provides the page from the/var/www/html/
<context path= "/test" docbase= "/var/www/html" reloadable= "true"/>
Four. HTTPS for encrypted website

    1. keytool-genkeypair-alias tomcat-keyalg rsa-keystore/usr/local/tomcat/keystore (Generate key)
      #gen generate key
      #alia S-alias
      #keyalg algorithm
      #keystore key storage location
      2. Modify the main configuration file, add the generated key, (about 84 lines) Uncomment first "<!--" "--" and only the last
      line needs to be added;
      <connector port= "8443"
      protocol= "Org.apache.coyote.http11.Http11NioProtocol"
      maxthreads= "150" Sslenabled= "true" scheme= "https" secure= "true"
      Clientauth= "false" sslprotocol= "TLS"
      keystorefile= "/usr/ Local/tomcat/keystore "keystorepass=" 123456 "/>
      3. Restart Service
      /usr/local/tomcat/bin/shutdown.sh
      /usr/local/ TOMCAT/BIN/STARTUP.SH
      4. Client authentication, specifically indicating access to port 8443 because the open security port in the configuration file is 8443
      https://www.a.com:8443
      Five. Tomcat optimization
      1. Concurrency optimization
      Modify configuration file Vim/usr/local/tomcat/conf/server.xml (approximately 60 lines)
      Add the following
      <connector port= "8080" protocol= " http/1.1 "
      maxthreads=" 1000 "Maximum number of threads
      minsparethreads=" "
      maxsparethreads=" "
      Enablelookups=" false "
      uriencoding=" Utf-8 "
      acceptcount=" 1000 "Maximum number of queues

Tomcat builds the web and provides Java page access!

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.