Problem
I cannot seem to be able to add the cgi-script handler for ruby scripts (.rb).
I can run perl, python, and ruby scripts using the .cgi extension.
I can run perl (.pl) and python (.py) scripts without adding any handlers.
Interestingly, I can run perl scripts using any file extension without adding any handlers.
I cannot run python or ruby scripts using any other extensions, even if I add handlers.
Handler Examples
I've tried adding it to the cPanel / Apache Handlers:
handler: cgi-script
extensions: .rb
I've also tried adding it to the .htaccess file:
http://alexanderhawley.com/cgi-bin/.htaccess
AddHandler cgi-script .rb
Perl Examples
Perl works with extensions .cgi, .pl.
No additional handlers needed.
http://alexanderhawley.com/cgi-bin/testperl.cgi
#!/usr/bin/perl -w
print "Content-type: text/html\n\n";
print "perl";
http://alexanderhawley.com/cgi-bin/testperl.pl
#!/usr/bin/perl -w
print "Content-type: text/html\n\n";
print "perl";
Python Examples
Python works with extensions .cgi, .py.
No additional handlers needed.
http://alexanderhawley.com/cgi-bin/testpython.cgi
#!/usr/bin/python
print "Content-Type: text/plain\n\n"
print "python"
http://alexanderhawley.com/cgi-bin/testpython.py
#!/usr/bin/python
print "Content-Type: text/plain\n\n"
print "python"
Ruby Examples
Ruby only works with .cgi extension.
Ruby does not work with .rb extension.
http://alexanderhawley.com/cgi-bin/testruby.cgi
#!/usr/bin/ruby
print "Content-type: text/html\n\n"
print "ruby"
http://alexanderhawley.com/cgi-bin/testruby.rb
#!/usr/bin/ruby
print "Content-type: text/html\n\n"
print "ruby"
Thoughts?
Thanks.
-AH