Apache often fails to access the directory list, displaying 403 Forbidden

Time:2020-10-31

Apache often fails to access the directory list, displaying 403 Forbidden

When developing learning, every time you reset Apache, you always report an error: forbidden you don’t have permission to access / on this server

Apache often fails to access the directory list, displaying 403 Forbidden

Let me count the problems I have encountered and the solutions

First of all, in Linux, the website directory permission is changed to 755

Solution 1:

Find / usr / local / Apache / conf/ httpd.conf

Include conf/extra/httpd-vhosts.conf

Since vhosts was not configured when it was just installed, comment it out and restart Apache to access it

Solution 2:

hold index.php And |. PHP (PHP probe, if not, do not need to move) file names

Apache often fails to access the directory list, displaying 403 Forbidden
Solution 3:

This bothered me for a long time. It was useless to change the Apache configuration file. Later, it was found that it was the root directory. I set the htaccess file to - indexes and changed it to + indexes
![.htaccess](https://cdn.learnku.com/uploads/images/202005/26/34227/vHz8RnYmuy.png!large)

Recommended Today

Comparison and analysis of Py = > redis and python operation redis syntax

preface R: For redis cli P: Redis for Python get ready pip install redis pool = redis.ConnectionPool(host=’39.107.86.223′, port=6379, db=1) redis = redis.Redis(connection_pool=pool) Redis. All commands I have omitted all the following commands. If there are conflicts with Python built-in functions, I will add redis Global command Dbsize (number of returned keys) R: dbsize P: print(redis.dbsize()) […]