# Rails on Apache

**URL:** <https://www.ruby-forum.com/t/rails-on-apache/161224>\
**Category:** Rails\
**Created:** [February 24, 2009, 1:26pm UTC](https://www.ruby-forum.com/t/rails-on-apache/161224 "2009-02-24T13:26:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![angaps](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/77aa72/32.png) [@angaps](https://www.ruby-forum.com/u/angaps)\
**Post date:** [February 24, 2009, 1:26pm UTC](https://www.ruby-forum.com/t/rails-on-apache/161224/1 "2009-02-24T13:26:22Z")

</div>

Hai

I want to run my rails application in the apache server, the steps i  
followed are:

Here we ll go for deploying rails with apache.

1. Install Ruby and Rails.

2. Install Apache HTTP Server.  
Win32 Binary without crypto (no mod\_ssl) (MSI Installer):  
apache\_2.2.11-win32-x86-no\_ssl.msi [PGP] [MD5]

3. Get FastCGI2.4.6

4. Download RubyForApache

5. Install MySQL

6. Rename mod\_fastcgi-2.4.6-AP22.dll to mod\_fastcgi.dll and copy it to  
the Apache modules folder (default is c:\programs files\Apache  
Group\Apache2\modules).

7. Install Ruby For Apache for all options. It will give error, but just  
ignore and continue.

8. Copy fcgi.so and mysql.so from  
/RubyForApache/lib/ruby/site\_ruby/1.8/i386-msvcrt to Apache modules  
folder (default is c:\programs files\Apache Group\Apache2\modules).

Apache Configuraration,

Edit the Apache httpd.conf Configuration File,

Check for

#LoadModule rewrite\_module modules/mod\_rewrite.so

and change it to

LoadModule rewrite\_module modules/mod\_rewrite.so

Then add following line,

LoadModule fastcgi\_module modules/mod\_fastcgi.dll

Now at the bottom of this file, add following,

\<VirtualHost \*:4000\>  
ServerName rails  
DocumentRoot â€œC:/testing/publicâ€  
\<Directory â€œC:/testing/public/â€\>  
Options ExecCGI FollowSymLinks  
AllowOverride all  
Allow from all  
Order allow,deny  
AddHandler cgi-script .cgi  
AddHandler fastcgi-script .fcgi

(set paths according to your application)

Configure your Rails application,

1. Go to the public folder in your Rails application and open .htaccess

2. Look for line like RewriteRule ^(.\*)$ dispatch.cgi [QSA,L]

Change it to RewriteRule ^(.\*)$ dispatch.fcgi [QSA,L]

1. Now restart your Apache.

2. Access [http://localhost:4000](http://localhost:4000)

It will show Welcome page (index.html) of Rails.

I am facing some issues in the configuring rails apps, i cant get  
.htaccess file, i got one .htaccess file in net and i put it and try  
with apache. but apache is not started.

iam using apache

Win32 Binary without crypto (no mod\_ssl) (MSI Installer):  
apache\_2.2.11-win32-x86-no\_ssl.msi [PGP] [MD5]

And i tried with

Win32 Source: httpd-2.2.11-win32-src.zip [PGP] [MD5]

HOW TO RUN MY APPLICATION IN APACHE. KINDLY GUIDE ME HERE.

I followed the setup from the link

thanks

Angappan

---

<div class="post-metadata">

**Author:** ![angaps](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/77aa72/32.png) [@angaps](https://www.ruby-forum.com/u/angaps)\
**Post date:** [February 24, 2009, 1:27pm UTC](https://www.ruby-forum.com/t/rails-on-apache/161224/2 "2009-02-24T13:27:18Z")

</div>

> **[Deploying Rails application with Apache on Windows XP](https://firstruby.wordpress.com/2007/03/21/deploying-rails-with-apache-on-windows-xp/)**
>
> We can run rails application with default WEBrick server, lighttpd, mongrel, apache. Here we ll go for deploying rails with apache. 1. Install Ruby and Rails. 2. Install Apache HTTP Server. 3. Get …

---

<div class="post-metadata">

**Author:** ![angaps](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/77aa72/32.png) [@angaps](https://www.ruby-forum.com/u/angaps)\
**Post date:** [February 24, 2009, 2:08pm UTC](https://www.ruby-forum.com/t/rails-on-apache/161224/3 "2009-02-24T14:08:48Z")

</div>

Angappan Ayyavoo wrote:

> [Deploying Rails application with Apache on Windows XP « firstruby](http://firstruby.wordpress.com/2007/03/21/deploying-rails-with-apache-on-windows-xp/)

Hi.  
Why don’t you try deploying your application using phusion  
passenger(mod-rails)???  
It uses apache server and is very easy to use…  
The only catch is that it is not available for windows…

You can find installation steps at…  
[http://www.modrails.com/install.html](http://www.modrails.com/install.html)

---

<div class="post-metadata">

**Author:** ![angaps](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/77aa72/32.png) [@angaps](https://www.ruby-forum.com/u/angaps)\
**Post date:** [February 24, 2009, 7:18pm UTC](https://www.ruby-forum.com/t/rails-on-apache/161224/4 "2009-02-24T19:18:02Z")

</div>

Instead of fastcgi, you might want to look into using mongrel (http://  
[mongrel.rubyforge.org](http://mongrel.rubyforge.org)) instead:

[http://mongrel.rubyforge.org/wiki/Apache](http://mongrel.rubyforge.org/wiki/Apache)

Jeff

On Feb 24, 4:27 am, Angappan Ayyavoo \<rails-mailing-l…@andreas-
