1. Disable the indexes parameter, and the home page file does not exist in the site Directory
Here are the permissions issues for setting up the site Directory/application/apache2.22.27/htdocs, where the indexes parameter is in the site directory, if there is no home file index.xxx If the indexes parameter will show the structure of the site directory, if the indexes parameter is removed, then it appears 403 Forbidden
<directory "/application/apache2.22.27/htdocs" >
Options Indexes FollowSymLinks
AllowOverride None
Order Allow,deny
Allow from all
</Directory>
#################### #相关参数设置成下面, there will be 403 Forbidden
<directory "/application/apache2.22.27/htdocs" >
Options-indexes FollowSymLinks
AllowOverride None
Order Allow,deny
Allow from all
</Directory>
<ifmodule dir_module>
DirectoryIndex index.html
</IfModule>
Prohibit indexes parameter is an optimized function, because if you do not prohibit the indexes parameter, then when there is no home page file, then visit this site will list the entire Site directory structure, which is extremely insecure
2. For each additional site directory, you need to add the following to give the added directory the relevant permissions
<directory "added directory path such as:/application/apache2.22.27/htdocs" >
Options Indexes FollowSymLinks
AllowOverride None
Order Allow,deny
Allow from all
</Directory>
If you do not add the above content, then there is a 403 error
3. Even if you correctly set the permissions issue in 2, the site directory is not set to be readable by others.
<directory "added directory path such as:/application/apache2.22.27/htdocs" >
Options Indexes FollowSymLinks
AllowOverride None
Order Allow,deny
Allow from all
</Directory>
<ifmodule dir_module>
DirectoryIndex index.html
</IfModule>
Also specify the home page file index.html, your site directory also exists index.html but if your this site chmod permission does not allow other people to read. Then it could be a 403 error.
[Email protected]_web apache]# ll htdocs-d
D-wx--x--x 2 root root 4096 Sep 23:11 htdocs
[[Email Protected]_web apache]#
This article is from the "Technology Change Destiny" blog, please be sure to keep this source http://lvnian.blog.51cto.com/7155281/1696598
Apache 403 Forbidden