Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure tomcat and ssl in linux

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

Linux how to configure tomcat and ssl, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.

1. Install jdk under linux and configure the JAVA_HOME variable class variable

two。 Download tomcat and install it.

3. Open the server port, firewall port and Ali cloud port: use firewall or iptables. (if the Ali Cloud port is not open, it will appear on the server that can use localhost,127.0.0.1 but cannot use the server's own ip)

4. Configure ssl:

In Aliyun's certificate list, click to download the certificate, and you can download the relevant certificate according to your server.

Choose Tomcat, download, Aliyun also comes with tutorials, very convenient. The only thing to note is that ECS on Aliyun only supports port 443, so Tomcat needs to change port 8443 to port 443 and add open port 443 on Aliyun before you can access Tomcat's website with https.

The following is the Tomcat setup tutorial on Aliyun:

Installation certificate

Tomcat supports certificates in JKS format, and certificates in PFX format are also supported from Tomcat7, either of the two certificate formats.

Document description:

The certificate file 21419730644.pem contains two paragraphs. Please do not delete any of them.

If it is the CSR created by the certificate system, it also includes: certificate private key file 21419730644.key, PFX format certificate file 21419730644.pfx, PFX format certificate password file pfx-password.txt.

1. Certificate format conversion

Create the cert directory under the Tomcat installation directory and copy all the downloaded files to the cert directory. If you created the CSR file when applying for the certificate, only the 21419730644.pem file is included in the attachment, and you also need to copy the private key file to the cert directory and name it 21419730644.key.If it is the CSR created by the system, go directly to step 2.

Go to the cert directory and execute the following command to complete the PFX format conversion command. To set the PFX certificate password here, keep in mind:

Openssl pkcs12-export-out 21419730644.pfx-inkey 21419730644.key-in 21419730644.pem

2. PFX certificate installation

Find the file server.xml in the installation Tomcat directory, and the default path is usually in the conf folder. find

Configure certificate steps

(1) decompress the downloaded certificate package and copy the 20165323****.pfx and pfx-password.txt files.

(2) find the tomcat installation directory, enter the conf folder, create a new cert file, and copy the certificate and password to the folder.

(3) find the server.xml file, configure the tomcat ssl certificate by modifying the xml file, and copy the following code into the server.xml file

[note] it is recommended that the default port is 443.It is recommended to use "org.apache.coyote.http11.Http11Protocol" in protocol to maximize performance. (but this will not support the Chinese URIEncoding= "UTF-8" Oh, Chinese will appear garbled. Recommended or HTTP/1.1) use HTTP certificate path keystoreFile

It is recommended to use an absolute path to ensure that the certificate is loaded properly by tomcat. Enter the certificate password as pfx-.

The password in password.txt.

(4) after confirming the correctness, save the configuration and restart tomcat. You can access the https:// domain name of the tomcat server.

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report