Apache Don ' t have permission to access/test.php on the This server workaround _linux

Source: Internet
Author: User
Tags 403 forbidden error apache 403 forbidden tomcat

Key word: Apache 403 Forbidden
System configuration:
Operating system: Red Hat Linux 6.2
Web server: Apache 3.1.1+jakarta-tomcat 3.1.1
Database server: Oracle 8i

The Apache server is currently the most widely used Web server, with more than half of the servers in the world using the Apache server. For the benefit of it, you can go to http://www.apache.org/to see for yourself.

There is a problem with our server today: Any access will return a 403 error:

Copy Code code as follows:

Forbidden

You don ' t have permission to access in this server.


Wrong Ah, the original is good, in the exclusion of the permissions of the directory, and so on, I almost rummaged all the system files, especially/etc/httpd/conf under all the configuration files, because I have been access.conf, The srm.conf file is added to the httpd.conf file, along with a sentence at the end of the httpd.conf file:

Include/etc/httpd/conf/tomcat.conf to connect Tomcat to Apache.

After a bit of thinking, I thought the problem was definitely in the httpd.conf file, so I checked the httpd.conf file again, and finally I found out that there was one of these:

Copy Code code as follows:

<files ~>
allowoverride authconfig FileInfo indexs Limit Options
Order Allow, deny
Deny from all-----------------Note: This Is it!! ---> Remove or annotate the line!!!
</Files>

Heart a burst of ecstasy, haha, think of Zhao Benshan said a word "small, took off the vest I also recognize you", so changed to:

Allow from all, reboot the server, eh, or not? The head began to be big, thought: Today I am to carry here. and turned over N more than a httpd.conf file almost have to recite the problem can not be found. Also strange, suddenly remembered, www.apache.org not have a problem database, almost all the problems can find the answer, so into the http://bugs.apache.org/, find the keyword forbidden, sure enough let me find out, The original is one of our colleagues want to do a virtual host, using the Linux Configuration Tool linuxconf, this tool because of the version of the problem, will lead to httpd.conf file changes, in fact, I just have to remove the section above can be all right.

Summing up experience: the first thing to think of the software site to find the answer to avoid wasting time.

Write the purpose of this article: to me as a negative example, encounter problems do not always think they can solve, and not to consult the professional website. A lot of web sites already have a very perfect FAQ, basically can meet the needs of everyone, such as PB to www.sybase.com on the walk, Java to http://developer.java.sun.com on the turn, VC to bad children's home to sneak. In fact, some experts are not how smart they are, but they know how to find something from a useful place they want.

I also found hope as he did, and it didn't work. Then I was happy, but then I was not happy. I can't do that here. Who can help me? I'll find it! I'll find it! No, save yourself.

===================================================
===================================================
Solve Apache 403 Forbidden Error

Body

Today in the company computer installed Apache, version 2.2.8, loaded just test can be configured under PHP php.in file again localhost Open discovery Error: HTTP Error 403-No access, that is, 403 forbidden:you don ' t have Permission to access/on the this server. Not enough permissions?

Immediately open the Apache configuration file httpd.conf, checking line by row. In approximately half the place there is the following code:

Copy Code code as follows:

<directory/>
Options FollowSymLinks
AllowOverride None
Order Deny,allow
Deny from all
</Directory>

Found it. Because of the configuration of PHP, this "deny from all" has rejected all connections. Change the line to "allow from all", the revised code is as follows, solve the problem.

Copy Code code as follows:

<directory/>
Options FollowSymLinks
AllowOverride None
Order Deny,allow
Allow from all
</Directory>

Open http://localhost again in the browser and show it works!

Summary: If you also have such a 403 blocked access, you may wish to note that Apache's httpd.conf configuration file has the "Deny from all" line of code, to see if the system has been quietly modified.

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.