【问题标题】:Apache2 disable 000-default.conf HTTPS redirectApache2 禁用 000-default.conf HTTPS 重定向
【发布时间】:2016-01-03 18:59:53
【问题描述】:

我的本​​地 Apache 网络服务器有问题。我以root 用户身份使用以下命令禁用并删除了000-default.conf 文件。

a2dissite /etc/apache2/sites-available/000-default.conf
rm /etc/apache2/sites-available/000-default.conf

我创建了这个新的default.conf 文件,它将 HTTP 请求重定向到 HTTPS 版本:

<VirtualHost *:80>
    Redirect permanent / https://xxx.xxx.xxx.xxx/
</VirtualHost>

最后我启用了该站点并使用以下命令重新启动了服务器:

a2ensite /etc/apache2/sites-available/000-default.conf
/etc/init.d/apache2 restart

我的问题是我的服务器没有应用新设置。在我看来,它似乎仍在使用已删除的 000-default.conf 设置。

【问题讨论】:

    标签: https apache2


    【解决方案1】:

    使用这个

    a2ensite /etc/apache2/sites-available/default.conf        
    
    /etc/init.d/apache2 restart
    

    这里你使用了错误的文件名

    【讨论】:

      猜你喜欢
      • 2023-03-28
      • 2021-09-18
      • 2016-01-26
      • 2016-05-27
      • 2018-02-10
      • 2017-03-14
      • 2015-02-27
      • 2017-07-14
      • 2016-12-09
      相关资源
      最近更新 更多