繁体   English   中英

在Ubuntu 14.x上使用虚拟主机进行Apache2 SSL配置

[英]Apache2 SSL Configuration with Virtual Hosts on Ubuntu 14.x

我只想拥有https流量。 我希望将其全部驱动到https://example.comhttps://www.example.com

目前,这是行得通和行不通的:

https ://www.example.com-好的! http://www.example.com-由于某种原因在我的Webroot中显示文件列表https ://example.com-无法访问此网站/ example.com拒绝连接。 http://example.com-example.com页面无法正常工作。 example.com没有发送任何数据。

我正在使用Ubuntu 14(可信任),这是我当前启用的虚拟主机配置:

<IfModule mod_ssl.c>
       <VirtualHost xxx.xxx.xxx.xxx:443>
               ServerAdmin info@example.com
               ServerName www.example.com:443
               ServerAlias example.com:443

               DocumentRoot /var/www/example.com/public_html

              SSLEngine on
              SSLCertificateFile      /etc/ssl/certs/ssl-cert-snakeoil.pem
              SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key

              <FilesMatch "\.(cgi|shtml|phtml|php)$">
                              SSLOptions +StdEnvVars
              </FilesMatch>

              <Directory /usr/lib/cgi-bin>
                              SSLOptions +StdEnvVars
             </Directory>
             BrowserMatch "MSIE [2-6]" \
                             nokeepalive ssl-unclean-shutdown \
                             downgrade-1.0 force-response-1.0
             # MSIE 7 and newer should be able to use keepalive
             BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
     </VirtualHost>
</IfModule>

任何帮助都值得发疯!

您是否尝试过进行永久重定向? https://wiki.apache.org/httpd/RedirectSSL

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM