您好,登錄后才能下訂單哦!
系統(tǒng)環(huán)境: centos6.7
jdk-7u79-linux-x64
apache-tomcat-7.0.57
apr-1.5.2
apr-util-1.5.4
一、tomcat安裝
自己準(zhǔn)備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的環(huán)境變量 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 #啟動(dòng)tomcat, 默認(rèn)監(jiān)聽在8080端口
二、測(cè)試
獲取下載地址 springmvc4 mybatis 整合 框架源碼 bootstrap html5
三、配置tomcat的https服務(wù)
1、配置文件里面配置https服務(wù) <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 注意:我這里有有現(xiàn)成的key和crt,如果沒有,清自己生成 四、查看https服務(wù)是否正常 # /usr/local/tomcat/bin/startup.sh #啟動(dòng)tomcat # netstat -tnlp|grep javan #443端口已經(jīng)監(jiān)聽 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
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請(qǐng)聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。