![]() |
Capistrano Maintenance Page Not Being Displayed
I'm having trouble getting LiteSpeed to properly display the maintenance page that Capistrano creates while performing an update. The 404.html page that is found in my RAILS_ROOT/public directory is always served unless I specifically make a request for /system/maintenance.html.
Here is what I have for Rewrite Rules for my Virtual Host: Code:
RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -fCode:
[REWRITE] Rule: Match '/' with pattern '^.*$', result: 1Does anyone have any ideas what might be going on here? Thanks in advance! -- DeLynn Berry delynn@gmail.com http://delynnberry.com |
That's strange.
Is "File not found" logged after the rewrite log entries in the error.log? You should be able to verify whether that file exists or not. It does looks like that the rewrite rule has been executed properly. If you can get to the maintenance page with "/system/maintenance.html" then you should get that page when you access "/". I think maybe Capistrano replaced the document root during the update, so "/system/maintenance.html" does not exist. However, in the manually crafted test environment, it should work fine. |
Quote:
Code:
[REWRITE] Last Rule, stop!Quote:
Just as an experiment, I renamed the RAILS_ROOT/public/404.html and 500.html files and now I'm getting the following: Code:
Status: 500 Internal Server Error Content-Type: text/html-- DeLynn Berry delynn@gmail.com http://delynnberry.com |
Quote:
Are you using rewrite rule or 404 handler to dispatch request to rails dispatcher? I guess that the rewritten url "/system/maintance.html" has been redirected to Rails dispatcher instead of being served by web server itself. You can turn on debug logging to finit it out. Also, you can try changing the rewrite rule from Code:
RewriteRule ^.*$ /system/maintenance.html [L]Code:
RewriteRule ^.*$ /system/maintenance.html [L,R] |
mistwang, thanks for all your help so far. I may be on to something here on my end though.
I pulled all the Rewrite Rules out of my LiteSpeed Virtual Host configuration, and since I'm still seeing the same results, I'm beginning to think that the problem must have something to do with my setup. I failed to mention last night that I'm proxying all my requests through a Load Balancer to a cluster of Mongrel processes. Might this be the cause of my problem? As an aside question, while looking through the LiteSpeed Wiki this morning, I noticed the article on LSAPI. Since I only just started playing around with LiteSpeed and have been happy with Mongrel, I made note of the article but decided to hold off implementing it. I'm beginning to wonder if ditching Mongrel and going with LSAPI might not be a better solution though. My first question here with regard to LSAPI is, how easy is it to scale LSAPI up from one listener on one box to mulitple listeners on one or more machines? Thanks again for your help and input. -- DeLynn Berry delynn@gmail.com http://delynnberry.com |
Ok, that's more clear now. The request must be forwarded to mongrel, when request get forwarded through proxy, the original request URL is used instead of the written URL.
Using LSAPI will fix this problem for sure. It is better than proxy to mongrel as well. At least for a single machine setup, no need to bother mongrel cluster and load balancing, and performance should be better. To scale beyond one server, I recommend to install LSWS + LSAPI on each cluster node and have a instance of LSWS load balancing to those cluster nodes. This configuration should be faster than a mongrel cluster setup. In the future, we may come up with a better solution to have LSAPI integrated with Capistrano, so the cluster can be easily managed via capistrano. We will release a dedicate load balancer soon if you need more than the stateless load balancer in LSWS. |
Quote:
Quote:
Quote:
Thanks again for the help! -- DeLynn Berry delynn@gmail.com http://delynnberry.com |
Quote:
If LSWS + LSAPI is used on each node, you only need to find a way to let Capistrano run command "lswsctrl restart" to apply the code change, NO DOWNTIME at all during the restart. :cool: |
Quote:
|
Any chance to try it out? Any update?
Thanks! |
| All times are GMT -7. The time now is 01:45 AM. |