504 Gateway Time-out The server didn't respond in time. How to fix it?

Ricardo picture Ricardo · Nov 4, 2014 · Viewed 92.6k times · Source

The client requested to download a compressed log file, using Ext.js a form submission on an embedded iframe. Request was sent to server, which has Apache and JBoss 6. The servlet compresses log files, do some database operation and returns the compressed file.

Exactly after 2 min, the 504 Gateway Time-out The server didn't respond in time message is seen at the browser net panel. How to fix this error?

Answer

Ricardo picture Ricardo · Nov 4, 2014

The servlet was taking a long time to compress the log files, and Apache's timeout was set to 2min.

The error was fixed by increasing the TimeOut Directive on the httpd.conf file:

#
# Timeout: The number of seconds before receives and sends time out.
#
##Timeout 120
Timeout 600