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.

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

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 “

Application error

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!

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 /server-info>
SetHandler server-info
Order deny,allow
Deny from all
Allow from .engineyard.com
Allow from all

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

ProxyPassReverse / balancer://engineyard/

Options ExecCGI FollowSymLinks

.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”

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”

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]

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