Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem of apache 403 error Linux

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

How to solve the problem of apache 403 error Linux, in view of this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.

A 403 error occurs when the web page opens with the following error.

Forbidden

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

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

-rw-r--r-- 1 root root 0 Jun 4 22:11 oldboy.html

Tip: listed above is that there is no default home page DirectoryIndex index.html under the site directory / var/blog directory

The configuration of b.apache three configurations that prohibit directory browsing

The first configuration:

Options-Indexes FollowSymLinks

AllowOverride None

Order allow,deny

Allow from all

The second configuration:

Options FollowSymLinks

AllowOverride None

Order allow,deny

Allow from all

The third configuration:

Options None

AllowOverride None

Order allow,deny

Allow from all

Tip: the second reason is that friends occasionally meet friends, but the first reason is that they encounter the most problems.

Reason 3: it's still a Directory permission issue (it doesn't happen often)

As below: 10.0.0.0amp 24 access is denied. In this way, the denied host access will have a 403 error.

Options Indexes FollowSymLinks

AllowOverride None

Order allow,deny

# Allow from all

Deny from 10.0.0.0/24

Options Indexes FollowSymLinks

AllowOverride None

Order allow,deny

# Allow from all

Allow from 10.0.0.116

# Deny from 10.0.0.0/24

Reason 4: site directory permission issues (which do not occur frequently).

The site directory requires the user of apache to have access, otherwise a 403 error will be reported.

[root@http-server var] # pwd

/ var

[root@http-server var] # chown-R root.root blog/

[root@http-server var] # chmod 700 blog

[root@http-server var] # ll-d blog/

Drwx- 3 root root 4096 Jun 4 22:11 blog/

This is the answer to the question about how to solve the problem of apache 403 error Linux. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel to learn more about it.

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report