ITeye博客

windows下apache的SSL配置

rainingcn · 2010-04-15 17:40 · Web前端 · Markdown

version: httpd-2.2.15-win32-x86-openssl-0.9.8m-r2.msi 虚拟网站名:testweb 配置步骤如下: 1. 将如下文件拷贝到conf目录下

将如下文件拷贝到modules目录下

2 修改httpd.conf. 2.1 开启

LoadModule ssl_module modules/mod_ssl.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so

2.2 将修改为


<IfModule ssl_module>
#确认引入了ssl的配置文件
Include conf/extra/httpd-ssl.conf
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>

在最后加上引入代码


#Include mod_jk's specific configuration file
Include conf/mod-jk.conf

3. 修改workers.properties文件

# modify the host as your host IP or DNS name.
worker.node1.port=8009
worker.node1.host=127.0.0.1
worker.node1.type=ajp13
worker.node1.lbfactor=1
worker.node1.cachesize=50

要确保jboss已经开启ajp。可查看jboss-4.2.3.GA\server\default\deploy\jboss-web.deployer(目录仅供参考)下的server.xml,

 <Connector port="8009" address="${jboss.bind.address}" protocol="AJP/1.3"
         emptySessionPath="true" enableLookups="false" redirectPort="8443" />

      <Engine name="jboss.web" defaultHost="localhost">

4. 修改uriworkermap.properties,在最末增加一行

/testweb|/*=loadbalancer

5. 修改extra/httpd-ssl.conf 在后增加如下代码


#enable SSLv2 ,SSLv3, TLSv1 (All)
SSLProtocol all

<Location /tp>
  Allow from *  
  ProxyPass ajp://127.0.0.1:8009/testweb
  ProxyPassReverse ajp://127.0.0.1:8009/testweb
  #RedirectMatch temp .* http://localhost:8080/testweb
</Location>

6. 重启apache 查看URL: https://127.0.0.1 https://127.0.0.1:443 https://127.0.0.1/testweb 7.如果apache不能启动,则再cmd中输入 httpd -t 以检查配置是否正确 8.说明ca.crt,server.crt,server.key 为模拟SSL 文件,到时替换之。

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。