# Rails With Apache?!?!?!?!?!

**URL:** <https://www.ruby-forum.com/t/rails-with-apache/48852>\
**Category:** Rails\
**Created:** [November 25, 2005, 5:51pm UTC](https://www.ruby-forum.com/t/rails-with-apache/48852 "2005-11-25T17:51:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nmealey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7cd45c/32.png) [@nmealey](https://www.ruby-forum.com/u/nmealey)\
**Post date:** [November 25, 2005, 5:51pm UTC](https://www.ruby-forum.com/t/rails-with-apache/48852/1 "2005-11-25T17:51:52Z")

</div>

I am at my wits end trying to get Rails running through Apache. After  
digging through countless “how-tos” on the web, I’m stuck.

I’m running Suse 10, Apache 2, and want to be able to enter in my PCs IP  
and a subdirectory and bring up the Rails upp, e.g.  
192.168.10.10/railsapp

But I cannot figure how to do so.

This is my virtualhost declaration:

\<VirtualHost \*:80\>  
ServerName railsapp  
DocumentRoot /home/nathan/rails/railsapp/public  
\<Directory /home/nathan/rails/railsapp/public \>  
Options ExecCGI FollowSymLinks  
AllowOverride all  
Allow from all  
Order allow,deny

Can anyone point me in the right direction for how to accomplish this?

Thanks in advance,

Nathan

Nathan M.

Operations Director

Northeast Region

Pilgrim IT, LLC

NORTHEAST OFFICE

1 Short Street

Northampton, MA 01060

TEL 866.434.4976

FAX 413.587.0572

MIDWEST OFFICE

1815 Brownsboro Road

Louisville, KY 40206

TEL 502.721.7939

FAX 502.721.7940

NOTICE: This email and any attachments are intended only for the  
addressee and may contain information that is confidential and/or  
legally privileged. If you are not the intended recipient or have  
received this email in error, please notify the sender by return email  
or by calling 866-434-4976. You should then delete the message and any  
attachments or copies. If you are not the intended recipient, you are  
prohibited from retaining, distributing, disclosing or using any  
information contained herein.

---

<div class="post-metadata">

**Author:** ![nmealey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7cd45c/32.png) [@nmealey](https://www.ruby-forum.com/u/nmealey)\
**Post date:** [November 25, 2005, 6:08pm UTC](https://www.ruby-forum.com/t/rails-with-apache/48852/2 "2005-11-25T18:08:00Z")

</div>

On Fri, 25 Nov 2005, Nathan M. wrote:

> I’m running Suse 10, Apache 2, and want to be able to enter in my PCs IP  
> and a subdirectory and bring up the Rails upp, e.g.  
> 192.168.10.10/railsapp

What errors do you actually get? What gets logged in the server  
logs when the browser fails to get your app?

> But I cannot figure how to do so.
> 
> This is my virtualhost declaration:
> 
> \<VirtualHost \*:80\>  
> ServerName railsapp

If that is the name of your application should it be a server name  
as well?

> ```
> DocumentRoot /home/nathan/rails/railsapp/public
> <Directory /home/nathan/rails/railsapp/public >
> Options ExecCGI FollowSymLinks
> AllowOverride all
> Allow from all
> Order allow,deny
> </Directory>
> 
> ```

and you have the stuff like:

AddType application/x-httpd-eruby .rhtml  
Action application/x-http-eruby /cgi-bin/eruby

setup as well?

[http://www.rubyonrails.com/rails/show/GettingStartedWithRails](http://www.rubyonrails.com/rails/show/GettingStartedWithRails)

> Can anyone point me in the right direction for how to accomplish this?

# [http://www.rubyonrails.com/rails/show/GettingStartedWithRails](http://www.rubyonrails.com/rails/show/GettingStartedWithRails)

was of help to me as far as I got. I’ve not finished yet.

> Thanks in advance,
> 
> Nathan

```
    Hugh

```

---

<div class="post-metadata">

**Author:** ![nmealey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7cd45c/32.png) [@nmealey](https://www.ruby-forum.com/u/nmealey)\
**Post date:** [November 25, 2005, 6:12pm UTC](https://www.ruby-forum.com/t/rails-with-apache/48852/3 "2005-11-25T18:12:03Z")

</div>

On 25 Nov 2005, at 16:46, Nathan M. wrote:

> ```
> Allow from all
> Order allow,deny
> </Directory>
> 
> ```

And what happens when you point a browser to:  
[http://railsapp/](http://railsapp/)

---

<div class="post-metadata">

**Author:** ![nmealey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7cd45c/32.png) [@nmealey](https://www.ruby-forum.com/u/nmealey)\
**Post date:** [November 26, 2005, 4:01pm UTC](https://www.ruby-forum.com/t/rails-with-apache/48852/4 "2005-11-26T16:01:56Z")

</div>

Nathan M. wrote:

> I am at my wits end trying to get Rails running through Apache. After  
> digging through countless ?how-tos? on the web, I?m stuck.
> 
> I?m running Suse 10, Apache 2, and want to be able to enter in my PCs IP  
> and a subdirectory and bring up the Rails upp, e.g. 192.168.10.10/railsapp
> 
> But I cannot figure how to do so.

What you are looking for is advice on how to run multiple Rails apps on  
the same server, without using virtual hosts. I haven’t tried it yet,  
but Scott L.'s advice here looks promising:

> **[Apache tuning for Rails and FastCGI :: scottstuff.net](https://scottstuff.net/blog/articles/2005/07/20/apache-tuning-for-rails-and-fastcgi/index.html)**
>
> There’s a surprisingly small amount of documentation out there on tuning Apache for optimum Rails performance. Almost everyone mentions the first step (use FastCGI, not regular CGI), but that’s such a huge performance boost that it’s really...

He says you should have a FastCgiServer line for each application.

See comments 2 and 8 on the article, and Scott’s responses.

Example (from comment 2)

FastCgiServer /rails\_app\_1/dispatch.fcgi   
-idle-timeout 120   
-initial-env RAILS\_ENV=production   
-processes 10

FastCgiServer /rails\_app\_2/dispatch.fcgi   
-idle-timeout 120   
-initial-env RAILS\_ENV=production   
-processes 10

(note that the numbers of statically allocated processes here are high -  
Scott says 2 should be fine unless you are dealing with heavy traffic)

Please tell us if that works for you.

regards

```
Justin

```
