Solaris, Joyent, Apache, and Rails maintenance page issue
My pair and I are using a Joyent slice to host one of our rails web applications. Today, we needed to make some updates on our site and did not want anyone navigating the site during this process. It was time for us to add the widely published maintenance.html lines to our apache.conf file so that capistrano could help us display our maintenance page to our viewers easily.
1 2 3 4 |
# Check for maintenance file and redirect all requests
RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
RewriteRule ^.*$ /system/maintenance.html [L] |
To our surprise after running the following capistrano command and navigating to our site we found a 403 error page instead of our expected maintenance page.
cap deploy:web:disable |
After doing some research we discovered that our Joyent accelerator had a problem with the /system path. We were able to solve this problem by modifying our apache.conf in the following way.
1 2 3 4 |
# Check for maintenance file and redirect all requests
RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
RewriteRule ^.*$ %{DOCUMENT_ROOT}/system/maintenance.html [L] |
This thread gives a good explanation.


Leave a Reply