# Rails app on Apache2 not finding Style sheets

**URL:** <https://www.ruby-forum.com/t/rails-app-on-apache2-not-finding-style-sheets/69173>\
**Category:** Rails\
**Created:** [September 19, 2006, 5:03am UTC](https://www.ruby-forum.com/t/rails-app-on-apache2-not-finding-style-sheets/69173 "2006-09-19T05:03:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnt519](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cab0a1/32.png) [@johnt519](https://www.ruby-forum.com/u/johnt519)\
**Post date:** [September 19, 2006, 5:03am UTC](https://www.ruby-forum.com/t/rails-app-on-apache2-not-finding-style-sheets/69173/1 "2006-09-19T05:03:53Z")

</div>

I’m trying to set up a rails app (Radiant CMS) on Apache2 (on Ubuntu).  
It sort of works, but I can’t get the right configuration to see the  
right items.

When I try to access the site, I’m seeing an unstyled page, and the  
apache error log shows:

[Mon Sep 18 23:03:08 2006] [error] [client 10.1.1.101] File does not  
exist: /var/www/styles.css, referer: [http://10.1.1.104/radiant/](http://10.1.1.104/radiant/)

I don’t know why it’s trying to find the style sheet in /var/www.

The app is set up in /var/www/radiant and my Apache site config file is:

```
DocumentRoot /var/www/radiant/public/

ErrorLog /var/log/apache2/error.log
Alias /radiant /var/www/radiant/public

<Directory /var/www/radiant/>
  Options ExecCGI FollowSymLinks
  AddHandler cgi-script .cgi
  AddHandler fcgid-script .fcgi
  AllowOverride all
  Order allow,deny
  Allow from all

</Directory>

```

This isn’t the first Rails app I’ve tried to get running under Apache.  
Can someone please post the appropriate voodoo to make it work? (BTW,  
it works fine using script/server)

Thanks,

jt

---

<div class="post-metadata">

**Author:** ![johnt519](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cab0a1/32.png) [@johnt519](https://www.ruby-forum.com/u/johnt519)\
**Post date:** [September 19, 2006, 2:08pm UTC](https://www.ruby-forum.com/t/rails-app-on-apache2-not-finding-style-sheets/69173/2 "2006-09-19T14:08:42Z")

</div>

Ok, maybe I need to ask a more basic question…

What’s the magic that I need to put into the file in  
/etc/apache2/sites-available that will let me access a rails app like:

> **[Someserver.com may be for sale - PerfectDomain.com](https://perfectdomain.com/domain/someserver.com)**
>
> Checkout the full domain details of Someserver.com. Click Buy Now to instantly start the transaction or Make an offer to the seller!

I don’t want a virtual server ([radiant.someserver.com](http://radiant.someserver.com)), but use the  
format above. I was able to get the Radiant main page to show with  
style sheet by changing a line to:

\<Directory /var/www/radiant/public/\>

But when, in this case, I try to click on an article, it’s assuming  
that the app is at the root of the server, so is trying to serve up

> **[Someserver.com may be for sale - PerfectDomain.com](https://perfectdomain.com/domain/someserver.com)**
>
> Checkout the full domain details of Someserver.com. Click Buy Now to instantly start the transaction or Make an offer to the seller!

If I try to go to the Archives link, which should be

[someserver.com/radiant/archives](http://someserver.com/radiant/archives)

it’s trying to go to

[someserver.com/archives](http://someserver.com/archives)

completely ignoring the directory I set up.

Please?? Any hints or pointers? Setting up a Rails app can’t be this  
difficult!

---

<div class="post-metadata">

**Author:** ![johnt519](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cab0a1/32.png) [@johnt519](https://www.ruby-forum.com/u/johnt519)\
**Post date:** [September 19, 2006, 3:16pm UTC](https://www.ruby-forum.com/t/rails-app-on-apache2-not-finding-style-sheets/69173/3 "2006-09-19T15:16:50Z")

</div>

On 9/19/06, John T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Ok, maybe I need to ask a more basic question…
> 
> What’s the magic that I need to put into the file in  
> /etc/apache2/sites-available that will let me access a rails app like:

Just wondering… should I not even have the item setup in  
/etc/apache2/sites-available?

---

<div class="post-metadata">

**Author:** ![johnt519](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cab0a1/32.png) [@johnt519](https://www.ruby-forum.com/u/johnt519)\
**Post date:** [September 20, 2006, 4:07am UTC](https://www.ruby-forum.com/t/rails-app-on-apache2-not-finding-style-sheets/69173/4 "2006-09-20T04:07:39Z")

</div>

On 9/19/06, John T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Just wondering… should I not even have the item setup in  
> /etc/apache2/sites-available?

Nope. That didn’t help.

Again… when I go to [http://mysite.com/radiant](http://mysite.com/radiant), I do get the front  
page. But all of the links, that should have /radiant/ , don’t:

[http://mysite.com/radiant/about](http://mysite.com/radiant/about) is coming out as [http://mysite.com/about](http://mysite.com/about)

and in the Admin pages, when I try to expand one of the sections, I’m  
seeing the request headers:

Set-Cookie: \_session\_id=faa1dbd5cf25b0b70243262c11414317; path=/  
Keep-Alive: timeout=15, max=98 Connection: Keep-Alive  
Transfer-Encoding: chunked Content-Type: text/html;charset=utf-8 0

Anyone please have a hint on setting up a Rails app on Apache under a  
subdirectory???

Please???

---

<div class="post-metadata">

**Author:** ![johnt519](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cab0a1/32.png) [@johnt519](https://www.ruby-forum.com/u/johnt519)\
**Post date:** [September 25, 2006, 7:55pm UTC](https://www.ruby-forum.com/t/rails-app-on-apache2-not-finding-style-sheets/69173/5 "2006-09-25T19:55:28Z")

</div>

Have you considered Lighty? I see some people successfully doing what  
you describe using that instead of Apache:

[http://pinkpucker.net/2006/1/31/getting-multiple-rails-sites-going-on-one-domain-using-lighttpd](http://pinkpucker.net/2006/1/31/getting-multiple-rails-sites-going-on-one-domain-using-lighttpd)  
[http://forum.textdrive.com/viewtopic.php?pid=62648](http://forum.textdrive.com/viewtopic.php?pid=62648)

I’d try to help from personal experience but I’ve had difficulties  
myself hosting two Rails apps on one domain.

Let us know how/when you solve this.
