# A Little Win32 Apache2/SCGI Help?

**URL:** <https://www.ruby-forum.com/t/a-little-win32-apache2-scgi-help/49092>\
**Category:** Rails\
**Created:** [November 29, 2005, 6:59pm UTC](https://www.ruby-forum.com/t/a-little-win32-apache2-scgi-help/49092 "2005-11-29T18:59:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e19b73/32.png) [@jeff](https://www.ruby-forum.com/u/jeff)\
**Post date:** [November 29, 2005, 6:59pm UTC](https://www.ruby-forum.com/t/a-little-win32-apache2-scgi-help/49092/1 "2005-11-29T18:59:24Z")

</div>

Hey all,

Sorry to spam a personal help message, but I’m tearing my hair out here.

I’ve previously done all my development with webbrick and deployed on  
TextDrive where all the hard work was pretty much done for me. Today,  
however, I need to deploy on one of our servers.

I’ve got Apache2 and SCGI installed, finally, and the app is running.  
It correctly serves up content from the controllers. The problem is  
that requests for the static files (/images/_, /stylesheets/_, etc)  
aren’t working. If I try to go to [http://127.0.0.1/stylesheets/](http://127.0.0.1/stylesheets/) I get  
the following:

Routing Error  
Recognition failed for “/stylesheets/”

Again, this works fine under webbrick, so I would think it is an Apache  
config problem. However, the error message itself looks like its coming  
from the Rails router, implying a problem with my routes config. Is  
there something I need to tell SCGI, Rails, or Apache to help find my  
public folder? (I set the document root in the Apache http.conf)

Any advice? I appreciate it.

-Jeff

---

<div class="post-metadata">

**Author:** ![jeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e19b73/32.png) [@jeff](https://www.ruby-forum.com/u/jeff)\
**Post date:** [November 29, 2005, 8:48pm UTC](https://www.ruby-forum.com/t/a-little-win32-apache2-scgi-help/49092/2 "2005-11-29T20:48:39Z")

</div>

Is the document root for the web application in the Apache config, the  
public folder under your app directory?

John

---

<div class="post-metadata">

**Author:** ![jeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e19b73/32.png) [@jeff](https://www.ruby-forum.com/u/jeff)\
**Post date:** [November 29, 2005, 10:54pm UTC](https://www.ruby-forum.com/t/a-little-win32-apache2-scgi-help/49092/3 "2005-11-29T22:54:20Z")

</div>

Jeff,

I’m not familiar with scgi yet but i solved it as follows. My railsapp  
‘root’  
is one level higher then my apache docroot and have symlinks as shown  
below:

depot → …/depot/public/  
images → …/depot/public/images/  
index.html  
robots.txt  
stylesheets → …/depot/public/stylesheets/

This results in urls looking like: [http://www.example.com/depot/store](http://www.example.com/depot/store)

In the apache2 conf you add the “FollowSymLinks” as shown here.

DocumentRoot /home/…/htdocs

```
    <Directory /home/.../htdocs>
            Options ExecCGI FollowSymLinks
            AllowOverride All
            Allow from all
            Order allow,deny
    </Directory>

```

There can be a security ‘issue’, when people have shell access to your  
system.  
(I’m running vhosts in a chrooted env). If so, they can create symlinks  
to  
anywhere om your system, and are able access it. If not, there’s no  
hazard.

Setting the config specs for scgi should do the trick. My next challenge  
is  
setting up scgi (thanx for the tip … :-).

Regards,

Gerard.

On Tuesday 29 November 2005 18:58, Jeff C. tried to type something  
like:

> that requests for the static files (/images/_, /stylesheets/_, etc)  
> public folder? (I set the document root in the Apache http.conf)
> 
> Any advice? I appreciate it.
> 
> -Jeff
> 
> * * *
> 
> Rails mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

–  
“Who cares if it doesn’t do anything? It was made with our new  
Triple-Iso-Bifurcated-Krypton-Gate-MOS process …”

My $Grtz =~ Gerard;  
~  
:wq!

---

<div class="post-metadata">

**Author:** ![jeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e19b73/32.png) [@jeff](https://www.ruby-forum.com/u/jeff)\
**Post date:** [November 29, 2005, 7:39pm UTC](https://www.ruby-forum.com/t/a-little-win32-apache2-scgi-help/49092/4 "2005-11-29T19:39:53Z")

</div>

On 11/29/05, Jeff C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> It correctly serves up content from the controllers. The problem is  
> there something I need to tell SCGI, Rails, or Apache to help find my  
> public folder? (I set the document root in the Apache http.conf)
> 
> Any advice? I appreciate it.

You need to add some directives to to Apache’s httpd.conf file to tell  
it  
not to send requests for static files through SCGI, but to serve those  
up  
directly. The exact specification depends on your application. Instant  
Rails  
has a page describing how to do this for Typo (you can probably adapt  
this  
for your own use):

[http://instantrails.rubyforge.org/wiki/wiki.pl?Installing\_Typo](http://instantrails.rubyforge.org/wiki/wiki.pl?Installing_Typo)

Curt
