Mobile app version of vmapp.org
Login or Join
Megan663

: Maintenance Page via Apache when Tomcat is down I have an Apache2, sitting in front of Tomcat7 via ajp, all on Ubuntu. What I want to do is serve a simple static page with Apache when I

@Megan663

Posted in: #Apache2 #SiteMaintenance #Tomcat

I have an Apache2, sitting in front of Tomcat7 via ajp, all on Ubuntu. What I want to do is serve a simple static page with Apache when I perform maintenance.

I found this nice tutorial, but I am not that firm on Apache.

ServerName localhost
DocumentRoot /var/www/maintenance

##For maintenancepage
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}/maintenance.html -f
RewriteCond %{DOCUMENT_ROOT}/maintenance.enable -f
RewriteCond %{SCRIPT_FILENAME} !/maintenance.html
RewriteRule ^.*$ /maintenance.html [R=503,L]
ErrorDocument 503 /maintenance.html

#Directory settings omitted..

ProxyPass /maintenance.html !
ProxyPass / ajp://localhost:8009/
ProxyPassReverse / ajp://localhost:8009/


This is my virtual host configuration file in /sites-available/



I expected: when creating a file maintenance.enable in var/www/maintenance, all requests are answered with the maintenance.html page.

But sadly, nothing ever happens. Is my DocumentRoot wrong? Is my ProxyPass setting wrong?

10% popularity Vote Up Vote Down


Login to follow query

More posts by @Megan663

0 Comments

Sorted by latest first Latest Oldest Best

Back to top | Use Dark Theme