Apache crashing occasionally with error 503

apache-2.2PROXY

I am running a library management software called KOHA. Once or twice a week, the server returns a "503 Service Unavailable". I can access the home page, but when I search for a book, I get the 503. Similarly, the staff can log in to the staff page, but when they do something after logging in, they get the same error. I get these in my apache logs:

[Sun Sep 04 14:22:30.246305 2016] [proxy:error] [pid 27422] (2)No such file or directory: AH02454: HTTP: attempt to connect to Unix domain socket /var/run/koha/nitc/plack.sock (localhost) failed 
[Sun Sep 04 14:22:30.246380 2016] [proxy:error] [pid 27422] AH00959: ap_proxy_connect_backend disabling worker for (localhost) for 60s 
[Sun Sep 04 14:22:30.246394 2016] [proxy_http:error] [pid 27422] [client 192.168.65.199:56448] AH01114: HTTP: failed to make connection to backend: httpd-UDS, referer: http://192.168.20.17:8080/index.html

Hope someone can shred some light on this.

Best Answer

Apache2 acts as a reverse proxy here passing the requests coming to the web server forward to the actual application server, in your case KOHA here.

First log line tells that Apache2 cannot see the Unix socket for the KOHA server, which is used for communication between Apache2 and the KOHA server. Therefore the 503 error code is returned by Apache2 to the visitor when it cannot reach the application server.

The fact that the socket file is not there means that the server process is not running.

So, you need to check your application server logs for clues why it crashes.