Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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?

share|improve this question
Did you create /var/www/maintenance/maintenance.html and can you access it directly at http://example.com/maintenance.html? –  Stephen Ostermiller Jun 21 at 10:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.