Configure HTTPS environment under Tomcat

Source: Internet
Author: User
Search on the Internet, the content is not very perfect. Now to organize, to do a study note, for future use.
(1) access to the Bin directory under the JDK


(2) Enter the following instruction "Keytool-v-genkey-alias tomcat-keyalg rsa-keystore d:/tomcat.keystore"


The D:/tomcat.keystore is to place the generated tomcat.keystore in the D-packing directory. Note to put to the C disk, under the Win7 system, you need to enter the command line as an administrator, or you cannot create a tomcat.keystore. This example is placed under D disk.
How do I get to the command line as an administrator? Start-> the search box to enter cmd-> Wait (note not return)-> appears cmd.exe-> right button "Run as Administrator" can be.
(3) Enter KeyStore password


Password arbitrary, this 123456 for example, to remember this password, after the Server.xml configuration need to use.
(4) Enter the name, organizational unit, organization, city, province, country and other information


(5) A confirmation prompt will appear after the input


Enter Y at this time, and return. The completion KeyStore is created at this time.
Access to the D-packing directory to see the generated tomcat.xml


(6) Enter Tomcat's master password


You can enter directly and default to the same password as KeyStore.
After that, it shows that the storage is complete.
(7) Enter Tomcat folder

Find the Sever.xml in the Conf directory and edit it

All Connector annotations that begin with <connector port= "8443".

(8) Add code to load KeyStore in Sever.xml


Notice the KeyStore password in the box, which is the "123456" we set up just now.
Close and save Sever.xml when editing is complete.
(9) Start Tomcat.

If the following error occurs, "Keystore was tampered with,or password is incorrect", that is, the password for step (8) is wrong. Please check the password and rewrite the sever.xml.



(10) After the successful launch, use https://127.0.0.1:8443 access page

The page was successfully opened, i.e., the HTTPS configuration under Tomcat succeeded.

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.