Nice programing

서버 구성에 의해 거부 된 클라이언트

nicepro 2021. 1. 9. 11:37
반응형

서버 구성에 의해 거부 된 클라이언트


kohana 3 프로젝트를 가상 호스트로 설정하려고합니다.

구성 :

<VirtualHost *:80>
  DocumentRoot "D:/Devel/matysart/matysart_dev1"
  ServerName matysart-one.local
  ServerAlias www.matysart-one.local
  DirectoryIndex index.php
</VirtualHost>

오류 (403) :

[client 127.0.0.1] 클라이언트가 서버 구성에 의해 거부되었습니다 : D : / Devel / matysart / matysart_dev1 /

누군가 도울 수 있습니까?


제 경우에는 디렉토리 태그를 수정했습니다.

에서

<Directory "D:/Devel/matysart/matysart_dev1">
  Allow from all
  Order Deny,Allow
</Directory>

<Directory "D:/Devel/matysart/matysart_dev1">
  Require local
</Directory>

그리고 그것은 심각하게 작동했습니다. Apache 2.4.2에서 변경된 것 같습니다.


나를 위해 예제에서 복사 한 다음 작업이 /etc/apache2/apache2.conf:

<Directory /srv/www/default>
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>

Require all granted옵션은 Apache 버전 2.4 이상에 대한이 문제 전용 wiki.apache.org 페이지 의 첫 번째 문제 예제에 대한 솔루션입니다 .

필요 옵션에 대한 자세한 정보는에서 찾을 수 있습니다 mod_authz 모듈에 대한 공식 아파치 페이지 와에 너무 페이지 . 즉:

모든 권한 부여 필요-> 액세스가 무조건 허용됩니다.


"클라이언트가 서버 구성에 의해 거부되었습니다"라는 오류는 일반적으로 구성의 어딘가에 Allow fromDeny from액세스를 차단하는 지시문 이 있음을 의미합니다 . 자세한 내용 mod_authz_host 문서를 읽어보십시오 .

다음과 같은 것을 추가하여 VirtualHost에서이 문제를 해결할 수 있습니다.

<Location />
  Allow from all
  Order Deny,Allow
</Location>

또는 Directory지시문으로 :

<Directory "D:/Devel/matysart/matysart_dev1">
  Allow from all
  Order Deny,Allow
</Directory>

Apache 구성 파일을 조사하면 기본 DocumentRoot에 대한 기본 제한이 나타날 수 있습니다.


나의 경우에는,

macOS Mojave (Apache / 2.4.34)를 사용하고 있습니다. /etc/apache2/extra/httpd-vhosts.conf 파일의 가상 호스트 설정에 문제가 있습니다. 필요한 디렉토리 태그를 추가 한 후 내 문제가 사라졌습니다.

모두 허가 필요

전체 가상 호스트 설정 구조가 당신을 구할 수 있기를 바랍니다.

<VirtualHost *:80>
    DocumentRoot "/Users/vagabond/Sites/MainProjectFolderName/public/"
    ServerName project.loc

    <Directory /Users/vagabond/Sites/MainProjectFolderName/public/>
        Require all granted
    </Directory>

    ErrorLog "/Users/vagabond/Sites/logs/MainProjectFolderName.loc-error_log"
    CustomLog "/Users/vagabond/Sites/logs/MainProjectFolderName.loc-access_log" common
</VirtualHost>

all you've to do replace the MainProjectFolderName with your exact ProjectFolderName.


this worked for me..

<Location />
 Allow from all
 Order Deny,Allow
</Location>

I have included this code in my /etc/apache2/apache2.conf


This has happened to me several times migrating from Apache 2.2.

What I have found is that there is an Order,Deny that I missed with VIM's Search feature somehow that is the default main Vhost, line 379. Hope this helps someone. I commented out the Order Deny,Allow and Deny from All and it worked!


I have servers with proper lists of hosts and IPs. None of that allow all stuff. My fix was to put the hostname of my new workstation into the list. So the advise is:

Make sure the computer you're using is ACTUALLY on the list of allowed IPs. Look at IPs from logmessages, resolve names, check ifconfig / ipconfig etc.

*Google sent me due to the error-message.

ReferenceURL : https://stackoverflow.com/questions/8413042/client-denied-by-server-configuration

반응형