2014-12-01 3 views
1

여기 많은 예제가 있지만 다른 컴퓨터에서 내 WAMP 서버에 계속 액세스 할 수 없습니다. WAMP가 설치된 컴퓨터에서 아무런 문제가 없습니다.금지됨 : 액세스 할 수있는 권한이 없습니다/

나는 그것이 You don't have permission to access /라고 말합니다 - 이유는 /입니까?

// httpd.conf를

<Directory "D:/wamp/www/"> 
    Options Indexes FollowSymLinks 
    AllowOverride all 
    Order Deny,Allow 
    Deny from all 
    Allow from ::1 
    Allow from 192.168.0.1 // <- typo 
    Allow from 192.168.1.148 
</Directory> 

//httpd.vhosts.conf

<VirtualHost 192.168.1.119> 
    DocumentRoot D:/wamp/www/mysite/ 
    ServerName mysite.com 
    ServerAlias mysite.com 
</VirtualHost> 

// 호스트 파일

192.168.1.119 localhost 
192.168.1.119 mysite.com 
+0

당신이 사용하는 WAMPServer의 버전은 무엇? – RiggsFolly

+0

버전 2.5를 사용하고 있습니다. – Steven

답변

1

시도 이러한 변화

우선이 WAMPS에 대한 액세스를 제어합니다. erver homepage, 가능한 모든 로컬 주소를 허용 목록에 추가하십시오.

목록에 2 개의 서브넷이있는 것 같습니다. 오타가 있습니까? 나는 그렇게 추측하고있다.

또한 IP 주소의 처음 3 개의 사 분위수를 사용하면 해당 서브넷의 모든 IP에서 허용됩니다.

// httpd.conf를

<Directory "D:/wamp/www/"> 
    Options Indexes FollowSymLinks 
    AllowOverride all 
    Order Deny,Allow 
    Deny from all 
    Allow from ::1 127.0.0.1 localhost 
    Allow from 192.168.1 
</Directory> 

당신은 당신의 가상 호스트 정의에 임의의 포트 번호를 언급하지 말아 특정 IP 주소를 사용할 필요가 없습니다.

또한 로컬 호스트 VHOST를 추가하고 각 VHOST 정의 내에 액세스 제한 즉 <Directory...> 블록을 추가하는 것이 좋습니다. 그런 다음 각 VHOST의 액세스 권한을 구체적으로 수정할 수 있습니다.

Apache 2.4.x에서 액세스 권한에 대한 구문도 있으므로 WAMPServer2.5 릴리스에 추가 된 매개 변수를 사용하여 액세스 권한 섹션을 코딩했습니다.하지만 여전히 사용자 권한으로 작동해야합니다. 이전 WAMPServer 버전 즉, 2.4 또는 2.2

// 엑스트라/아파치 - vhost.conf

# Should be the first VHOST definition so that it is the default virtual host 
# Also access rights should remain restricted to the local PC and the local network 
# So that any random ip address attack will recieve an error code and not gain access 
<VirtualHost *:80> 
    DocumentRoot "D:/wamp/www" 
    ServerName localhost 
    ServerAlias localhost 
    <Directory "D:/wamp/www"> 
     AllowOverride All 
     <IfDefine APACHE24> 
      Require local 
      Require ip 192.168.1 
     </IfDefine> 
     <IfDefine !APACHE24> 
      Order Deny,Allow 
      Deny from all 
      Allow from 127.0.0.0/8 localhost ::1 192.168.1 
     </IfDefine> 
    </Directory> 
</VirtualHost> 



<VirtualHost *:80> 
    DocumentRoot "D:/wamp/www/mysite" 
    ServerName mysite.com 
    ServerAlias www.mysite.com 
    <Directory "D:/wamp/www"> 
     AllowOverride All 
     <IfDefine APACHE24> 
      Require local 
      Require ip 192.168.1 
     </IfDefine> 
     <IfDefine !APACHE24> 
      Order Deny,Allow 
      Deny from all 
      Allow from 127.0.0.0/8 localhost ::1 192.168.1 
     </IfDefine> 
    </Directory> 
</VirtualHost> 
+0

감사합니다. 실제로 작동했습니다. 'httpd.conf 만 업데이트하는 것만으로는 도움이되지 않았지만'httpd-vhost.conf'에 변경 사항을 추가했을 때 제대로 작동했습니다. – Steven

+0

당신이 놀란다고 들리니? – RiggsFolly

+0

지금까지는 메인 설정에서''만 설정하고 각 가상 호스트에 추가하지 않아야했기 때문에. – Steven

관련 문제