首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Ubuntu14.x上虚拟主机的Apache2 SSL配置

Ubuntu14.x上虚拟主机的Apache2 SSL配置
EN

Stack Overflow用户
提问于 2016-10-29 05:31:45
回答 1查看 671关注 0票数 0

我只想要https的流量。我希望所有这些都被驱动到https://example.comhttps://www.example.com上。

目前,这是有效的和不起作用的:

https://www.example.com - ok!http://www.example.com -显示了一个文件列表在我的webroot出于某种原因https://example.com -这个网站无法到达/ example.com拒绝连接。http://example.com -- example.com页面不工作。example.com没有发送任何数据。

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

代码语言:javascript
复制
<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>

任何帮助都是非常感谢的,就像发疯一样!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-10-29 05:53:03

你试过永久重定向吗?https://wiki.apache.org/httpd/RedirectSSL

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/40316334

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档