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

What if there is a 403 error in apache?

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

Editor to share with you what to do when there are 403 errors in apache. I believe most people don't know much about it, so share this article for your reference. I hope you can learn a lot after reading this article. Let's learn about it together.

Apache, version 2.2.8, after installation, related tests will be conducted.

After configuring the php.in file under php, open localhost again and find an error:

HTTP error 403-access prohibited, i.e. 403 Forbidden:You don't have permission to access / on this server.

It could be a problem caused by a lack of permissions.

Solution:

Open apache's configuration file httpd.conf and check it line by line.

Find:

The code is as follows:

Options FollowSymLinks

AllowOverride None

Order deny,allow

Deny from all

Since php is configured, "Deny from all" here denies all connections.

Changing this line to "Allow from all" will solve the problem.

The modified code is:

The code is as follows:

Options FollowSymLinks

AllowOverride None

Order deny,allow

Allow from all

Open http://localhost in the browser and display it works! Problem solved.

Summary:

In the apache server, when you encounter 403 forbidden access, focus on whether there is a code like "Deny from all" in the httpd.conf configuration file of apache.

This may have been changed automatically by restarting apache after modifying some configuration files.

Attached, another example of apache 403 error.

Apache 403 error with the following message:

You do not have permission to view this page

You may not have permission to view this directory or web page with the credentials you provided

If you are sure you can view the directory or web page, try contacting the website using the email address or phone number listed on the 192.168.1.5 home page.

You can click search to find information on Internet.

HTTP error 403-access prohibited

Internet Explorer

Remove the hook that displays friendly messages and display Forbidden You don't have permission to access\ on this server.

I checked the configuration file httpd.conf and found a paragraph like this:

The code is as follows:

Options FollowSymLinks

AllowOverride None

Order deny,allow

Deny from all

Satisfy all

Then try to change the deny in deny from all to allow, save it and restart apache, and access the test site is completely normal.

After upgrading to version 2.2, APACHE provides and supports many modules, and there are also many improvements in performance and security.

After you have previously configured httpd.conf for apache, you can use it.

But now you have to configure this file in other ways, or there will be a http 403 permission problem.

The solution.

The following is one of the original code from the httpd.conf file.

Change the red flag of the following code:

The code is as follows:

#

# Possible values for the Options directive are "None", "All"

# or any combination of:

# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews

#

# Note that "MultiViews" must be named * explicitly*-"Options All"

# doesn't give it to you.

#

# The Options directive is both complicated and important. Please see

# [url] http://httpd.apache.org/docs/2.2/mod/core.html#options[/url]

# for more information.

#

Options Indexes FollowSymLinks

#

# AllowOverride controls what directives may be placed in .htaccess files.

# It can be "All", "None", or any combination of the keywords:

# Options FileInfo AuthConfig Limit

#

AllowOverride all

#

# Controls who can get stuff from this server.

#

# onlineoffline tag-don't remove

Order Deny,Allow

Deny from all

Allow from 127.0.0.1

The red part is changed to Allow from all, which means that all access is allowed.

The following is a supplement:

Key error: You don't have permission to access / on this server

Open the web page, the result access prompt: 403 error! Turn off IE's "Show friendly HTTP errors" to show no permission to access (You don't have permission to access / on this server)!

Analysis of the main causes of 403 Forbidden

1 your IP is blacklisted

2 you visit this website too much within a certain period of time (usually with a collector) and are denied access by the firewall

3 the domain name of the website is resolved to the space, but the space is not bound to this domain name.

4 your web script file does not have execution permission in the current directory

5 create / write file operation was performed in a directory where writing / creating files is not allowed

6 the server is busy, and too many requests are sent from the same IP address, which is blocked intelligently by the server.

403 Forbidden solution appears on END website

Modify the folder security properties with the following command

Chcon-R-t httpd_user_content_t public_html/

The command used parses:

Ls-Z-d public_html/

# display the security context of the file / directory-Z,-- context

Display security context so it fits on most displays. Displays only mode, user, group, security context and file name.-d-- directory

List directory entries instead of contents, and do not dereference symbolic links

Chcon-R-t httpd_user_content_t public_html/

# modify the security context of files / directories-R,-- recursive

Change files and directories recursively-t-- type

Set type TYPE in the target security context

END other workarounds:

Just rebuild the dns cache

Enter cmd in the run, and then enter ipconfig / flushdns

Or HTTP error 403-restricted to local host access to Internet service manager (HTML)

HTTP error 403.1 Forbidden: disable access

This error can occur if CGI, ISAPI, or other executable programs are executed from a directory that does not allow execution of the program.

If the problem persists, contact the administrator of the Web server.

HTTP error 403.2 Forbidden: disable read access

This error occurs if there is no default web page available or directory browsing for this directory is not enabled, or if you try to display a HTML page that resides in a directory that is only marked for execution or scripting permissions.

If the problem persists, contact the administrator of the Web server.

HTTP error 403.3 Forbidden: write access prohibited

This problem can occur if you try to upload or modify a file in a directory that does not allow write access.

If the problem persists, contact the administrator of the Web server.

HTTP error 403 403.4 Forbidden: SSL required

This error indicates that the web page you are trying to visit is protected by secure Sockets layer (SSL). To view, you must enter https:// before the address you are trying to access to enable SSL.

If the problem persists, contact the administrator of the Web server.

HTTP error 403 403.5 Forbidden: SSL 128is required

This error message indicates that the resource you are trying to access is protected by a 128-bit secure Sockets layer (SSL). To view this resource, you need a browser that supports this SSL layer.

Verify that your browser supports 128bit SSL security. If so, contact the administrator of the Web server and report the problem. 403.6 Forbidden: reject IP address

I think I probably don't have permission to access the directory, because in general, NTFS has very strict access control!

So open the directory, a look, access is unexpectedly full control of everyone! There is absolutely no problem for the user to access the folder! It must be the configuration of apache, so search the Internet and find the following relevant information to modify permissions.

The following is the referenced content:

Options FollowSymLinks

AllowOverride All

Order deny,allow

Deny from all

Satisfy all

According to the configuration file prompt, this setting is used to modify Apache's access to all directories, and if you modify it at will, it may bring security risks! So let's see what's going on, so that we can't access the web.

Deny from all has some basic English can be seen, here is the key: reject all!

Try changing Deny to Allow! (because there may be case-sensitive problems, it is recommended to use the first letter in uppercase, and those who are interested can try lowercase for themselves!) It passed at once, but if configured in this way, the server security will.

So I went on to look at the configuration file!

The following contents were found

#

# This should be changed to whatever you set DocumentRoot to.

#

No matter what your server root setting is, you must make sure that the configuration here is consistent!

The following is the referenced content:

#

# Possible values for the Options directive are "None", "All"

# or any combination of:

# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews

#

# Note that "MultiViews" must be named * explicitly*-"Options All"

# doesn't give it to you.

#

# The Options directive is both complicated and important. Please see

# http://httpd.apache.org/docs/2.2/mod/core.html#options

# for more information.

#

Options Indexes FollowSymLinks

#

# AllowOverride controls what directives may be placed in .htaccess files.

# It can be "All", "None", or any combination of the keywords:

# Options FileInfo AuthConfig Limit

#

AllowOverride None

#

# Controls who can get stuff from this server.

#

Order allow,deny

Allow from all

Then set the above "default directory" to "target directory" (of course, the setting for all permission access has been changed to deny!) Refresh the page, OK, passed!

The above is all the content of this article "what to do with 403 errors in apache". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

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