In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "the solution to the problem of Forbidden 403 in apache service". In the daily operation, I believe that many people have doubts about the solution to the problem of Forbidden 403 in apache service. The editor has consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubt of "the solution to the problem of Forbidden 403 in apache service". Next, please follow the editor to study!
Http403 errors are often encountered when configuring Linux's Apache service, which also occurred during my configuration test today. I finally solved it and summarized it. The http 403 error means access denied for a number of reasons. Also, these problems can also occur in the Apache of the win platform! According to my experience, there are four main reasons!
The environment I tested is Scientific Linux 5.3 (100% compatible with RHEL and CentOS! ), other versions of Linux should be generic and not tested.
1. There are insufficient permissions to access the document. More than 755 permissions are required. Solution: use the command chmod 755 / var/www/ or other corresponding directory.
2. The reason for SELinux or firewall. Solution: first turn off SELinux and let the firewall pass through the WWW service.
3. The virtual host is misconfigured. For example, I met once:
The configuration file of the virtual host is loaded in httpd.conf:
The copy code is as follows:
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
However, conf/extra/httpd-vhosts.conf is not configured, and the virtual host function is not used yet, so comment out Include conf/extra/httpd-vhosts.conf and restart apache.
Workaround: reconfigure the virtual host or temporarily shut down.
4. Setting of DocumentRoot. The solution is as follows:
Open the configuration file httpd.conf for apache and find this code:
The copy code is as follows:
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Sometimes due to the configuration of php, the "Deny from all" here has rejected all connections. Change the line to "allow from all". The modified code is as follows, and the problem is solved.
The copy code is as follows:
Options FollowSymLinks
AllowOverride None
Order deny,allow
Allow from all
PS: I'm not in the habit of writing a technical log before. I'll share it with you more in the future.
The following are the supplements of other netizens:
Summary of problems in deploying apache Service Forbidden 403
Many friends and students have asked me the same question. Why did I visit Forbidden 403 http://www.bbqmw.net/qm_bbqmbd/? General page prompts are as follows:
Forbidden
You don't have permission to access / on this server.
Http error code 403:
The 403 Forbidden resource is not available. The server understands the customer's request but refuses to process it. It is usually caused by permission settings for files or directories on the server.
The reasons that are usually possible (but not limited to this) are:
The reason is that there is no permission permission for the site directory in the 1:apache configuration file, which usually occurs when the default apache site directory is changed after the initial installation of apache (important, often occurs):
If you change the site directory to: / var/blog, a 403 error will be returned if the following configuration is not added to the apache configuration file.
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
Tip: the above configuration of the production environment needs to be modified, as shown below, which is explained only on the topic of this article.
Reason 2: if there is no home page file (index file) in the site directory, and directory browsing is prohibited in the configuration of apache, an error of 403 will be prompted, as follows (occasionally):
a. No home page file (index file) in the site directory:
[root@http-server blog] # pwd
/ var/blog
[root@http-server blog] # ll
Total 12
Drwxr-xr-x 2 root root 4096 Jun 4 22:11 oldboy
At this point, the study on "the solution to the problem of Forbidden 403 in apache service" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.