Linux Centos7 Apache access You don & #39; t have permission to access/on this server., centos7permission

Source: Internet
Author: User

Linux Centos7 Apache access You don't have permission to access/on this server., centos7permission

After a long time, I found the most correct answer today. It's really not easy to say.

99% of the content collected by Baidu is incorrect.


You don't have permission to access / on this server.

Baidu's solution:

1) Disable selinux. The server has not enabled selinux.

2) Modify allow from all in httpd. conf! Pitfall: Apache is more than 2.4, and there is no allow from all. Now it is changed to Require all granted!

3) Modify chcon-R httpd_user_content_t! The root of CentOS7 does not have such a context, because selinux is not enabled at all.

4) Modify chown apache:-R/home/xxx.com/public_html! Mistaken child! In this way, the directory is changed, but the original user has no permission to access the directory! Funny !!!

......


Baidu spent more than an hour solving this problem. All the web pages are filled with a lot of advertisements.

The largest search engine in China searches for ads-filled collection sites! The collection site does not matter. The key is that all advertisements cannot be read even if they are normal!


Finally, the correct solution is as follows:

Chmod o + x/home/zbphp.com

The x execution permission must be added to other user groups in the upper-level directory. Otherwise, Apache cannot read the permission!


At the end of the article, I would like to thank the enthusiastic segmentfault community. Otherwise, I may have to give up for a few days. Whining, What Baidu searched on the Internet is not accurate at all! Goagent is always intermittent and unfamiliar with English. When I am confused, I feel like a chaoxian. I am backward but I feel good about myself. Many people use Baidu and feel proud and patriotic. (By default7@zbphp.com)















Linux apache Forbidden You don't have permission to access/on this server

You don't have permission to access/on this server.

You do not have permission to access/directory

/Etc/httpd. conf file configuration
<Directory/>
AllowOverride None
Order allow, deny
# Allow from all -------------- this line is commented out to allow all access
</Directory>

The default root directory is)
/Home // lamp/apache243/htdocs

An error occurred while accessing the php webpage after installing apache and php. Forbidden You don't have permission to access/on this server

It means that you do not have the permission to access the website. Are you not configuring httpd. conf?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.