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

put on hold as unclear what you're asking by Stephen Ostermiller Nov 21 at 11:49

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the 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