Windows Apache HTTPS配置
来源:互联网 发布:软件测评师证书 编辑:程序博客网 时间:2024/05/16 07:41
Windows Apache HTTPS配置
创建下面3个目录:
C:/Program Files/Apache Group/Apache2/conf/ssl
C:/Program Files/Apache Group/Apache2/conf/ssl.key
C:/Program Files/Apache Group/Apache2/conf/ssl.crt
这里假设apache安装目录是
C:/Program Files/Apache Group/Apache2/
下载
http://tud.at/programm/openssl.cnf
到
C:/Program Files/Apache Group/Apache2/conf/ssl
目录下
进入命令行,输入下面的命令:
# 注:以下用到的密码都是1234
openssl req -config openssl.cnf -new -out server.csr
Country Name (2 letter code) []:CN
State or Province Name (full name) []:Shanghai
Locality Name (eg, city) []:Shanghai
Organization Name (eg, company) []:Company name
Organizational Unit Name (eg, section) []:IT
Common Name (eg, your websites domain name) []:www.test.com
Email Address []:webmaster@test.com
Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []:1234
openssl rsa -in privkey.pem -out server.key
openssl x509 -in server.csr -out server.crt -req -signkey server.key -days 365
openssl x509 -in server.crt -out server.der.crt -outform DER
Country Name (2 letter code) []:CN
State or Province Name (full name) []:Shanghai
Locality Name (eg, city) []:Shanghai
Organization Name (eg, company) []:Company name
Organizational Unit Name (eg, section) []:IT
Common Name (eg, your websites domain name) []:www.test.com
Email Address []:webmaster@test.com
Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []:1234
openssl rsa -in privkey.pem -out server.key
openssl x509 -in server.csr -out server.crt -req -signkey server.key -days 365
openssl x509 -in server.crt -out server.der.crt -outform DER
把server.crt移动到
C:/Program Files/Apache Group/Apache2/conf/ssl.crt
下
把server.key移动到
C:/Program Files/Apache Group/Apache2/conf/ssl.key
下
C:/Program Files/Apache Group/Apache2/apache.exe -D SSL
cd C:/Program Files/Apache Group/Apache2/bin
Apache.exe -k install
Apache.exe -k config -D SSL
Apache.exe -k start
cd C:/Program Files/Apache Group/Apache2/bin
Apache.exe -k install
Apache.exe -k config -D SSL
Apache.exe -k start
FreeBSD Apache HTTPS配置
1. 设置启动
#echo 'apache2_enable="YES"' >> /etc/rc.conf
#echo ‘apache22ssl_enable="YES"' >> /etc/rc.conf
#echo ‘apache22ssl_enable="YES"' >> /etc/rc.conf
2. 编辑
/usr/local/etc/apache22/httpd.conf
在最后边加上支持:
Include etc/apache22/extra/httpd-ssl.conf
然后编辑:
/usr/local/etc/apache22/extra/httpd-ssl.conf
修改虚拟机路径:
<VirtualHost _default_:443>
# General setup for the virtual host
DocumentRoot "/usr/local/www/test"
ServerName www.test.com:443
ServerAdmin test@test.com
ErrorLog "/var/log/httpd-error.log"
TransferLog "/var/log/httpd-access.log"
# General setup for the virtual host
DocumentRoot "/usr/local/www/test"
ServerName www.test.com:443
ServerAdmin test@test.com
ErrorLog "/var/log/httpd-error.log"
TransferLog "/var/log/httpd-access.log"
和以下两个位置为你存放证书路径:
SSLCertificateFile "/usr/local/etc/apache22/ssl.key/server.crt"
SSLCertificateKeyFile "/usr/local/etc/apache22/ssl.key/server.key"
SSLCertificateKeyFile "/usr/local/etc/apache22/ssl.key/server.key"
3. 配置mod_ssl 生成证书
#openssl genrsa -des3 -out server.key 1024
#openssl rsa -in server.key -out server.key (*从密钥中删除密码,以避免系统启动时被询问口令)
#openssl req -new -key server.key -out server.csr
#openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
#mkdir /usr/local/etc/apache22ssl.key
#mkdir /usr/local/etc/apache22ssl.crt
#chmod 0700 /usr/local/etc/apache22/ssl.key
#chmod 0700 /usr/local/etc/apache22/ssl.crt
#cp ~/server.key /usr/local/etc/apache22/ssl.key/
#cp ~/server.crt /usr/local/etc/apache22/ssl.crt/
#chmod 0400 /usr/local/etc/apache22/ssl.key/server.key
#chmod 0400 /usr/local/etc/apache22/ssl.crt/server.crt
#openssl rsa -in server.key -out server.key (*从密钥中删除密码,以避免系统启动时被询问口令)
#openssl req -new -key server.key -out server.csr
#openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
#mkdir /usr/local/etc/apache22ssl.key
#mkdir /usr/local/etc/apache22ssl.crt
#chmod 0700 /usr/local/etc/apache22/ssl.key
#chmod 0700 /usr/local/etc/apache22/ssl.crt
#cp ~/server.key /usr/local/etc/apache22/ssl.key/
#cp ~/server.crt /usr/local/etc/apache22/ssl.crt/
#chmod 0400 /usr/local/etc/apache22/ssl.key/server.key
#chmod 0400 /usr/local/etc/apache22/ssl.crt/server.crt
4. 启动服务器,设置完成。访问服务器时输入:https://域名(或IP),浏览器会弹出安装服务器证明书的窗口。说明服务器已经支持SSL了
Tags: apache, https, 配置
本文地址: http://www.21andy.com/blog/20090604/1316.html
- Windows Apache HTTPS配置
- Windows Apache HTTPS配置
- windows下面配置apache+https
- windows环境apache https配置宝典
- windows环境apache https配置宝典
- windows下为apache配置https
- windows PHPStudy Apache 配置支持HTTPS
- windows PHPStudy Apache 配置支持HTTPS
- windows环境下 apache配置https协议
- windows+php+apache本地配置HTTPS
- windows下面配置apache+https(利用SSL)服务器
- windows下面配置apache+https(利用SSL)服务器
- windows下面配置apache+https(利用SSL)服务器
- Apache配置https全过程
- Apache配置https全过程
- Apache https 配置指南
- Apache https 配置指南
- FreeBSD Apache HTTPS配置
- QString和string类型相互转换
- VS2003 +IE7(IE8)无法调试的方案
- 利用VBA,使得Excel看似保存,实则没有保存
- CFile详解
- PHP实现http与https的转化
- Windows Apache HTTPS配置
- fedora11中scim输入法安装步骤
- PHP整理显示照片exif信息
- eclipse flex 的调试安装 (FLASH PLAYER 9 debugger)
- windows环境apache https配置宝典
- 深入分析Memcached的线程接入模型---上
- Windows下配置Apache2.X+SSL心得
- windows下apache配置SSL以实现http转换为https
- PHP5的异常处理机制[2]--PHP5之前的错误处理之trigger_error()