Tomcat Add HTTPS Service

Source: Internet
Author: User

System Environment: centos6.7

Jdk-7u79-linux-x64

apache-tomcat-7.0.57

apr-1.5.2

apr-util-1.5.4

One, Tomcat installation

Prepare your own Tomcat and JDK installation package # cd /data/soft# tar xf apache-tomcat-7.0.57.tar.gz  -c  /usr/local/# cd /usr/local# ln -sv apache-tomcat-7.0.57 tomcat #  cd /data/soft # yum -y localinstall jdk-7u79-linux-x64.rpm     #安装jdk # yum -y install openssl-devel      #安装支持ssl # vim  /etc/profile.d/java.sh      #定义JAVA_HOMEexport  java_home=/usr/java/ Latestexport path= $JAVA _home/bin: $PATH # vim /etc/profile.d/tomcat.sh    # Configuring the environment variables for Tomcat export catalina_base=/usr/local/tomcatexport path= $CATALINA _base/bin: $PATH # source  /etc/profile.d/tomcat.sh# source /etc/profile.d/java.sh# catalina.sh start    #启动tomcat,  default listener on port 8080

Second, the test

650) this.width=650, "alt=" Technology share "src=" Http://s1.51cto.com/wyfs02/M00/80/5E/wKiom1c-rgiAFpogAAJ81a0WL_o986.png " Title= "1.png" width= "650" style= "padding:0px;"/>

get springmvc4 mybatis Integration Framework Source Bootstrap HTML5

Iii. Configuring the HTTPS service for Tomcat

1, configuration file configuration HTTPS service <connector port= "443"  protocol= "Org.apache.coyote.http11.Http11AprProtocol"  sslenabled= "true"       scheme= "https"  secure= "true"        maxthreads= "      acceptcount="         compression= "on"        compressionminsize= "2048"       compressablemimetype= "text/html,text/xml,text/javascript,text/css,text/ Plain "      connectiontimeout=" 20000 "       Enablelookups= "false"       sslcertificatefile= "/usr/local/tomcat/conf/ Localhost.crt "      sslcertificatekeyfile="/usr/local/tomcat/conf/localhost.key "       clientauth= "false"  sslprotocol= "TLS"  uriencoding= "Utf-8"/> &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;2, Installing APR, aPr-util, tomcat-native Download the installation package # wget http://mirrors.aliyun.com/apache/apr/apr-1.5.2.tar.gz# wget  http://mirrors.aliyun.com/apache/apr/apr-util-1.5.4.tar.gz (1) Mounting apr# tar xf  apr-1.5.2.tar.bz2 # cd apr-1.5.2# ./configure && make &&  make install (2) Mounting apr-util# tar xf apr-util-1.5.4.tar.bz2 # cd  apr-util-1.5.4# ./configure --with-apr=/usr/local/apr && make &&  make install (3) Mounting tomcat-native# cp /usr/local/tomcat/bin/tomcat-native.tar.gz ./#  tar xf tomcat-native.tar.gz # cd tomcat-native-1.1.32-src/jni/native/# ln  -sv /usr/java/jdk1.7.0_79/ /usr/java/jdk# ./configure --with-apr=/usr/local/apr  --with-java-home=/usr/java/jdk# make && make install (4) Loading Apr library # vim  /etc/profile.d/tomcat.shexport path user logname mail hostname histsize inputrc java_home#tomcat-aprexport ld_ Library_path= $LD _library_path:/usr/local/apr/lib# source /etc/profile.d/ TOMCAT.SH Note: I have a ready-made key and CRT here, if not, clear themselves build four, check whether the HTTPS service is normal # /usr/local/tomcat/bin/startup.sh        #启动tomcat # netstat -tnlp|grep javan      # 443 ports are already listening TCP&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;0&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;0&NBSP;::FFFF : 127.0.0.1:8005       :::*     LISTEN       3189/java           tcp         0      0 :::8009                      :: :*     LISTEN      3189/java           tcp         0      0 :::8080                      :::*     LISTEN      3189/java            tcp        0       0 :::443                       :::*     LISTEN       3189/java

650) this.width=650, "alt=" Technology share "src=" Http://s4.51cto.com/wyfs02/M01/80/5C/wKioL1c-tV2RFurGAAJ3JMY3MSQ988.png " Title= "2.png" width= "650" style= "padding:0px;"/>




Tomcat Add HTTPS Service

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.