Home >Operation and Maintenance >Apache >Does Apache support Ruby programs?
Running ruby files on Apache requires mod_ruby to be enabled. Apache can also handle ruby files via FastCGI. Multiple versions of ruby can be used with the help of mod_fcgid i.e. FastCGI.
You can also install apache passenger and configure Apache to use it to serve ruby pages. (Recommended Learning: Getting Started with Apache)
(Phusion Passenger also known as "Passenger" is a free web server module designed to integrate with Apache and Nginx)
The steps to install mod_ruby on the server are as follows
cd /tmp wget http://www.modruby.net/archive/mod_ruby-1.2.6.tar.gz tar zxvf mod_ruby-1.2.6.tar.gz cd mod_ruby-1.2.6/ ./configure.rb --with-apr-includes=/usr/include/apr-1 make make install
How to run Ruby using Apache?
You need to add the mod_ruby module to the Apache configuration, i.e. /etc/httpd/conf.d/ruby.conf and add the following lines.
LoadModule ruby_module modules /mod_ruby.so
If you want to enable or disable these modules, you must edit the apache configuration file and comment or uncomment these modules (if the web server has been compiled with these modules).
The above is the detailed content of Does Apache support Ruby programs?. For more information, please follow other related articles on the PHP Chinese website!