Apache HTTP 403 Forbidden Error

Source: Internet
Author: User
Tags 403 forbidden error

When configuring the Linux apache service, I often encounter the http403 error. I also encountered the problem during the configuration test today. I finally solved the problem and summarized it. An HTTP 403 error means that access is denied for many reasons. I have summarized four main reasons!

1. Insufficient document access permissions. More than 755 of permissions are required. Solution: Run chmod 755/var/www/or another directory.

2. SELinux or firewall reasons. Solution: first disable SELinux and enable the firewall to access the WWW Service.

3. the VM configuration is incorrect. Solution: reconfigure the VM or temporarily disable it.

4. settings of DocumentRoot. The solution is as follows:

Open the Apache configuration file httpd. conf and find this section.Code:

<Directory/>
Options followsymlinks
AllowOverride none
Order deny, allow
Deny from all
</Directory>

Sometimes, since PHP is configured, "Deny from all" here has rejected all connections. Change this line to "allow from all". The modified code is as follows. The problem is solved.

<Directory/>
Options followsymlinks
AllowOverride none
Order deny, allow
Allow from all
</Directory>

5. For Bugzilla Installation

You shoshould checkThe userIn httpd. conf and localconfig, and make sure the same user in those two files:

5.1 for httpd. conf as below:

#
# If you wish httpd to run as a different user or group, you must run
# Httpd as root initially and it will switch.
#
# User/group: The name (or # number) of the user/group to run httpd.
# It is usually good practice to create a dedicated user and group
# Running httpd, as with most system services.
#
User daemon
Group daemon

5.2 For localconfig

# This is the group your web server runs.
# If you have a Windows box, ignore this setting.
# If you do not have access to the group your web server runs under,
# Set this to "". If you do set this to "", then your Bugzilla Installation
# Will be _ Very _ insecure, because some files will be world readable/writable,
# And so anyone who can get local access to your machine can do whatever they
# Want. You shoshould only have this set to "" if this is a testing Installation
# And you cannot set this up any other way. You have been warned!
# If you set this to anything other than "", you will need to run checksetup. pl
# Asroot, or as a user who is a member of the specified group.
$ Webservergroup = 'daemon ';

 

5.3 change the ownership by the CHOWN command as below:

Chown-r root: Daemon bugs/

 

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.