Apache server-status?auto in rails
2006-Jul-24 07:09 UTC
[Rails] Apache server-status?auto in rails
Just want to check the status of Apache monitor. but Apache server-status?auto can not be explained as normal URL in rails. For Http://localhost/server-status?auto, rails always regard server-status as one controller/method. It prompts errot: Recognition failed for "/server-status" Therefore, can not get the status info of Apache monitor. Pls expert help me!!! Thanks in advance. -- Posted via http://www.ruby-forum.com/.
You need to configure Apache to serve it''s own status. This requires that Apache not pass the request to Rails. You likely need something like this in your http.conf: <Location /server-status> SetHandler server-status Order deny,allow Deny from all Allow from .engineyard.com Allow from all </Location> <Location /server-info> SetHandler server-info Order deny,allow Deny from all Allow from .engineyard.com Allow from all </Location> RewriteEngine On RewriteLog logs/rewrite_log RewriteLogLevel 0! RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} -f RewriteRule . - [last] RewriteCond %{REQUEST_URI} ^/(server-info|server-status) RewriteRule . - [last] RewriteRule ^/(.*)$ balancer://engineyard/$1 [proxy] <Proxy balancer://engineyard> BalancerMember http://rails1161.engineyard.com:7000 BalancerMember http://rails1162.engineyard.com:7000 </Proxy> ProxyPassReverse / balancer://engineyard/ On Jul 24, 2006, at 12:09 AM, Apache server-status?auto in rails wrote:> Just want to check the status of Apache monitor. but Apache > server-status?auto can not be explained as normal URL in rails. > > For Http://localhost/server-status?auto, rails always regard > server-status as one controller/method. It prompts errot: Recognition > failed for "/server-status" > > Therefore, can not get the status info of Apache monitor. Pls expert > help me!!! Thanks in advance. > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails
I have set <Location /server-status> and <Location /server-infor> in http.conf. Below is VirtualHost configuration in http.conf. <VirtualHost *:80> ServerName localhost DocumentRoot "C:\rails\rails\calendar_cvs\iease_new\0507 \iease\public" ErrorLog "C:\rails\rails\calendar_cvs\iease_new\0507 \iease\log\server.log" <Directory "C:\rails\rails\calendar_cvs\iease_new\0507\iease\public"> Options ExecCGI FollowSymLinks AllowOverride all Allow from all Order allow,deny AddHandler cgi-script .cgi AddHandler fastcgi-script .fcgi </Directory> </VirtualHost> And here is .htaccess file under rails public folder. RewriteRule ^$ index.html [QSA] RewriteRule ^([^.]+)$ $1.html [QSA] RewriteCond %{REQUEST_FILENAME} !-f #RewriteRule ^(.*)$ dispatch.cgi [QSA,L] RewriteRule ^(.*)$ dispatch.fcgi [QSA,L] ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly" But I dont know how and where to set Proxy balancer in http.conf or .htaccess file.....Just tried some way....but still dont work. Pls advise! -- Posted via http://www.ruby-forum.com/.
> I have set <Location /server-status> and <Location /server-infor> in > http.conf. Below is VirtualHost configuration in http.conf. > > <VirtualHost *:80> > ServerName localhost > DocumentRoot "C:\rails\rails\calendar_cvs\iease_new\0507 > \iease\public" > ErrorLog "C:\rails\rails\calendar_cvs\iease_new\0507 > \iease\log\server.log" > <Directory "C:\rails\rails\calendar_cvs\iease_new\0507\iease\public"> > Options ExecCGI FollowSymLinks > AllowOverride all > Allow from all > Order allow,deny > AddHandler cgi-script .cgi > AddHandler fastcgi-script .fcgi > </Directory> > </VirtualHost> > > > And here is .htaccess file under rails public folder. > > RewriteRule ^$ index.html [QSA] > RewriteRule ^([^.]+)$ $1.html [QSA] > RewriteCond %{REQUEST_FILENAME} !-f > #RewriteRule ^(.*)$ dispatch.cgi [QSA,L] > RewriteRule ^(.*)$ dispatch.fcgi [QSA,L] > ErrorDocument 500 "<h2>Application error</h2>Rails application failed to > start properly" > > > But I dont know how and where to set Proxy balancer in http.conf or > .htaccess file.....Just tried some way....but still dont work. Pls > advise!Create an empty file in your document root named ''server-status'' and ''server-info''. Then you''re RewriteCond checking the file''s existence will fail and it will never make it to dispatch.cgi. At that point apache''s status/info handler should kick in. -philip
Yes...I did it refer to the instruction....Create one empty file server-status(only-read) in public folder. But it still does not work. It prompts Routing Error Recognition failed for "/server-status" -- Posted via http://www.ruby-forum.com/.
Maybe I put the empty file into wrong folder. RewriteCond %{REQUEST_FILENAME} !-f REQUEST_FILENAME is seeking which folder? Pls advise! wayne wrote:> Yes...I did it refer to the instruction....Create one empty file > server-status(only-read) in public folder. But it still does not work. > It prompts > > Routing Error > Recognition failed for "/server-status"-- Posted via http://www.ruby-forum.com/.
> Maybe I put the empty file into wrong folder. > RewriteCond %{REQUEST_FILENAME} !-f > > REQUEST_FILENAME is seeking which folder? Pls advise!Try... RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f> > > > > wayne wrote: >> Yes...I did it refer to the instruction....Create one empty file >> server-status(only-read) in public folder. But it still does not work. >> It prompts >> >> Routing Error >> Recognition failed for "/server-status" > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Apache server-status?auto in rails wrote:> Just want to check the status of Apache monitor. but Apache > server-status?auto can not be explained as normal URL in rails. > > For Http://localhost/server-status?auto, rails always regard > server-status as one controller/method. It prompts errot: Recognition > failed for "/server-status" > > Therefore, can not get the status info of Apache monitor. Pls expert > help me!!! Thanks in advance.You need to add this to your Rewrite Rules before you pass to your mongrels RewriteCond %{REQUEST_URI} =/server-status RewriteRule ^.*$ /server-status [L] -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---