httpd-ssl的配置:Listen 443NameVirtualHost *:443 AddType application/x-x509-ca-cert .crtAddType application/x-pkcs7-crl .crl SSLPassPhraseDialog builtin SSLSessionCache shmcb:/usr/local/ap...
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>
原文:http://www.cnblogs.com/lhlucky/p/5846733.html
本文标题为:关于apache下同IP多域名支持HTTPS和80跳转HTTPS的配置
基础教程推荐
- apache和nginx结合使用 2023-09-10
- Apache服务器配置攻略3 2022-09-01
- 服务器添加git钩子的步骤 2022-12-12
- 实战Nginx_取代Apache的高性能Web服务器 2023-09-29
- linux之conda环境安装全过程 2023-07-11
- Apache Hudi数据布局黑科技降低一半查询时间 2022-10-06
- IIS 6 的 PHP 最佳配置方法 2022-09-01
- centos 7 安装及配置zabbix agent 2023-09-24
- nginx.conf(centos7 1.14)主配置文件修改 2023-09-23
- linux下安装apache与php;Apache+PHP+MySQL配置攻略 2023-08-07