作業日記@HatenaBlog

各種の作業メモ

Proxy のエラー

エラーログ

Apacheのログに、以下のようなエラーが時々記録される。

# tail -n 1 /var/log/HOGE_proxy-error.log
 
[Fri Jan 01 HH:MM:SS 20xx] [error] [client PPP.QQQ.RRR.SSS] (20014)Internal error: proxy: error reading status line from remote server 192.168.n.m:80, referer: http://sample.com/foo.html

 

解決策

httpd.conf の extra ディレクトhttpd-vhosts,conf の記述に以下の2行を追記。

# cd /usr/local/etc/apache22/extra/
# vi httpd-vhosts.conf
 
<VirtualHost *:80>
        ServerAdmin     info@sample.com
        ServerName      sample.com
        ServerAlias     www.sample.com
        ProxyRequests   Off
        
                Order deny,allow
                Allow from All
        
        ProxyPass        /      http://192.168.n.m/
        ProxyPassReverse /      http://192.168.n.m/
        CustomLog "/var/log/HOGE_proxy-access.log" common
        ErrorLog "/var/log/HOGE_proxy-error.log"
        SetEnv force-proxy-request-1.0 1
        SetEnv proxy-nokeepalive 1
</VirtualHost>
 
# /usr/local/etc/rc.d/apache22 reload