Apache 403错误,HTTP不支持HTTPS [英] Apache 403 Error with HTTP not with HTTPS

查看:133
本文介绍了Apache 403错误,HTTP不支持HTTPS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Apache上遇到了一个非常奇怪的问题:

I've got a very strange issue with Apache:

我正在Debian 7.8下使用PHP 5.5.27(dotdeb.org)运行Apache/2.2.22 +.

I'm running Apache/2.2.22 + with PHP 5.5.27 (dotdeb.org) under Debian 7.8.

我进行了PHP升级,不确定是否相关,但是我重新启动了Apache,突然所有HTTP内容都停止工作,仅正确处理了HTTPS请求,端口80的VirtualHost配置不再正常工作,它如果我使用HTTP URL(对于HTTPS内容来说还可以),则Apache似乎无法获得正确的DocumentRoot(/上的403,并且找不到子文件夹和文件的文件).

I made an upgrade of PHP, I'm not sure if it's related but I restarted Apache and suddenly all HTTP stuff ceased to work, only HTTPS requests are correctly handled, VirtualHost config of port 80 is no more working correctly, it seems like Apache is not getting the right DocumentRoot (403 on / and file not found for subfolders and files) if I use a HTTP URL (OK for HTTPS stuff).

站点可用/默认语法正常,suexec和open_basedir路径更新无济于事.

sites-available/default syntax is OK, suexec and open_basedir paths updates didn't help.

它与IP不相关(不是fail2ban,请在其他设备上检查)

It's not related to IP (it's not fail2ban, checked on other devices)

这不是权限或Apache正在运行的用户问题(我尝试了一切).

It's not the permissions or an Apache running user problem (I tried everything).

我什至卸载(清除)并重新安装libapache2-mod-php5.

I even uninstalled (purge) and reinstalled libapache2-mod-php5.

什么都没做.

有任何线索吗?

谢谢

推荐答案

好吧,我发现它不是PHP,而是我使用Virtualmin创建的虚拟主机,下面是解决方法:

Ok I figured it out, it's not PHP, it's the virtualhosts I created using Virtualmin, here's the fix:

  • 禁用/etc/apache2/apache2.conf中的NameVirtualHost行

  • Disable the NameVirtualHost lines in /etc/apache2/apache2.conf

< VirtualHost *:80>替换< VirtualHost XX.XX.XX.XXX:80 [XXXX:XXXX:X:XXXX ::]:80> ; 在所有/etc/apache2/backup/sites-available/conf文件中

Replace <VirtualHost XX.XX.XX.XXX:80 [XXXX:XXXX:X:XXXX::]:80> by <VirtualHost *:80> in all /etc/apache2/backup/sites-available/ conf files

在/etc/apache2/sites-available/default文件顶部添加NameVirtualHost *:80

Add NameVirtualHost *:80 at the top of /etc/apache2/sites-available/default file

这篇关于Apache 403错误,HTTP不支持HTTPS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆