Ubuntu 13.04
Sponsored Link

Install Ruby
2013/05/11
 
Install Ruby and make it executable as a CGI.
[1] Install Ruby
root@www:~#
aptitude -y install ruby1.9.3
root@www:~#
vi /etc/apache2/mods-enabled/mime.conf
# line 219: add extension for ruby script

AddHandler cgi-script .cgi .pl
.rb
root@www:~#
/etc/init.d/apache2 restart

* Restarting web server apache2
... waiting ...done.
[2] Create a test script and make sure if it works.
root@www:~#
vi /var/www/index.rb
#!/usr/bin/ruby

print "Content-type: text/html\n\n"
print "<html>\n<body>\n"
print "<div style=\"width: 100%; font-size: 40px; font-weight: bold; text-align: center;\">\n"
print "Ruby Test Page<br />"
print Time.now.strftime('%Y/%m/%d')
print "\n</div>\n"
print "</body>\n</html>\n" 

root@www:~#
chmod 705 /var/www/index.rb

Matched Content
 
Tweet