How To Install mod_ruby On Various Linux Distributions For Use With ISPConfig (2.2.20 And Above)
|
Submitted by falko (Contact Author) (Forums) on Tue, 2008-02-12 16:30. :: CentOS | Debian | Fedora | ISPConfig | Linux | Mandriva | SuSE | Ubuntu | Apache | Control Panels
How To Install mod_ruby On Various Linux Distributions For Use With ISPConfig (2.2.20 And Above)Version 1.0 Starting with version 2.2.20, ISPConfig has built-in support for Ruby. Instead of using CGI/FastCGI, ISPConfig depends on mod_ruby being available in the server's Apache. This article explains how to install mod_ruby on various distributions supported by ISPConfig. I do not issue any guarantee that this will work for you!
1 Debian Etch / Ubuntu 7.10On Debian Etch and Ubuntu 7.10, all we have to do is run (as root): apt-get install libapache2-mod-ruby No configuration is needed at all.
2 Fedora 8 / CentOS 5.1For Fedora 8 and CentOS 5.1, there's no mod_ruby package available, so we must compile it ourselves. First we install some prerequisites: yum install httpd-devel ruby ruby-devel Next we download and install mod_ruby as follows: cd /tmp Finally we must add the mod_ruby module to the Apache configuration, so we create the file /etc/httpd/conf.d/ruby.conf... vi /etc/httpd/conf.d/ruby.conf
... and restart Apache: /etc/init.d/httpd restart
3 Mandriva 2008.0Mandriva 2008.0 has a mod_ruby package that we can install as follows: urpmi apache-mod_ruby That package comes with a mod_ruby configuration that enables mod_ruby globally for all web sites. Therefore we have to disable it now so that it can be enabled in ISPConfig on a per-website basis: vi /etc/httpd/modules.d/20_mod_ruby.conf Comment out or delete everything in that file except the following lines:
Then restart Apache: /etc/init.d/httpd restart
4 OpenSUSE 10.3OpenSUSE 10.3 doesn't have a mod_ruby package, therefore we must compile it manually. First we install the prerequisites: yast -i apache2-devel ruby ruby-devel Afterwards we build mod_ruby as follows: cd /tmp To enable mod_ruby, we open /etc/sysconfig/apache2 and add ruby to the APACHE_MODULES line, e.g. like this: vi /etc/sysconfig/apache2
Afterwards we run SuSEconfig and restart Apache: /etc/init.d/apache2 restart
5 Using mod_rubyNow let's assume you have created a web site in ISPConfig with the document root /var/www/web1/web. If you enable Ruby for that web site, ISPConfig adds something like this to the web site's Apache vhost configuration:
(If you don't use ISPConfig, then of course, you can add this manually to your vhost configuration, but don't forget to adjust the paths and restart Apache afterwards.) To see if mod_ruby is working, we create the Ruby file /var/www/web1/web/hello_world.rb: vi /var/www/web1/web/hello_world.rb
The file must be executable, so we run: chmod 755 /var/www/web1/web/hello_world.rb Now you can call the file in a browser; if everything goes well, it should display a Hello World! message.
6 Links
|



Recent comments
1 day 7 hours ago
1 day 9 hours ago
1 day 21 hours ago
2 days 2 min ago
2 days 4 hours ago
2 days 10 hours ago
2 days 19 hours ago
2 days 21 hours ago
3 days 5 hours ago
3 days 7 hours ago