apache基于ssl配置weblogic(完结篇)

眼睛基本已经无大碍。

今天使用apache连接weblogic,并使用ssl,终于完成,最终选用的方式是前端使用apache来进行ssl处理,weblogic只负责相关的业务处理。

在apache一边,载入mod_ssl.so、mod_rewrite.so和mod_wl.so,注意mod_wl.so的版本,之前就是因为版本不对导致了一些问题。

建立80端口的虚拟主机,在虚拟主机中用rewrite模块进行了https重定向,RewriteCond意思是重定向的条件,RewriteRule是重定向的匹配模式。使用weblogic模块进行连接weblogic的处理
<VirtualHost *:80>
	DocumentRoot "htdoc"
	ServerName localhost
	<IfModule mod_rewrite.c>
		RewriteEngine on
		RewriteCond %{HTTPS} off
		RewriteRule /hello\.do https://%{HTTP_HOST}%{REQUEST_URI}
	</IfModule>
	<IfModule mod_weblogic.c>
		Include conf/Weblogic.conf
	</IfModule>
</VirtualHost> 


Weblogic.cnf主要内容是
WebLogicHost localhost          
WebLogicPort 7001
SecureProxy ON  
MatchExpression *.jsp
MatchExpression *.do
MatchExpression *.action
WLLogFile /tmp/wlproxy.log


打开对httpd-ssl.conf的引用,并修改httpd-ssl.conf
在443端口的虚拟主机中加入:
<IfModule mod_weblogic.c>
	Include conf/Weblogic.conf
</IfModule>
<IfModule mod_rewrite.c>
	RewriteEngine on
	RewriteCond %{HTTPS} on
	RewriteRule ^(?!.*?/hello\.do).*$ http://%{HTTP_HOST}%{REQUEST_URI}
</IfModule>


注意从https跳回http的重定向中的正则表达式代表不是hello.do的链接都跳回http。

将SSLCertificateFile和SSLCertificateKeyFile的地址打开,这两个地址指向生成的证书地址和生成的私钥地址。

猜你喜欢

转载自chengjisihan.iteye.com/blog/1442273