4
votes

Setup includes: Windows 7 Apache 2.2 Tomcat 5.5 mod_jk-1.2.30-httpd-2.2.3

After performing the appropriate installs, I can get to the Apache default page, and I can access the Tomcat on localhost as well. But when I try to access jsp-examples via Apache, I'm getting the following error 503:

"Service Temporarily Unavailable The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

I checked apache and tomcat logs, but they do not report any exceptions there, would appreciate if anyone can point how can I find what is the problem.

5

5 Answers

2
votes

If Apache is coming back with a 503 error it means that it can't establish a connection to the backend server. In your case, via mod_jk and the tomcat connector. Both Tomcat and Apache need to be configured properly to communicate. Ensure that your tomcat listeners are set up properly (AJP in most cases) and that your worker configuration refers to that same AJP listener. Finally make sure to properly refer to the right worker in your httpd.conf, .htaccess or vhost file.

0
votes

Apache HTTPD sometimes requires a kick to get it to recognise that a Tomcat service is available again. I don't know how this is done under Windows, but under Linux I do:

service httpd reload

Sometimes that fails. Then I do:

service httpd restart.

And then it works.

I need to find a permanent solution for this though. Every time Tomcat is restarted, I need to kick Apache again to get it to allow AJP connections again.

0
votes

For me the issue got resolved by changing the order of PassProxy entry in 10_proxy.conf file in /etc/httpd/ for the URL entry I was hitting.

Note : There could be many other issues for 503 error but surely related to .conf files.

0
votes

I encountered this issue:

"Service Temporarily Unavailable The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

Finally I find my server is under CC attacks, which occupy resources, so I apply a CC defense rule, then I solved this issue.

0
votes

Just edit this file with your fivorite editor /etc/httpd/conf.modules.d/00-proxy.conf make sure this file is not empty, it should have modules lines like LoadModule ....

add this code after LoadModule lines

ProxyRequests off

<Proxy *>
    Order deny,allow
    Deny from all
    Allow from all
</Proxy>
ProxyTimeout 300

then reload the server systemctl restart httpd

this manipulation works for centos 7, tomcat 7, and apache webserver