Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Detect cause of 503 Service Temporarily Unavailable error and handle it?

i am getting the error 503 Service Temporarily Unavailable many times in my application and i want to detect why this error occurs, how ? if there's a log file or something like that, since i am not familiar with apache.

second thing is that, is it possible to handle this error, that when it occurs apache is restarted ?

like image 247
Mahmoud Saleh Avatar asked Jun 09 '11 20:06

Mahmoud Saleh


People also ask

What causes 503 service temporarily unavailable?

A 503 Service Unavailable Error indicates that a web server is temporarily unable to handle a request. That could be the web server you're trying to access directly, or another server that web server is in turn trying to access.


1 Answers

There is of course some apache log files. Search in your apache configuration files for 'Log' keyword, you'll certainly find plenty of them. Depending on your OS and installation places may vary (in a Typical Linux server it would be /var/log/apache2/[access|error].log).

Having a 503 error in Apache usually means the proxied page/service is not available. I assume you're using tomcat and that means tomcat is either not responding to apache (timeout?) or not even available (down? crashed?). So chances are that it's a configuration error in the way to connect apache and tomcat or an application inside tomcat that is not even sending a response for apache.

Sometimes, in production servers, it can as well be that you get too much traffic for the tomcat server, apache handle more request than the proxyied service (tomcat) can accept so the backend became unavailable.

like image 69
regilero Avatar answered Oct 04 '22 20:10

regilero