我设置了apache来代理tomcat,但是当我定位页面时却遇到了以下错误。有时会出现空白页或503:
[错误]
[Mon Dec 03 04:58:16 2012] [error] proxy: ap_get_scoreboard_lb(2) failed in child 29611 for worker proxy:reverse
[Mon Dec 03 04:58:16 2012] [error] proxy: ap_get_scoreboard_lb(1) failed in child 29611 for worker https://localhost:8443/
[Mon Dec 03 04:58:16 2012] [error] proxy: ap_get_scoreboard_lb(0) failed in child 29611 for worker http://localhost:8080/
我在虚拟机上配置了两个虚拟主机,如下所示:
[http主机]
<VirtualHost *:80>
ServerName www.mysite.net
ServerAlias mysite.net
ProxyRequests Off
ProxyPreserveHost On
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / http://localhost:8080/ retry=0
ProxyPassReverse / http://localhost:8080/ retry=0
</VirtualHost>
[ssl虚拟主机]
<VirtualHost *:443>
ServerName www.mysite.net
ServerAlias mysite.net
ErrorLog /var/log/apache2/error.log
LogLevel warn
CustomLog /var/log/apache2/access.log combined
ServerSignature On
SSLEngine on
SSLProxyEngine on
SSLCertificateFile /etc/apache2/ssl/server.crt
SSLCertificateKeyFile /etc/apache2/ssl/server.key
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / https://localhost:8443/ retry=0
ProxyPassReverse / https://localhost:8443/ retry=0
</VirtualHost>
我的系统详细信息是:Apache / 2.2.22(Ubuntu)mod_jk / 1.2.32 mod_ssl / 2.2.22 OpenSSL / 1.0.1 mod proxy_http也已启用。
apachectl restart
还是不够的。我必须做一个apachectl stop; apachectl start
以防止发生此错误(也适用于Apache httpd 2.2.2)。