Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Apache with mod jk maintenance page when tomcat goes down

Status
Not open for further replies.

webamol

Programmer
Sep 4, 2016
5
IN
Hello All,

I would like to set Apache maintenance page when tomcat goes down.

I have apache installed and using mod_jk connector to redirect request to backend tomcat servers.

I did following configurations under virtualhost 443 to setup maintenance page but it is not working as expected.

Alias /error/ "/opt/apache24/htdocs/"
ErrorDocument 503 /error/maintenance.html
JKMount /UserPortal tomcat1
JKMount /UserPortal/* tomcat1
JkUnMount /error* tomcat1

Kindly suggest if anything else is required to setup maintenance page.

Thanks
 
Define "not working as expected"


"under virtualhost 443 "

Which means that it ONLY applies to HTTPS connections.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.

Never mind these jesus character, stars had to die for me to live.
 
Hello Chris,

Thanks for the response.

I mean I am not getting customized maintenance page when backend server tomcat is down.

Thanks
 
I mean I am not getting customized maintenance page when backend server tomcat is down.

That's because a HTTP:503 response only applies to services that are on the same host machine NOT when a remote service is inaccessible.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.

Never mind these jesus character, stars had to die for me to live.
 
Hello Sir,

Thanks for the response.

Kindly let me know what should be done in this case.

Can't we set customized maintenance page when tomcat goes down on remote machine.

Thanks
 
You need to catch whatever response the local server gives when the remote server is 'down', it will probably be either a 408 response (Request Timeout) or a 502 response (Bad Gateway). I can't tell you which one it will be, as I don't know how your system is set up.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.

Never mind these jesus character, stars had to die for me to live.
 
I have checked the logs and found that it is catching error code 503.

Kindly help me what needs to be done in this case.

Thanks
 
Now the issue is resolved.I am able to get customized maintenance page.

I have to comment the following line(Require all denied) in the apache configuration file.

Before

<Directory />
AllowOverride none
Require all denied
</Directory>

After

<Directory />
AllowOverride none
#Require all denied
</Directory>

Thanks everyone for all your kind support.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top