1. 程式人生 > >apache配置https

apache配置https

lin rec mas 重啟 cgi ## directory con allow

1. 修改Apache的配置文件httpd.conf

LoadModule ssl_module modules/mod_ssl.so

Include conf/extra/httpd-ssl.conf

把前面的#號都去掉

2. 在httpd-ssl.conf文件添加

<VirtualHost test.com:443>
DocumentRoot "網站路徑"
ServerName test.com
SSLEngine on
SSLCertificateFile D:\ssl_cert\3jsw.com\domain.crt ## 你的證書 文件
SSLCertificateKeyFile D:\ssl_cert\3jsw.com\domain.key ## 你的證書 文件
SSLCertificateChainFile D:\ssl_cert\3jsw.com\ca.crt ## 你的證書 文件
<Directory "網站路徑"> ## 如果出現403有可能就是這裏
AllowOverride All
Order Deny,Allow
Allow from all
</Directory>
</VirtualHost>

3. apache重啟

4. 有可能出現不會解析php,可能是你的apache重新配置了解析PHP。例如 /php-cgi.exe,這個時候需要在httpd-ssl.conf 文件VirtualHost標簽裏面 裏面添加

Options FollowSymLinks ExecCGI
AddHandler fcgid-script .php
FcgidWrapper "D:/HwsApacheMaster/php/php56/php-cgi.exe" .php
DirectoryIndex index.html index.htm index.php default.php index.jsp

apache配置https