之前写的使用SSL帖子是单站点使用的:http://php.upupw.net/apache/6/6325.html
对于多站点用户来说,难免不够用,但基本配置方法还是大同小异。 Apache配置SSL证书: 1.修改目录/Apache2/conf/下的httpd.conf 将#LoadModule socache_shmcb_module modules/mod_socache_shmcb.so 复制以下代码 <virtualhost _default_:443=""> DocumentRoot "C:/web/UPUPW_AP7.0/vhosts/www.abc.com" ServerName www.abc.com:443 ServerAlias www.abc.com ServerAdmin webmaster@example.com DirectoryIndex index.html index.htm index.php default.php app.php u.php ErrorLog logs/example_error.log CustomLog logs/example_access.log \ "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" SSLEngine on SSLCertificateFile "C:/web/UPUPW_AP7.0/Apache2/conf/2_www.abc.com.crt" SSLCertificateKeyFile "C:/web/UPUPW_AP7.0/Apache2/conf/3_www.abc.key" SSLCertificateChainFile "C:/web/UPUPW_AP7.0/Apache2/conf/1_root_bundle.crt" <Directory "C:/web/UPUPW_AP7.0/vhosts/www.abc.com"> SSLOptions +StdEnvVars AllowOverride All Require all granted </directory> <FilesMatch "\.(shtml|phtml|php)$"> SSLOptions +StdEnvVars </filesmatch> BrowserMatch "MSIE [2-5]" \ nokeepalive ssl-unclean-shutdown \ downgrade-1.0 force-response-1.0 </virtualhost> 修改conf目录下的httpd-vhosts.conf文件: 添加刚才复制的内容 将DocumentRoot "C:/web/UPUPW_AP7.0/vhosts/www.abc.com"中的sslroot/路径改为你网站根目录的绝对路径:如C:/UPUPW_AP7.0/vhosts/www.abc.com (注意路径反斜杠方向) 同时修改证书内容,密钥的路径,SSLCertificateFile "C:/web/UPUPW_AP7.0/Apache2/conf/2_www.abc.com.crt"中的2_www.abc.com.crt改为你证书的绝对路径 SSLCertificateKeyFile "C:/web/UPUPW_AP7.0/Apache2/conf/3_www.abc.key"中的C:/web/UPUPW_AP7.0/Apache2/conf/3_www.abc.key改为你证书密钥的绝对路径。如果有证书链,则在下一行 加上SSLCertificateChainFile "C:/web/UPUPW_AP7.0/Apache2/conf/1_root_bundle.crt",记得修改证书链的路径。 如: SSLCertificateFile ""C:/UPUPW_AP7.0/Apache2/conf/server.crt" SSLCertificateKeyFile ""C:/UPUPW_AP7.0/Apache2/conf/server.key" SSLCertificateChainFile "C:/UPUPW_AP7.0/Apache2/conf/chain.crt" 上面只是示例,按照你证书的路径修改。 保存并退出httpd-vhosts.conf。 3.回到主面板,输入rr回车以重启Apache。 注:需要多个站点使用SSL就重复以上步骤,不要搞乱就行! [tonghoil于2017-11-24 22:26编辑了帖子]
|
|
|
沙发#
发布于:2017-03-10 23:08
按照 上面的一步一步修改
|
|
板凳#
发布于:2017-05-05 23:46
|
|
地板#
发布于:2017-11-24 20:20
|
|
4楼#
发布于:2018-01-20 23:33
|
|