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

Tomcat configure https self-signed certificate (keytool generation)

2025-03-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

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

Tomcat configures https self-signed certificate (keytool generation) to generate keystore

Keytool-genkeypair-alias "server"-keyalg "RSA"-validity "365"-keystore "/ app/webapp/tomcat/https/server.keystore"

[webapp@machina https] $pwd/app/webapp/tomcat/https [webapp@machina https] $keytool-genkeypair-alias "server"-keyalg "RSA"-validity "365"-keystore "/ app/webapp/tomcat/https/server.keystore" Enter keystore password: Re-enter new password: What is your first and last name? [Unknown]: 10.13.22.102What is the name of your organizational unit? [Unknown]: aiWhat is the name of your organization? [Unknown]: aiWhat is the name of your City or Locality? [Unknown]: gzWhat is the name of your State or Province? [Unknown]: gdWhat is the two-letter country code for this unit? [Unknown]: cnIs CN=10.13.22.102, OU=ai, O=ai, L=gz, ST=gd, C=cn correct? No: yesEnter key password for (RETURN if same as keystore password): Re-enter new password: Warning:The JKS keystore uses a proprietary format. It is recommended to migrate to PKCS12 which is an industry standard format using "keytool-importkeystore-srckeystore / app/webapp/tomcat/https/server.keystore-destkeystore / app/webapp/tomcat/https/server.keystore-deststoretype pkcs12". [webapp @ machina https] $modify configuration server.xml [webapp@machina conf] $pwd/app/webapp/tomcat/apache-tomcat-7.0.88/conf [webapp@machina conf] $vi server.xml

Change to:

Save:

: wq

Modify the default port 8443 in https's tomcat (or not, use the default).

Here it is changed to 18003. A total of three modifications. The other two are in the notes, but do not modify them.

Modify the web.xml of tomcat to force http to jump to https

[webapp@machina conf] $pwd

/ app/webapp/tomcat/apache-tomcat-7.0.88/conf

[webapp@machina conf] $vi web.xml

Add the following paragraph:

CLIENT-CERT Client Cert Users-only Area SSL / * CONFIDENTIAL restart tomcat [webapp@machina bin] $pwd/app/webapp/tomcat/apache-tomcat-7.0.88/bin [webapp@machina bin] $sh Shutdown.shUsing CATALINA_BASE: / app/webapp/tomcat/apache-tomcat-7.0.88Using CATALINA_HOME: / app/webapp/tomcat/apache-tomcat-7.0.88Using CATALINA_TMPDIR: / app/webapp/tomcat/apache-tomcat-7.0.88/tempUsing JRE_HOME: / opt/jdk1.8.0_151Using CLASSPATH: / app/webapp/tomcat/apache-tomcat-7.0.88/bin/bootstrap.jar:/app/ Webapp/tomcat/apache-tomcat-7.0.88/bin/tomcat-juli.jarJava HotSpot (TM) 64-Bit Server VM warning: ignoring option PermSize=256m Support was removed in 8.0Java HotSpot (TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m Support was removed in 8.0 [webapp@machina bin] $sh startup.shUsing CATALINA_BASE: / app/webapp/tomcat/apache-tomcat-7.0.88Using CATALINA_HOME: / app/webapp/tomcat/apache-tomcat-7.0.88Using CATALINA_TMPDIR: / app/webapp/tomcat/apache-tomcat-7.0.88/tempUsing JRE_HOME: / opt/jdk1.8.0_151Using CLASSPATH: / app/webapp/tomcat/apache-tomcat- 7.0.88/bin/bootstrap.jar:/app/webapp/tomcat/apache-tomcat-7.0.88/bin/tomcat-juli.jarTomcat started. Visit

"http://10.13.22.102:18002/ops/app

Automatic jump:

"https://10.13.22.102:18003/ops/app

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

Network Security

Wechat

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

12
Report