httpd-ssl的配置:
Listen 443
NameVirtualHost *:443
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl .crl
SSLPassPhraseDialog builtin SSLSessionCache "shmcb:/usr/local/apache/logs/ssl_scache(512000)"
SSLSessionCacheTimeout 300
SSLMutex "file:/usr/local/apache/logs/ssl_mutex"
<VirtualHost *:443>
DocumentRoot "/xxxx/Span"
ServerName resource-pov.xxx.com
SSLEngine on SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile "/usr/local/apache/conf/ssl/server.crt"
SSLCertificateKeyFile "/usr/local/apache/conf/ssl/server.key"
</VirtualHost>
DocumentRoot "/xxxx/pov.xxx.com"
ServerName pov.xxx.com
SSLEngine on
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
httpd-vhosts.conf的配置:
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "/xxxx/Span"
ServerName resource-pov.xxx.com
ServerAlias resource-pov.xxx.com
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://resource-pov.xxx.com/$1 [R=301,L]
</IfModule>
ErrorLog "logs/resource-pov.xxx.com-error_log"
CustomLog "logs/resource-pov.xxx.com-access_log" common
DocumentRoot "/xxxx/pov.xxx.com"
ServerName pov.xxx.com
ServerAlias pov.xxx.com
<IfModule mod_rewrite.c> //這塊IfModule mod_rewrite.c是開啟重定向跳轉子產品,将所有80的通路跳轉至HTTPS,如果不想跳轉可以選擇去掉<IfModule mod_rewrite.c> ........ </IfModule> 這段。
RewriteRule ^(.*)$ https://pov.xxx.com/$1 [R=301,L]
</IfModule>
ErrorLog "logs/pov.xxx.com-error_log"
CustomLog "logs/pov.xxx.com-access_log" common
本文轉自yzy121403725 51CTO部落格,原文連結:http://blog.51cto.com/lookingdream/1870152,如需轉載請自行聯系原作者