Tomcat集群apache摘要认证https加密

Tomcat集群apache摘要认证https加密

1.环境准备: 

·        linux虚拟机两个【一个也行,这是为了更好的测试】

·        JDK1.7左右

·        tomcat7.0两个以上:http://tomcat.apache.org/download-70.cgi下载如图所示:

·        httpd-2.2.27.tar.gz:http://httpd.apache.org/download.cgi下载如图所示:

·                openssl-1.0.1g.tar.gz:http://www.openssl.org/source/openssl-1.0.1g.tar.gz


2. 软件安装

2.1错误集中地

·        ERROR1安装gcc:【yum install gcc】在服务器任意地方直接copy这段语句运行(它会问你y/N,回答它y)。

错误为:configure: error: in`/root/httpd-2.2.27/srclib/apr': 
configure: error: no acceptable C compiler found in $PATH 
See `config.log' for more details 
configure failed for srclib/apr

·        ERROR2安装zlib:【yum install zlib-devel -y】在服务器任意地方直接copy这段语句运行。

错误为:checking for zliblocation... not found

2.2 安装 openssl

tar zxf openssl-1.0.1g.tar.gz

cd openssl-1.0.1g

./config--prefix=/home/admin/app/openssl

make;make install

如果出现

./configure --prefix=/ytxt/apache2/  --enable-ssl   --enable-rewrite  --enable-so   --with-ssl=/usr/local/openssl/

报错:

configure: error: ... Error, SSL/TLS libraries were missing or unusable

在服务器上执行 export LDFLAGS=-ldl

2.3 安装apache httpd

你需要按照如下方式进行(配置有可能出ERROR1与ERROR2,解决这两个错误之后请重新把配置语句执行一遍): 

·        使用root用户(最好是root)上传:httpd-2.2.27.tar.gz

·        解压:tar -xvfhttpd-2.2.27.tar.gz

  • ①配置:./configure --prefix=/usr/local/apache2 --enable-modules=so --enable-mods-shared=most --enable-proxy --enable-proxy-connect --enable-proxy-ftp --enable-proxy-http --enable-proxy-ajp --enable-proxy-balancer --enable-rewrite --enable-so --enable-ssl=static --with-ssl=/usr/local/ssl

·        制作:make

·        安装:make install

·        Over,安装完成。

3. 软件配置

3.1 tomcat配置

·  tomcat_A,配置server.xml(${tomcatHome}/conf/server.xml),我的配置是:

Xml代码  

1.   

26.   className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />  

27.    

28.   className="org.apache.catalina.core.JasperListener" />  

29.    

30.   className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />  

31.   className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />  

32.   className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />  

33.  

34.    

56.      

57.     name="tomcatThreadPool" namePrefix="catalina-exec-"  

58.        maxThreads="500" minSpareThreads="20" maxIdleTime="60000"/>  

59.  

60.      

73.      

74.     executor="tomcatThreadPool"  

75.               port="8080" protocol="HTTP/1.1"  

76.               connectionTimeout="20000"  

77.               redirectPort="8443" URIEncoding="UTF-8" acceptCount="256"/>  

78.      

79.      

90.     port="8009" protocol="AJP/1.3" redirectPort="8443" />  

91.  

92.  

93.      

100.     name="Catalina" defaultHost="localhost" jvmRoute="tomcat_A">    

101.      

102.  

103.        

145.  

146.          

27.   className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />  

28.    

29.   className="org.apache.catalina.core.JasperListener" />  

30.    

31.   className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />  

32.   className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />  

33.   className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />  

34.  

35.    

57.      

58.     name="tomcatThreadPool" namePrefix="catalina-exec-"  

59.        maxThreads="500" minSpareThreads="20" maxIdleTime="60000"/>  

60.  

61.      

74.      

75.     executor="tomcatThreadPool"  

76.               port="8080" protocol="HTTP/1.1"  

77.               connectionTimeout="20000"  

78.               redirectPort="8443" URIEncoding="UTF-8" acceptCount="256"/>  

79.      

80.      

91.     port="8009" protocol="AJP/1.3" redirectPort="8443" />  

92.  

93.  

94.      

101.     name="Catalina" defaultHost="localhost" jvmRoute="tomcat_B">  

102.      

103.      

104.  

105.        

147.  

148.        

你可能感兴趣的:(Tomcat集群apache摘要认证https加密)