Quickstart python, mod_ruby & mod_perl on debian
Package installs
You need the ruby-dev package or you’ll get an error later when using gem require’: no such file to load – mkmf
- aptitude install apache2-dev
- aptitude install ruby1.8 ruby1.8-dev eruby
- aptitude install python2.4-pygresql
- aptitude install libapache2-mod-perl2
- aptitude install libapache2-mod-ruby
- perl -MCPAN -e “install Bundle::Apache2”
- perl -MCPAN -e “install Apache::Template”
- export POSTGRES_INCLUDE=...
- export POSTGRES_LIB=...
- tar zxf rubygems-0.9.0.tgz; ruby setup.rb;
- export RUBYOPT=rubygems
- gem install activerecord
- gem install postgres
Note that “gem install postgres” did not seem to work. I had to manually
cd /usr/lib/ruby/gems/1.8/gems/postgres-0.7.1/
ruby extconf.rb -with-pgsql-include-dir=X -with-pgsql-lib-dir=Y
make; make install
Apache setup
In mime.types
text/x-ruby rb rbx
In httpd.conf:
AddType text/html .rbx
RubyRequire apache/ruby-run
<Files *.rbx>
SetHandler ruby-object
RubyHandler Apache::RubyRun.instance
</Files>
RubyRequire apache/eruby-run
<Files *.rhtml>
SetHandler ruby-object
RubyHandler Apache::ERubyRun.instance
</Files>
PerlRequire /www/docs/startup.pl
PerlModule ModPerl::Registry
<Location ~ ".pl$">
SetHandler perl-script
PerlResponseHandler ModPerl::Registry
PerlOptions +ParseHeaders
</Location>