• 欢迎访问VPS岛网站,国外VPS,国内VPS,国外服务器,国内服务器,服务器主机,测评及优惠码,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站 QQ群

关于apache下同IP多域名支持HTTPS和80跳转HTTPS的配置

Apache技术 yzy121403725 24次浏览 已收录 0个评论

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>

 

<VirtualHost *:443>

DocumentRoot “/xxxx/pov.xxx.com”

ServerName 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>

 

httpd-vhosts.conf的配置:

NameVirtualHost *:80

<VirtualHost *:80>    

ServerAdmin webmaster@dummy-host.example.com    

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

</VirtualHost>

 

<VirtualHost *:80>    

ServerAdmin webmaster@dummy-host.example.com    

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> 这段。

RewriteEngine On  

RewriteCond %{SERVER_PORT} 80  

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

</VirtualHost>


VPS岛 的文章和资源来自互联网,仅作为参考资料,如果有侵犯版权的资源请尽快联系站长,我们会在24h内删除有争议的资源。丨 转载请注明关于apache下同IP多域名支持HTTPS和80跳转HTTPS的配置
喜欢 (0)
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址