Access the site after you configure the virtual host. Prompt I do not have permission to access permissions
In general, there are several problems;
1, Site Directory access permissions configuration issues
2, Directory Permissions issues
3, Path problem
Tip I don't have permission to solve the idea, the first step to check the Site Directory permissions settings
[email protected]_lamp HTML] #tree
.
├── BBS
│ └── index.html
├── Blog
│ └── index.html
└── www
└── index.html
3 Directories, 3 files
[email protected]_lamp HTML] #ll
Total 12
drwxrwxrwx 2 root root4096 Mar 4 07:57 BBS
drwxrwxrwx 2 root root4096 Mar 4 07:58 Blog
drwxrwxrwx 2 root root4096 Mar 4 07:58 www
I give the directory maximum permissions. 777 still error
The second step is to check the site Directory permissions for my configuration
[email protected]_lamp conf] #diff httpd.conf httpd.conf-2015-02
161,162c161,162
< User www
< Group www
---
> User Daemon
> Group Daemon
192c192
< servernamelocalhost:80
---
> #ServerNamewww. example.com:80
250c250
< DirectoryIndex index.php index.html
---
> DirectoryIndex index.html
275c275
< LogLevel error
---
> LogLevel warn
379,380d378
< AddType application/x-httpd-php. php
< AddType application/x-httpd-souce. Phps
450c448
< includeconf/extra/httpd-mpm.conf
---
> #Include conf/extra/httpd-mpm.conf
468c466
< includeconf/extra/httpd-vhosts.conf
---
> #Includeconf/extra/httpd-vhosts.conf
507,513d504
<
< <directory "/data0/html" >
< Options FollowSymLinks
< allowoverride None
< Order Allow,deny
< allow from all
< </Directory>
[Email protected]_lamp conf]#/etc/init.d/httpd Graceful
Access
You don ' t havepermission to access/on the this server. Web page display 403 prohibit access
View parsing
20.0.0.10 www.wangxing.org
20.0.0.10 bbs.wangxing.org
20.0.0.10 blog.wangxing.org
Client resolution
Check parsing OK
Firewall:
[Email protected]_lamp conf]#/etc/init.d/iptables Status
Iptables:firewall IsNot running.
[[Email Protected]_lamp conf]#/etc/init.d/iptables Stop
[email protected]_lamp conf] #getenforce
Disabled
View Source
403 Error
20.0.0.1--[04/mar/2015:08:59:25 +0800] "Get/favicon.ico http/1.1" 403 220
20.0.0.1--[04/mar/2015:08:59:25 +0800] "get/http/1.1" 403 209
20.0.0.1--[04/mar/2015:08:59:25 +0800] "Get/favicon.ico http/1.1" 403 220
20.0.0.1--[04/mar/2015:08:59:25 +0800] "get/http/1.1" 403 209
20.0.0.1--[04/mar/2015:08:59:25 +0800] "Get/favicon.ico http/1.1" 403 220
20.0.0.1--[04/mar/2015:08:59:25 +0800] "get/http/1.1" 403 209
20.0.0.1--[04/mar/2015:08:59:25 +0800] "get/favicon.icohttp/1.1" 403
https://wiki.apache.org/httpd/ClientDeniedByServerConfiguration see what's changed in the website
Based on Error hints
Youdon ' t has permission to access/on the this server. go to the official website to find reasons
Http://httpd.apache.org/docs/2.4/upgrading.html According to the information of the official website to modify permissions after OK
View Apache the configuration file, httpd.conf
<directory/>
allowoverride None
Requireall denied
</Directory>
This sentence means rejecting me. / Directory Access, which may be Apache for security reasons, just need to comment out or modify this sentence can solve the problem, how to modify please refer to the official website explanation
Http://httpd.apache.org/docs/2.4/upgrading.html, but in many cases some of them are either default or accessible, but my problem has been fixed,
Summary, in configuring the virtual host and PHP Set the time
1. Apache integrated PHP configuration
Php The following configuration file is recommended as the website for adding
<filesmatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
Add this sentence to the last side of the httpd.conf,
There are PHP source filters, but the official website is not recommended in the production environment to use, for security considerations
<filesmatch "\.phps$" >
Sethandlerapplication/x-httpd-php-source
</FilesMatch>
2 , the configuration of Site Directory permissions
The configuration of the Site Directory permissions can be added to the httpd.conf , or it can be added to the httpd-vhosts.conf file.
<directory "/data0/html" >
Options FollowSymLinks
AllowOverride None
Order Allow,deny
Allow from all
</Directory>
Can be added in a virtual configuration file, or in the last face of a virtual profile,
can use /usr/local/apache2/bin/apachectl–s to check the configuration file for the virtual host
then use /usr/local/apache2/bin/apachectl Graceful to test,
Remark: The help of Apache official website needs to turn over the wall, hehe
This article is from the "Little Rookie" blog, please be sure to keep this source http://xiaocainiaox.blog.51cto.com/4484443/1617203
Troubleshoot Apache access Display 403