# RoR on Apache not working

**URL:** <https://www.ruby-forum.com/t/ror-on-apache-not-working/62290>\
**Category:** Rails\
**Created:** [June 2, 2006, 10:01am UTC](https://www.ruby-forum.com/t/ror-on-apache-not-working/62290 "2006-06-02T10:01:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cristian\_Baltatescu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ea666f/32.png) [@Cristian\_Baltatescu](https://www.ruby-forum.com/u/Cristian_Baltatescu)\
**Post date:** [June 2, 2006, 10:01am UTC](https://www.ruby-forum.com/t/ror-on-apache-not-working/62290/1 "2006-06-02T10:01:28Z")

</div>

Hi  
I’m a RoR newbie, in fact i’ve been using it for less than 24 hours, but  
I’m not an internet/pc/apache/developement newbie so I expected this to  
go much easier 🙂  
Ok, here it goes. I’ve been trying to get RoR working with apache both  
on a RH server and after i didn;t managed there I tried on my machine,  
an windows XP/Apache2 machine.  
I don’t like running it from localhost, i want my app accessible from  
the web and also i hate software that runs in command prompts that i  
have to keep opened (WeBrick)  
So, i followed many sets of explanations on how to do this, last one  
beeing  
[http://wiki.rubyonrails.org/rails/pages/Fast+CGI+and+Apache2+for+Windows+without+VirtualHosts](http://wiki.rubyonrails.org/rails/pages/Fast+CGI+and+Apache2+for+Windows+without+VirtualHosts)  
It doesn’t work.  
When i try to run the app in the browser it sais (this after beeing  
incredibly slow to process my request):  
Application error  
Rails application failed to start properly

The error log in apache sais:  
[Fri Jun 02 10:54:38 2006] [warn] FastCGI: server  
“D:/work/#htdocs/ruby/clients/public/dispatch.fcgi” (pid 5108)  
terminated with exit with status ‘1’  
[Fri Jun 02 10:54:38 2006] [warn] FastCGI: server  
“D:/work/#htdocs/ruby/clients/public/dispatch.fcgi” restarted (pid 5116)  
[Fri Jun 02 10:54:42 2006] [warn] FastCGI: server  
“D:/work/#htdocs/ruby/clients/public/dispatch.fcgi” (pid 5116)  
terminated with exit with status ‘1’  
[Fri Jun 02 10:54:43 2006] [warn] FastCGI: server  
“D:/work/#htdocs/ruby/clients/public/dispatch.fcgi” restarted (pid 5124)  
[Fri Jun 02 10:54:47 2006] [warn] FastCGI: server  
“D:/work/#htdocs/ruby/clients/public/dispatch.fcgi” (pid 5124)  
terminated with exit with status ‘1’  
[Fri Jun 02 10:54:47 2006] [warn] FastCGI: server  
“D:/work/#htdocs/ruby/clients/public/dispatch.fcgi” has failed to remain  
running for 30 seconds given 3 attempts, its restart interval has been  
backed off to 600 seconds

Actually the first 2 lines are from when apache starts.

The settings i’ve added in httpd.conf are:  
Alias /clients “D:/work/#htdocs/ruby/clients/public”

\<Directory “D:/work/#htdocs/ruby/clients/public”\>  
AddHandler fastcgi-script .fcgi  
Options +ExecCGI  
AllowOverride all  
Allow from all  
Order allow,deny

FastCgiServer D:/work/#htdocs/ruby/clients/public/dispatch.fcgi  
-processes 1

And public/.htaccess

AddHandler cgi-script .cgi  
Options +FollowSymLinks +ExecCGI

RewriteRule ^$ index.html [QSA]  
RewriteRule ^([^.]+)$ $1.html [QSA]  
RewriteCond %{REQUEST\_FILENAME} !-f  
RewriteRule ^(.\*)$ dispatch.fcgi [QSA,L]

Sorry for the long message,i just thought of giving the whole info  
before asking for help, so that you guys can identify any stupid mistake  
i might have made.  
Also, i’ve tried first without fastcgi, that didn;t work too, the error  
i saw in browser was:  
Routing Error

Recognition failed for “”

All this errors i’m getting when I try to access parts of my app that  
work ok on webrick on port 3000.  
Ok, thanks for your patience and i hope i can get ruby to work on apache  
🙂

bye

---

<div class="post-metadata">

**Author:** ![Cristian\_Baltatescu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ea666f/32.png) [@Cristian\_Baltatescu](https://www.ruby-forum.com/u/Cristian_Baltatescu)\
**Post date:** [June 2, 2006, 1:15pm UTC](https://www.ruby-forum.com/t/ror-on-apache-not-working/62290/2 "2006-06-02T13:15:42Z")

</div>

I found that I had similar problems when my .htaccess duplicated stuff  
in my httpd.conf.

---

<div class="post-metadata">

**Author:** ![Cristian\_Baltatescu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ea666f/32.png) [@Cristian\_Baltatescu](https://www.ruby-forum.com/u/Cristian_Baltatescu)\
**Post date:** [June 2, 2006, 10:35pm UTC](https://www.ruby-forum.com/t/ror-on-apache-not-working/62290/3 "2006-06-02T22:35:22Z")

</div>

Have a go with my Rails Prod Win setup kit, it does exactly what you  
want to do:

> **[Rails Prod Machine for Win32](https://sourceforge.net/projects/rails-prod-win/)**
>
> Download Rails Prod Machine for Win32 for free. Set of software/tools/libraries pre-compiled for Microsoft Windows platforms (WinXP,Win2000,Server2003), to allow easy deployement of a Ruby on Rails production machine. Includes Apache web server,...

It installs, Ruby + Rails + Apache and FCGI pre-setup for you.

You want to remove anything you have installed before installing this  
though. Just keep the rails application, not rails itself but your  
application.

hope this help

Gael

---

<div class="post-metadata">

**Author:** ![Cristian\_Baltatescu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ea666f/32.png) [@Cristian\_Baltatescu](https://www.ruby-forum.com/u/Cristian_Baltatescu)\
**Post date:** [June 3, 2006, 1:15am UTC](https://www.ruby-forum.com/t/ror-on-apache-not-working/62290/4 "2006-06-03T01:15:21Z")

</div>

Kfir L. wrote:

> Hi,  
> Edit the files:  
> D:/work/#htdocs/ruby/clients/public/dispatch\*
> 
> Check that first line of each file points to ruby as a windows path.  
> e.g: #!D:\ruby\bin\ruby
> 
> kfir

Erm… no  
Ruby is installed on C, in C:\Ruby, Apache is also on C. Only htdocs is  
on D because i’ve learnt not to keep anything valuable on the system  
partition, in windows, this way i only loose 1 hour to wipe C and  
reinstall.

I guess i’ll take on that advice to install the package that comes with  
apache.  
Thanks for all the answers.

---

<div class="post-metadata">

**Author:** ![Cristian\_Baltatescu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ea666f/32.png) [@Cristian\_Baltatescu](https://www.ruby-forum.com/u/Cristian_Baltatescu)\
**Post date:** [June 2, 2006, 10:54pm UTC](https://www.ruby-forum.com/t/ror-on-apache-not-working/62290/5 "2006-06-02T22:54:09Z")

</div>

Hi,  
Edit the files:  
D:/work/#htdocs/ruby/clients/public/dispatch\*

Check that first line of each file points to ruby as a windows path.  
e.g: #!D:\ruby\bin\ruby

kfir
