配置Apache SSL 转发

[b]配置SSL[/b]
参考:http://tud.at/programm/apache-ssl-win32-howto.php3

1 安装apache
apache_2.2.11-win32-x86-openssl-0.9.8i.msi
按照提示一步一步,安装即可。
*下文中用{apache}代表apache安装目录,本例中是:D:/devel/apache2.2/

2 配置SSL
(1)apache_2.2.11-win32-x86-openssl-0.9.8i.msi已经安装了 OpenSSL and mod_ssl

(2)下载OpenSSL配置文件
[url=http://tud.at/programm/openssl.cnf]openssl.cnf[/url],下载文件,保存到{apache}\bin下

(3)生成证书

openssl req -config openssl.cnf -new -out my-server.csr
openssl rsa -in privkey.pem -out my-server.key
openssl x509 -in my-server.csr -out my-server.cert -req -signkey my-server.key -days 365

第一条命令提示比较多,大概的输入些数据就可以了。
“密码”必须输入;
“Common Name (eg, your websites domain name) []:”也必须输入,没有域名就随便写一个。

(4)配置SSL
去除conf/httpd.conf下面两句的注释,使之生效:

LoadModule ssl_module modules/mod_ssl.so
Include conf/extra/httpd-ssl.conf


复制{apache}目录下的, 上述生成的文件:
bin/my-server.cert => conf/ssl/my-server.cert
bin/my-server.key => conf/ssl/my-server.key

修改conf/extra/httpd-ssl.conf

SSLCertificateFile "D:/devel/apache2.2/conf/server.crt" =>
SSLCertificateFile "D:/devel/apache2.2/conf/ssl/my-server.cert"

SSLCertificateKeyFile "D:/devel/apache2.2/conf/server.key" =>
SSLCertificateKeyFile "D:/devel/apache2.2/conf/ssl/my-server.key"

现在SSL配置完成。下面配置代理

[b]配置代理[/b]
去除conf/httpd.conf下面两句的注释,使之生效:

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_http_module modules/mod_proxy_http.so


在conf/httpd.conf结尾添加如下配置:

ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</proxy>
ProxyPass / https://{those_compute_ip}/
ProxyPassReverse / https://{those_compute_ip}/

修改conf/extra/httpd-ssl.conf,添加

SSLProxyEngine on
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值