Linux Centos7 Apache 访问 You don't have permission to
Jun 07, 2016 pm 03:48 PM折腾了很久,今天才找到了最正确的答案。感言真不容易。 百度出来的99%都是采集的内容,全都是错误的。 You don 't have permission to access / on this server. 百度出的解决方法: 1)关闭selinux 。坑,服务器根本就没开启selinux 2)修改 httpd.conf 中
折腾了很久,今天才找到了最正确的答案。感言真不容易。
百度出来的99%都是采集的内容,全都是错误的。
You don<span>'t have permission to access / on this server.</span>
百度出的解决方法:
1)关闭selinux 。坑,服务器根本就没开启selinux
2)修改 httpd.conf 中的 allow from all!坑,Apache都2.4+,根本就不存在 allow from all ,现在改为了 Require all granted!
3)修改 chcon -R httpd_user_content_t !坑,误人子弟,CentOS7 中根本就没这样一个上下文,因为selinux根本就没开启
4)修改 chown apache: -R /home/xxx.com/public_html!误人子弟,坑比!这样把目录改了,他本来的用户却没有目录访问权限了!逗比!!!
……
百度了一个多小时,全都是这样的解决方法,出来的网页全都是一大堆广告。
中国的最大搜索引擎搜索出来的都是那种布满广告的采集站!采集站不要紧,关键是全都是广告,连正常的阅读都无法阅读!
最后正确的解决方法:
chmod o+x /home/zbphp.com
上一级目录的其他用户组也必须加上 x 执行权限否则Apache无法读取!
写到最后,感谢segmentfault 社区的热心人,不然真的瞎折腾几天可能又要放弃了。牢骚一下,网上用百度搜索出来的东西根本就不准确!用不了Google,goagent总是断断续续,而且对英文不熟悉。瞎折腾的时候感觉自己就像chaoxian,落后但是自我感觉良好,很多人用百度还觉得自豪爱国。(by default7@zbphp.com)

Article chaud

Outils chauds Tags

Article chaud

Tags d'article chaud

Bloc-notes++7.3.1
Éditeur de code facile à utiliser et gratuit

SublimeText3 version chinoise
Version chinoise, très simple à utiliser

Envoyer Studio 13.0.1
Puissant environnement de développement intégré PHP

Dreamweaver CS6
Outils de développement Web visuel

SublimeText3 version Mac
Logiciel d'édition de code au niveau de Dieu (SublimeText3)

Sujets chauds

Entrée de la version Web Deepseek Entrée du site officiel Deepseek

Android TV Box obtient une mise à niveau non officielle d'Ubuntu 24.04

Adresse de téléchargement de l'application de portefeuille BitPie Bitpie

Installation officielle du site officiel de Bitget (Guide du débutant 2025)

Zabbix 3.4 Installation de la compilation du code source

Explication détaillée : commande de paramètre de jugement variable du script Shell

Le package d'installation OUYI OKX est directement inclus
