2016-10-03 67 views
0

最近修改httpd.conf中和的httpd-vhosts.conf添加虛擬主機...虛擬主機造成403禁止在192.168.1.6 ......其他別名仍然工作

#IncludeOptional "E:/wamp/vhosts/*" 
Include "E:/wamp/alias/*" 

NameVirtualHost *:80 
<VirtualHost *:80> 
    DocumentRoot "e:/wamp/www" 
    ServerName localhost 
    ServerAlias localhost 
    <Directory "e:/wamp/www"> 
     Options Indexes FollowSymLinks 
     AllowOverride All 
     Require local 
     Require ip 192.168.1 
    </Directory> 
</VirtualHost> 

<VirtualHost *:80> 
    DocumentRoot E:/activeWork/projects 
    ServerName projects.local 
     <Directory "E:/activeWork/projects"> 
     Options Indexes FollowSymLinks 
     AllowOverride All 
     Require local 
    </Directory> 

</VirtualHost> 
<VirtualHost *:80> 
    DocumentRoot E:/activeWork/projects 
    ServerName www.projects.local 
     <Directory "E:/activeWork/projects"> 
     Options Indexes FollowSymLinks 
     AllowOverride All 
     Require local 
    </Directory> 
</VirtualHost> 
<VirtualHost *:80> 
    DocumentRoot E:/activeWork/projects 
    ServerName api.projects.local 
     <Directory "E:/activeWork/projects"> 
     Options Indexes FollowSymLinks 
     AllowOverride All 
     Require local 
    </Directory> 
</VirtualHost> 

當我嘗試加載192.168.1.6或127.0.0.1,給我:

Forbidden 

You don't have permission to access/on this server. 

我試圖解決它絲毫this answer但不是爲我工作

recommandation在回答我檢查我的access.log這是結果:

192.168.1.6 - - [03/Oct/2016:11:03:00 +0330] "GET/HTTP/1.1" 403 288 
127.0.0.1 - - [03/Oct/2016:11:00:55 +0330] "GET/HTTP/1.1" 403 286 
+0

看到這篇文章它會告訴你如何創建一個[適當和完整的虛擬主機定義](http://stackoverflow.com/questions/23665064/project-links-do-not-work-on-wamp-server/ 23990618#23990618) – RiggsFolly

+0

謝謝...我讀了所有這些,並編輯了我的Q,但我的問題是403錯誤192.168.1.6 –

+0

請向我們展示您的httpd-vhost.conf文件 – RiggsFolly

回答

0

我的問題是定義3虛擬主機指向同一個目錄,這個困惑阿帕奇......終於TNX到riggsfolly我固定的...這我旁邊讓從這個guide to define VHost更改已經設置事情正確的方式

0

,如果你確定你的WAMP的安裝路徑是裏面E: 那麼我建議你檢查你的訪問日誌和錯誤日誌收集更多的信息。

+0

這是一條評論,而不是答案 – RiggsFolly

0

我假設您在Wampserver上使用Apache 2.4或更高版本?如果是這樣,則更換需要在你的虛擬主機「要求的所有批准」,這樣的規則:

<VirtualHost *:80> 
    DocumentRoot "e:/wamp/www" 
    ServerName localhost 
    ServerAlias localhost 
    <Directory "e:/wamp/www"> 
     Options Indexes FollowSymLinks 
     AllowOverride All 
     Require all granted 
    </Directory> 
</VirtualHost> 

如果還是不行,請檢查您的防火牆阻止您的訪問。