You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by fedora <fe...@ayni.com> on 2011/01/25 14:38:13 UTC

[users@httpd] Making apache ready for ruby ajax responder

Hi listers
Sofar, i found out, that an ajax responder cannot be in the cgi-bin 
directory, because, apparently, apache from this directory expects other 
headers and contents than usual ajax resonders send. That means, 
whenever i try to put an ajax responder into the cgi-bin directory, i 
get a 500 Internal Server Error reply to an ajax request.

Next i found this: When i put a ruby program into any directory of the 
current virtual-web (except into the cgi-bin directory), when i try to 
invoke it from the browser, i get the ruby text as response. That is not 
what i want.

Next i found this: When i put a php program into any directory of the 
current virtual-web (except into the cgi-bin directory) and i invoke it 
from the browser via ajax call, it replies as expected. i want to have 
this behaviour from a ruby script as well.

Next i found this: When i try to add a handler for ruby scripts in any 
directory (except the cgi-bin directory) of the virtual host, like so
<Directory /home/svn/work/test/>
   Action application/x-ruby /usr/bin/ruby
   AddHandler application/x-ruby .rbx
</Directory>
i get the following, when ivoking the ruby program klixe.rbx in this 
directory via ajax call:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /usr/bin/ruby/test/klixe.rbx was not found on this 
server.</p>
<hr>
<address>Apache/2.2.16 (Fedora) Server at dick.dyn.lan Port 80</address>
</body></html>

which is to say, that apache concatenates the relativ URL of the file i 
want to invoke with the handler-path, which certainly does not provide 
the response i want.

Where am i wrong? what do i miss?

Thanx for any helpx

suomix

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Making apache ready for ruby ajax responder

Posted by Eric Covener <co...@gmail.com>.
On Tue, Jan 25, 2011 at 8:38 AM, fedora <fe...@ayni.com> wrote:
> Hi listers
> Sofar, i found out, that an ajax responder cannot be in the cgi-bin
> directory, because, apparently, apache from this directory expects other
> headers and contents than usual ajax resonders send. That means, whenever i
> try to put an ajax responder into the cgi-bin directory, i get a 500
> Internal Server Error reply to an ajax request.
>
> Next i found this: When i put a ruby program into any directory of the
> current virtual-web (except into the cgi-bin directory), when i try to
> invoke it from the browser, i get the ruby text as response. That is not
> what i want.
>
> Next i found this: When i put a php program into any directory of the
> current virtual-web (except into the cgi-bin directory) and i invoke it from
> the browser via ajax call, it replies as expected. i want to have this
> behaviour from a ruby script as well.
>
> Next i found this: When i try to add a handler for ruby scripts in any
> directory (except the cgi-bin directory) of the virtual host, like so
> <Directory /home/svn/work/test/>
>  Action application/x-ruby /usr/bin/ruby
>  AddHandler application/x-ruby .rbx
> </Directory>
> i get the following, when ivoking the ruby program klixe.rbx in this
> directory via ajax call:
>
> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
> <html><head>
> <title>404 Not Found</title>
> </head><body>
> <h1>Not Found</h1>
> <p>The requested URL /usr/bin/ruby/test/klixe.rbx was not found on this
> server.</p>
> <hr>
> <address>Apache/2.2.16 (Fedora) Server at dick.dyn.lan Port 80</address>
> </body></html>
>
> which is to say, that apache concatenates the relativ URL of the file i want
> to invoke with the handler-path, which certainly does not provide the
> response i want.
>
> Where am i wrong? what do i miss?

I don't think Action is going to work any different than CGI with
respect to expecting valid CGI output.

At the very least: Action's second parameter is a URL path to a the
interpreter, not a filesystem path.

-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org