기본 mod_proxy 가상 호스트 설정 Options Indexes

localhost에 대한 모든 요청을 / var / www의 정적 파일로 유지하면서 127.0.0.1:8080에서 실행중인 WEBrick 서버에 test.local에 대한 모든 요청을 프록시하도록 기본 가상 호스트를 설정하려고합니다. 우분투 10.04를 실행 중입니다.

libapache2-mod-proxy-html이 설치되어 있고 a2enmod 프록시로 모듈을 활성화했습니다. 가상 호스트도 활성화했습니다. 그러나 test.local에 갈 때마다 항상 cryptic 500 서버 오류가 발생하고 모든 로그에서 나에게 다음과 같이 말합니다.

[Thu Mar 03 01:43:10 2011] [warn] proxy: No protocol handler was valid for the URL /. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.

내 가상 호스트는 다음과 같습니다.

<VirtualHost test.local:80>
    LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so
    ServerAdmin webmaster@localhost
    ServerName test.local
    ProxyPreserveHost On

    # prevents this folder from being proxied
    ProxyPass /static !

    DocumentRoot /var/www
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>

    <Proxy *>
        Order allow,deny
        Allow from all
    </Proxy>
    ProxyPass / http://localhost:8080/
    ProxyPassReverse / http://localhost:8080/

    ErrorLog /var/log/apache2/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog /var/log/apache2/access.log combined

다음은 mod_proxy에 대한 설정입니다.

<IfModule mod_proxy.c>
        #turning ProxyRequests on and allowing proxying from all may allow
        #spammers to use your proxy to send email.

        ProxyRequests Off

        <Proxy *>
        # default settings
                #AddDefaultCharset off
                #Order deny,allow
                #Deny from all
                ##Allow from .example.com

        AddDefaultCharset off
        Order allow,deny
        Allow from all
        </Proxy>

        # Enable/disable the handling of HTTP/1.1 "Via:" headers.
        # ("Full" adds the server version; "Block" removes all outgoing Via: headers)
        # Set to one of: Off | On | Full | Block

        ProxyVia On
</IfModule>

내가 뭘 잘못하고 있는지 아는 사람 있습니까? 감사



답변

mod_proxy_httpHTTP 서버로 프록시하는 데 필요한 모듈을 로드하지 않는 것 같습니다 . 내 앞에 Ubuntu 10.04가 없지만 IIRC는 다음과 같습니다.

sudo a2enmod proxy_http


답변

위의 답변은 선택한 답변의 저자 의견과 동일한 오류가 발생하여 도움이되지 않았습니다. 그러나 내 문제를 해결 한 다음 게시물과 변경 사항을 찾았습니다.


sudo /usr/sbin/setsebool -P httpd_can_network_connect 1

출처 : http://allscm.com/archives/apache2-proxy-disabled-connection-on-localhost.html


답변