Error apache : access denied

Frank Drebin

My configuration :

Wampserver 3.0.0 32bits Apache 2.4.17 php 5.6.15 mysql 5.7.9

My problem : WampServer start properly, but when I try to access a project in the log i have:


[Sat May 21 10:55:39.393866 2016] [authz_core:error] [pid 6984:tid 1140] [client 127.0.0.1:50070] AH01630: client denied by server configuration: C:/wamp/www/project/api/app/

[Sat May 21 10:55:39.395878 2016] [authz_core:error] [pid 6984:tid 1140] [client 127.0.0.1:50070] AH01630: client denied by server configuration: C:/wamp/www/project/api/src/

Yet I check my configuration files and all seems OK.

There are my configs files :

httpd.conf :

<Directory "C:/wamp/www/">
#
# 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
# [httpd.apache.org]
# 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:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride all

#
# Controls who can get stuff from this server.
#

#onlineoffline tag - don't remove
#Require local
Require all granted
</Directory>


httpd-vhosts.conf:

<VirtualHost *:80>
ServerAdmin [email protected]
ServerName localhost
DocumentRoot "C:/wamp/www"
<Directory "C:/wamp/www">
Options +Indexes +FollowSymlinks
AllowOverride All
</Directory>
</VirtualHost>

<VirtualHost *:80>
ServerAdmin [email protected]
ServerName localhost.project.com
#ServerAlias localhost.project.com
DocumentRoot "C:/wamp/www/project/website/web/"
<Directory "C:/wamp/www/project/website/web/">
Options +Indexes +FollowSymlinks
AllowOverride All
</Directory>
</VirtualHost>

<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "C:/wamp/www/project/api"
ServerName api.project.com
#ServerAlias api.project.com
<Directory "C:/wamp/www/project/api">
Options +Indexes +FollowSymlinks
AllowOverride All
</Directory>
</VirtualHost>

<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "C:/wamp/www/Demo_websocket/web"
ServerName demo.websocket
#ServerAlias demo.websocket
<Directory "C:/wamp/www/Demo_websocket/web">
Options +Indexes +FollowSymlinks
AllowOverride All
</Directory>
</VirtualHost>

My hosts file :

I think I do not understand very well what you mean. The content of my hosts file is : 127.0.0.1 localhost 127.0.0.1 api.project.com 127.0.0.1 localhost.project.com

I already tried to set Require all granted in VirtualHost but no success :s

If someone has already faced this problem and found a solution , I'm interested. Thank you

Danilo Calzetta

you are using localhost with virtual hosting, if this is your hosts file, it is correct

127.0.0.1 localhost 
127.0.0.1 api.project.com 
127.0.0.1 localhost.project.com

and in your local browser you'll write one of these urls.

But your virtual host configuration must respond to a specific host and not to *, for example fo api you must have <VirtualHost api.project.com:80> and not <VirtualHost *:80>

also the generic * virtual host MUST be at the end of the list, then the result is:

<VirtualHost localhost.project.com:80>
ServerAdmin [email protected]
ServerName localhost.project.com
#ServerAlias localhost.project.com
DocumentRoot "C:/wamp/www/project/website/web/"
<Directory "C:/wamp/www/project/website/web/">
Options +Indexes +FollowSymlinks
AllowOverride All
</Directory>
</VirtualHost>

<VirtualHost api.project.com:80>
ServerAdmin [email protected]
DocumentRoot "C:/wamp/www/project/api"
ServerName api.project.com
#ServerAlias api.project.com
<Directory "C:/wamp/www/project/api">
Options +Indexes +FollowSymlinks
AllowOverride All
</Directory>
</VirtualHost>

<VirtualHost demo.websocket:80>
ServerAdmin [email protected]
DocumentRoot "C:/wamp/www/Demo_websocket/web"
ServerName demo.websocket
#ServerAlias demo.websocket
<Directory "C:/wamp/www/Demo_websocket/web">
Options +Indexes +FollowSymlinks
AllowOverride All
</Directory>
</VirtualHost>

<VirtualHost *:80>
ServerAdmin [email protected]
ServerName localhost
DocumentRoot "C:/wamp/www"
<Directory "C:/wamp/www">
Options +Indexes +FollowSymlinks
AllowOverride All
</Directory>
</VirtualHost>

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

TOP Ranking

HotTag

Archive