Tomcathttps access settings

Source: Internet
Author: User
1 & gt; use the jdk tool to generate the key file [plain] viewplaincopyprint? Keytool-genkey-aliastomcat-keyalgRSA-keypasschangeit-storepasschangeit-keystoreserver.keystore-validity36002 & gt; to 1> use jdk tools to generate key files
 
[Plain] view plaincopyprint?
Keytool-genkey-alias tomcat-keyalg RSA-keypass changeit-storepass changeit-keystore server. keystore-validity 3600
 
2> go to tomcat/config/server. xml and find
 
 
 
 
Remove comments and add key file configuration
 
 
MaxThreads = "150" scheme = "https" secure = "true"
ClientAuth = "false" sslProtocol = "TLS"
KeystoreFile = "server. keystore"
KeystorePass = "changeit"/>
 
After saving and restarting tomcat, you can access tomcat through https: // ip: 8443/webproject (your web project) over https. Port 8443 is used above. if port 443 is changed to port, because 443 is the default https port
 
 
Force https access
 
In tomcat \ conf \ web. xmlAdd the following configuration:
 
 

 
CLIENT-CERT 
Client Cert Users-only Area  
 

 

SSL  
/*  
 

CONFIDENTIAL  
 
 
 
Enter http: // ip: 8080/webproject to force redirect to https: // ip: 8443/webproject.
 
 
If the https port is set to another port, remember to change the http transfer port together.
Www.2cto.com
 
ConnectionTimeout = "20000"
RedirectPort = "8443" URIEncoding = "UTF-8"/>


Column of the author ChinFeng

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.