I’m running Ubuntu edgy linux, apache2, php5, and ruby 1.8.4
I’ve been able to get apache2 to run php scripts easily but am having
problems getting ruby to do so. I’ve read references to eruby,
libapache2-mod-ruby, fastcgi etc, etc. So, I’m not sure what I really
need. I did install Ubuntu’s libapache2-mod-ruby and I now see
I also found a /usr/lib/apache2/modules/mod_ruby.so.
I’ve tried many variations in the site .conf file in
/etc/apache2/sites-available/www.site.local. What I currently have in
this file is:
ServerAdmin [email protected]
AddHandler cgi-script .rb
ScriptAlias /cgi-bin/ /var/www/site/
CustomLog /var/www/site/logs/access.log combined
Since php is working here is what I have added to
AddType application/x-httpd-php .php
AddType application/x-httpd-php .html
I’m only trying to get apache2 to run ruby programs (.rb files) like it
does .php files. Can someone tell me what is needed to make this work?
When I try to run a test.rb file I’m getting this in the error.log file:
[Fri Dec 08 13:52:30 2006] [error] [client 127.0.0.1] (2)\xd9\x05i\xb7:
[Fri Dec 08 13:52:30 2006] [error] [client 127.0.0.1] Premature end of
script headers: test.rb
and the browser shows:
Internal Server Error
The server encountered an internal error or misconfiguration and was
complete your request.
Please contact the server administrator, [email protected] and inform
of the time the error occurred, and anything you might have done that
caused the error.
More information about this error may be available in the server error
test.rb just contains this:
print “Content-type: text/html\r\n\r\n”
print “Hello World!\r\n”