Configure the https environment in tomcat and the tomcathttps Environment

Source: Internet
Author: User

Configure the https environment in tomcat and the tomcathttps Environment
I searched on the Internet, but the content was not perfect. Now, make Study Notes for future use.
(1) Go to the bin directory under jdk.


(2) input the following command "keytool-v-genkey-alias tomcat-keyalg RSA-keystore d:/tomcat. keystore"


D:/tomcat. keystore stores the generated tomcat. keystore in the root directory of drive d. Note: If you want to store the data on the C drive, you must enter the command line as an administrator in Windows 7. Otherwise, you cannot create tomcat. keystore. In this example, put it on disk D.
How can I access the command line as an administrator? Start-> Enter cmd in the search box-> wait (note not to press Enter)-> Find "cmd.exe"-> right-click "Run as administrator.

(3) enter the keystore Password


The password is arbitrary. Here we use 123456 as an example. Remember this password and then use it for server. xml configuration.

(4) enter the name, organization, organization, city, province, and country information


(5) A confirmation prompt will appear after the input.


Enter y and press Enter. The keystore is created.
Go to the root directory of disk D and you will see the generated tomcat. xml.


(6) enter the tomcat master password


You can press enter directly. The default value is the same as the keystore password.
The storage is complete.

(7) enter the tomcat folder

Locate sever. xml in the conf directory and edit it.

Comment out all ctor ins starting with <Connector port = "8443.

(8) Add the code for loading the keystore in sever. xml.


Note that the keystore password in the box is the "123456" we just set ".
Close and save sever. xml after editing.

(9) start tomcat.

If the following error occurs: "Keystore was tampered with, or password was incorrect", the password set in step (8) is incorrect. Check the password and re-compile sever. xml.



(10) Use https: // 127.0.0.1: 8443 to access the page
If the page is successfully opened, the https configuration under tomcat is successful.

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.