# ROR - Apache - FastCGI / Can't see stylesheets or javascript

**URL:** <https://www.ruby-forum.com/t/ror-apache-fastcgi-cant-see-stylesheets-or-javascript/99304>\
**Category:** Rails\
**Created:** [July 21, 2006, 4:40pm UTC](https://www.ruby-forum.com/t/ror-apache-fastcgi-cant-see-stylesheets-or-javascript/99304 "2006-07-21T16:40:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![DCDCDC](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ebca7d/32.png) [@DCDCDC](https://www.ruby-forum.com/u/DCDCDC)\
**Post date:** [July 21, 2006, 4:40pm UTC](https://www.ruby-forum.com/t/ror-apache-fastcgi-cant-see-stylesheets-or-javascript/99304/1 "2006-07-21T16:40:24Z")

</div>

Folks …

I have been porting my app from dev environment on Webrick to Apache  
with FastCGI. I have the app responding and pulling up the data, but it  
is ignoring the “images”, “stylesheets”, “javascripts” directories  
located in the public directory.

I’m running Apache under Suse Linux 9.x. Here is the information that I  
have in my vhosts.conf file:

# 

# VirtualHost template:

# Almost any Apache directive may go into a VirtualHost container.

# The first VirtualHost section is used for requests without a known

# server name.

# 

\<VirtualHost \*:80\>

```
   ServerAdmin removed_email_address@domain.invalid
   ServerName www.spro.com
   ServerSignature On

   DocumentRoot /srv/www/vhosts/www.spro.com/public/

   ErrorLog /log/www.spro.com-error_log
   CustomLog /log/www.spro-access_log combined

   HostnameLookups Off
   UseCanonicalName Off

   <IfModule mod_fastcgi.c>
   FastCgiServer \
    /srv/www/vhosts/www.spro.com/public/dispatch.fcgi \
    -initial-env RAILS_ENV=development -processes 10 \
    -idle-timeout 120
   </IfModule>

   <IfModule mod_userdir.c>
   UserDir public_html
       Include /etc/apache2/mod_userdir.conf
   </IfModule>

   <Directory /srv/www/vhosts/www.spro.com/public/>
   Options ExecCGI FollowSymLinks
       AddHandler fastcgi-script .fcgi
       AllowOverride All
       Order allow,deny
       Allow from all
   </Directory>

```

This is my first attempt at bringing a RoR application up under Apache2  
utilizing FastCGI. It is my understanding that giving the full path  
name in both DocumentRoot and Directory definitions should allow RoR to  
find the stylesheets. If I load up Webrick instead of Apache, the  
system works perfectly - I just need to figure this out.

Thanks in advance …

DC

---

<div class="post-metadata">

**Author:** ![DCDCDC](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ebca7d/32.png) [@DCDCDC](https://www.ruby-forum.com/u/DCDCDC)\
**Post date:** [July 21, 2006, 4:50pm UTC](https://www.ruby-forum.com/t/ror-apache-fastcgi-cant-see-stylesheets-or-javascript/99304/2 "2006-07-21T16:50:33Z")

</div>

DC wrote:

> Folks …
> 
> I have been porting my app from dev environment on Webrick to Apache  
> with FastCGI. I have the app responding and pulling up the data, but it  
> is ignoring the “images”, “stylesheets”, “javascripts” directories  
> located in the public directory.

Could it be as simple as permissions ? Is www-data (or whoever Apache  
runs as) allowed to read from that dir and subdirs ?

A.

---

<div class="post-metadata">

**Author:** ![DCDCDC](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ebca7d/32.png) [@DCDCDC](https://www.ruby-forum.com/u/DCDCDC)\
**Post date:** [July 21, 2006, 4:55pm UTC](https://www.ruby-forum.com/t/ror-apache-fastcgi-cant-see-stylesheets-or-javascript/99304/3 "2006-07-21T16:55:30Z")

</div>

Alan F. wrote:

> Could it be as simple as permissions ? Is www-data (or whoever Apache  
> runs as) allowed to read from that dir and subdirs ?
> 
> A.

Alan …

All directories from Public on down have the same permissions “WWWRUN”  
as user and “WWW” as group.

DC

---

<div class="post-metadata">

**Author:** ![DCDCDC](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ebca7d/32.png) [@DCDCDC](https://www.ruby-forum.com/u/DCDCDC)\
**Post date:** [July 22, 2006, 3:54pm UTC](https://www.ruby-forum.com/t/ror-apache-fastcgi-cant-see-stylesheets-or-javascript/99304/4 "2006-07-22T15:54:00Z")

</div>

Are you relying on the .htaccess file generated by rails? If so, you  
need to ensure that  
\<Directory /path/to/public\>  
AllowOverride FileInfo  
Options FollowSymlinks

… is set in httpd.conf (or whatever your distro calls that file).

And always remember the apache error log.
