Parry Parry - 1 year ago 143
Apache Configuration Question

Deploying Ruby application using EasyPHP

I am new to Ruby and I have dabbled in PHP earlier. I have EasyPHP-DevServer-14.1VC9 installed on my Windows 10 PC and I can easily run PHP applications from the server. I installed Ruby with Rails on my machine few days ago and added the following code to the httpd.conf file of my EasyPHP Apache server

<IfModule dir_module>
DirectoryIndex index.html index.shtml index.wml index.pwml index.php index.php3 index.php4 index.php5 index.cgi index.rb index.erb

ServerName rails
DocumentRoot "C:/Program Files (x86)/EasyPHP-DevServer-14.1VC9/data/localweb/apps"
<Directory "C:/Program Files (x86)/EasyPHP-DevServer-14.1VC9/data/localweb/apps">

Options ExecCGI FollowSymLinks
AllowOverride all
Allow from all
Order allow,deny
AddHandler cgi-script .cgi
AddHandler fastcgi-script .fcgi


But when I start EasyPHP and then go to browser and try to run the index.erb file with following contents (I am trying to test the deployment) - I just see the output literally and the ruby code doesn't get executed. Ruby code gets printed as a string.

Contents of

<!DOCTYPE html>
<meta charset="utf-8">
<title>Expense Management: Home</title>
<h1>Welcome to Expense Management</h1>
Let's run some ruby code: <%= 4+5 %>
Check back later.

The output I get is this:

Welcome to Expense Management

Let's run some ruby code: <%= 4+5 %> Check back later.

Answer Source

Just like PHP, your Ruby code must be interpreted by Ruby interpreter. You should add module like Passenger to your Apache installation, if you want to process Ruby with the same Apache installation. Google it for detailed documentation on how to do it.


Apparently EasyPHP has Ruby module. You need to download and install it for Ruby support.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download