Apache가 원격 호스트 이름을 가져오지 못했습니다.

Apache가 원격 호스트 이름을 가져오지 못했습니다.

나는 가지고있다...

<VirtualHost example.com:80>
    ServerAdmin webmaster@localhost
    ServerName example.com

    Redirect permanent / https://example.com/
</VirtualHost>

바로 다음으로 이동합니다...

<IfModule mod_ssl.c>
    <VirtualHost example.com:443>

        ServerAdmin webmaster@localhost
        ServerName example.com
        ServerAlias example.com

        DocumentRoot /home/klyde/ror/exampledev/public

        SSLCertificateFile   /etc/apache2/ssl/certs/123abc.crt
        SSLCertificateChainFile /etc/apache2/ssl/certs/gd_bundle-g2-g1.crt
        SSLCertificateKeyFile /etc/apache2/ssl/private/examplekey.key

        BrowserMatch ".*MSIE.*" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0
        SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL

        SSLEngine on
        SSLProxyEngine On
        ProxyRequests On

        <Proxy *>
            AddDefaultCharset off
            #Options Indexes FollowSymLinks
            AllowOverride none
            <RequireAny>
                #<RequireAll>
                #   Require all granted
                #</RequireAll>
                <RequireAll>
                    Require host example.com
                </RequireAll>
                <RequireAll>
                    Require local
                    # Require ip 127.0.0.1
                </RequireAll>
            </RequireAny>
        </Proxy>

        ProxyPassReverseCookiePath / /
        ProxyPass /errors/ !

        ProxyPass /websockets ws://127.0.0.1:8675/
        ProxyPassReverse /websockets ws://127.0.0.1:8675/

        ProxyPass / ajp://localhost:8009/
        ProxyPassReverse / ajp://localhost:8009/

    </VirtualHost>
</IfModule>

활성화하면...

Require all granted

모두 잘 작동합니다. 그런데 사이트가 피싱 공격을 받고 있습니다. 나는 원한다...

Require host example.com

하지만 이로 인해 로그 오류가 발생합니다.

access check of 'example.com' to / failed, reason: unable to get the remote host name

Apache에서 SSL을 중지하고 Torquebox에서 ajp를 중지하고 싶기 때문에 이 구성을 선택했습니다. 사이트 보안을 시도하는 경우를 제외하고는 정상적으로 작동합니다. 물론 Torquebox를 사용하는 Apache는 완전히 바람직하지 않거나 권장되지 않을 수 있습니다. 반대의 제안도 환영합니다.

주요 질문 - '원격 호스트 이름' 오류가 발생하는 이유는 무엇입니까? 어떤 아이디어가 있나요?

답변1

이름으로 원격 호스트를 결정하는 것은 원격 IP 주소에 PTR레코드가 있는 경우에만 작동하며 모든 IP 주소가 작동하는 것은 아닙니다. 가능하다면 명령문에 IP 주소를 사용하십시오 Require.

기본 인증(https를 통한 선호)을 사용하여 액세스를 제한할 수도 있습니다.

proxy원하는 것이 기능뿐이라면 a를 정의할 필요가 없습니다 proxypass.

프록시가 필요한 경우 프록시를 도메인으로 제한해 보세요.

<Proxy http://www.example.com/*>
    ....
</Proxy>

답변2

사용하시면 될 것 같아요

Require ip 127.0.0.1

로컬 IP 대신 서버의 IP로

답변3

단지 작업을 열고 모든 IP에서 들어오는 요청을 허용하려면 다음을 사용할 수 있습니다.

Require all granted

자세한 내용은 여기를 참조하세요.https://serverfault.com/a/887196/468080

관련 정보