2016-05-21 3 views
0

マイ設定拒否:エラーのapache:アクセスが

Wampserver 3.0.0 32ビット にはApache 2.4.17を PHP 5.6.15 のmysql 5.7.9

私の問題:私 が正常に起動しますが、WampServer私が持っているログにプロジェクトにアクセスしよう:


[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/ 

しかし、私は自分の設定ファイルをチェックしても問題ないです。

は私のconfigsファイルがあります。

の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> 

私のhostsファイル:

私は、私は非常によく、あなたが何を意味するか理解していないと思います。私 hostsファイルの内容は次のとおりです。 127.0.0.1 localhostの 127.0.0.1 api.project.com 127.0.0.1 localhost.project.com

私はすでに、すべてのVirtualHostで付与されますがありませんが必要な設定しようとしました成功:s

誰かが既にこの問題に直面して解決策を見つけた場合、私は興味があります。これはあなたのhostsファイルがある場合はあなたが仮想ホスティングではlocalhostを使用している

+0

あなたがここでやっていることは、名前ベースの仮想ホストです。 localhost上でのテストでは、ホストファイルが関連するすべての名前(localhost.project.com、api.project.comなど)を127.0.0.1に解決する必要があります。そして、デフォルトとしてホストが定義されていないので、これらの名前を参照するよう要求する必要があります。Apacheは、 "127.0.0.1"でアドレス指定された要求を受け取ったときに誰が意図したのか分かりません。 – fvu

+0

私はばかなことを言わないことを望みますが、ホストファイルの内容を追加するメッセージを編集します。 私があなたの言うことを理解すれば、そこから問題が生じます –

答えて

0

、 ありがとう、それは

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

正しいですし、ローカルのブラウザで、あなたはこれらのいずれかのURLを記述します。

しかし、あなたの仮想ホストの設定は、特定のホストに応答しなければならないと*、API FOたとえばあなたが<VirtualHost *:80>

<VirtualHost api.project.com:80>なくもジェネリック*仮想ホストがリストの最後にある必要があります持っている必要がありますしません、結果は次のようになります。

<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>