返回列表 回复 发帖

Apache https 配置指南

Windows Apache HTTPS配置

创建下面3个目录:
  1.     C:\Program Files\Apache Group\Apache2\conf\ssl
  2.     C:\Program Files\Apache Group\Apache2\conf\ssl.key
  3.     C:\Program Files\Apache Group\Apache2\conf\ssl.crt
复制代码
这里假设apache安装目录是
  1. C:\Program Files\Apache Group\Apache2\
复制代码
下载
  1. http://tud.at/programm/openssl.cnf
复制代码
  1. C:\Program Files\Apache Group\Apache2\conf\ssl
复制代码
目录下

进入命令行,输入下面的命令:
# 注:以下用到的密码都是1234
  1. openssl req -config openssl.cnf -new -out server.csr
  2.   Country Name (2 letter code) []:CN
  3.   State or Province Name (full name) []:Shanghai
  4.   Locality Name (eg, city) []:Shanghai
  5.   Organization Name (eg, company) []:Company name
  6.   Organizational Unit Name (eg, section) []:IT
  7.   Common Name (eg, your websites domain name) []:www.test.com
  8.   Email Address []:webmaster@test.com

  9.   Please enter the following 'extra' attributes to be sent with your certificate request  A challenge password []:1234

  10. openssl rsa -in privkey.pem -out server.key

  11. openssl x509 -in server.csr -out server.crt -req -signkey server.key -days 365
  12. openssl x509 -in server.crt -out server.der.crt -outform DER
复制代码
把server.crt移动到
  1. C:\Program Files\Apache Group\Apache2\conf\ssl.crt
复制代码

把server.key移动到
  1. C:\Program Files\Apache Group\Apache2\conf\ssl.key
复制代码
  1. C:\Program Files\Apache Group\Apache2\apache.exe -D SSL
  2. cd C:\Program Files\Apache Group\Apache2\bin
  3. Apache.exe -k install
  4. Apache.exe -k config -D SSL
  5. Apache.exe -k start
复制代码
FreeBSD Apache HTTPS配置

1. 设置启动
  1. #echo 'apache2_enable="YES"' >> /etc/rc.conf
  2. #echo ‘apache22ssl_enable="YES"' >> /etc/rc.conf
复制代码
2. 编辑
  1. /usr/local/etc/apache22/httpd.conf
复制代码
在最后边加上支持:
  1. Include etc/apache22/extra/httpd-ssl.conf
复制代码
然后编辑:
  1. /usr/local/etc/apache22/extra/httpd-ssl.conf
复制代码
修改虚拟机路径:
  1. <VirtualHost _default_:443>
  2. #   General setup for the virtual host
  3. DocumentRoot "/usr/local/www/test"
  4. ServerName www.test.com:443
  5. ServerAdmin test@test.com
  6. ErrorLog "/var/log/httpd-error.log"
  7. TransferLog "/var/log/httpd-access.log"
复制代码
和以下两个位置为你存放证书路径:
  1. SSLCertificateFile "/usr/local/etc/apache22/ssl.key/server.crt"
  2. SSLCertificateKeyFile "/usr/local/etc/apache22/ssl.key/server.key"
复制代码
3. 配置mod_ssl 生成证书
  1. #openssl genrsa -des3 -out server.key 1024
  2. #openssl rsa -in server.key -out server.key (*从密钥中删除密码,以避免系统启动时被询问口令)
  3. #openssl req -new -key server.key -out server.csr
  4. #openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
  5. #mkdir /usr/local/etc/apache22ssl.key
  6. #mkdir /usr/local/etc/apache22ssl.crt
  7. #chmod 0700 /usr/local/etc/apache22/ssl.key
  8. #chmod 0700 /usr/local/etc/apache22/ssl.crt
  9. #cp ~/server.key /usr/local/etc/apache22/ssl.key/
  10. #cp ~/server.crt /usr/local/etc/apache22/ssl.crt/
  11. #chmod 0400 /usr/local/etc/apache22/ssl.key/server.key
  12. #chmod 0400 /usr/local/etc/apache22/ssl.crt/server.crt
复制代码
4. 启动服务器,设置完成。访问服务器时输入:https://域名(或IP),浏览器会弹出安装服务器证明书的窗口。说明服务器已经支持SSL了

http://www.21andy.com/blog/20090604/1316.html
Postfix技术专业支持论坛
http://www.thismail.org/bbs
-----------------------------------
提供专业postfix技术支持,邮件系统开发定制
QQ:187159779 注明(Postfix技术支持)
成都成都Linux维护,代维。FreeBSD维护,代维,维护各种服务器。
Postfix技术专业支持论坛
http://www.thismail.org/bbs
-----------------------------------
提供专业postfix技术支持,邮件系统开发定制
QQ:187159779 注明(Postfix技术支持)
成都成都Linux维护,代维。FreeBSD维护,代维,维护各种服务器。
返回列表
开源邮件服务器 开源邮件服务器 web 开源邮件 开源 mail 开源 邮件服务器 邮件技术 mail技术 反垃圾邮件 反垃圾mail mail投递
邮件服务器 mail服务器 开源软件 mail软件 mail服务新品牌 开源邮件服务新品牌
开源mail服务新网站 邮件服务新品牌 mail tmail mailserver 163邮件 sendmail |Linux维护|Linux代维|成都Linux维护|成都Linux代维