您好,登錄后才能下訂單哦!
系統環境: centos6.7
jdk-7u79-linux-x64
apache-tomcat-7.0.57
apr-1.5.2
apr-util-1.5.4
一、tomcat安裝
自己準備tomcat和jdk安裝包 # 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_HOME export JAVA_HOME=/usr/java/latest export PATH=$JAVA_HOME/bin:$PATH # vim /etc/profile.d/tomcat.sh #配置tomcat的環境變量 export CATALINA_BASE=/usr/local/tomcat export PATH=$CATALINA_BASE/bin:$PATH # source /etc/profile.d/tomcat.sh # source /etc/profile.d/java.sh # catalina.sh start #啟動tomcat, 默認監聽在8080端口
二、測試
獲取下載地址 springmvc4 mybatis 整合 框架源碼 bootstrap html5
三、配置tomcat的https服務
1、配置文件里面配置https服務 <Connector port="443" protocol="org.apache.coyote.http11.Http11AprProtocol" SSLEnabled="true" scheme="https" secure="true" maxThreads="300" acceptCount="1000" 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"/> 2、安裝apr、apr-util、tomcat-native 下載安裝包 # 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)安裝apr # tar xf apr-1.5.2.tar.bz2 # cd apr-1.5.2 # ./configure && make && make install (2)安裝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)安裝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)載入apr庫 # vim /etc/profile.d/tomcat.sh export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC JAVA_HOME #tomcat-apr export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/apr/lib # source /etc/profile.d/tomcat.sh 注意:我這里有有現成的key和crt,如果沒有,清自己生成 四、查看https服務是否正常 # /usr/local/tomcat/bin/startup.sh #啟動tomcat # netstat -tnlp|grep javan #443端口已經監聽 tcp 0 0 ::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
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。