# Problems with lighty on linux

**URL:** <https://www.ruby-forum.com/t/problems-with-lighty-on-linux/51232>\
**Category:** Rails\
**Created:** [December 28, 2005, 5:35pm UTC](https://www.ruby-forum.com/t/problems-with-lighty-on-linux/51232 "2005-12-28T17:35:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![phil\_swenson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/f17d59/32.png) [@phil\_swenson](https://www.ruby-forum.com/u/phil_swenson)\
**Post date:** [December 28, 2005, 5:35pm UTC](https://www.ruby-forum.com/t/problems-with-lighty-on-linux/51232/1 "2005-12-28T17:35:06Z")

</div>

I’m trying to get our app running on Lighty… I followed Ezra’s  
instructions: [http://brainspl.at/pages/rails\_stack](http://brainspl.at/pages/rails_stack)… Currently the app  
runs fine with webrick, but with lighty I get 404 errors on everything.  
I found if I don’t edit the lighttpd.conf file to use absolute paths, it  
works fine. But this is not good for production because I need to run it  
with the -d param to run as a daemon. Even on the ruby default page I  
click on the “About your applicationâ??s environment” link I get a 404.

Here’s the lighttpd conf file:

# Default configuration file for the lighttpd web server

# Start using ./script/server lighttpd

server.port = 3001

server.modules = ( “mod\_rewrite”, “mod\_accesslog”,  
“mod\_fastcgi” )  
server.error-handler-404 =  
“/ci/htdocs/ci/rails/external/public/dispatch.fcgi”  
server.document-root = “/ci/htdocs/ci/rails/external/public/”

server.errorlog =  
“/ci/htdocs/ci/rails/external/log/lighttpd.error.log”  
accesslog.filename =  
“/ci/htdocs/ci/rails/external/log/lighttpd.access.log”

url.rewrite = ( “^/$” =\> “index.html”, “^([^.]+)$” =\>  
“$1.html” )

# Change \*-procs to 2 if you need to use Upload Progress or other tasks

that

# _need_ to execute a second request while the first is still pending.

fastcgi.server = ( “.fcgi” =\>  
( “localhost” =\>  
(  
“min-procs” =\> 1,  
“max-procs” =\> 1,  
“socket” =\> “/ci/htdocs/ci/rails/external/log/fcgi.socket”,  
“bin-path” =\>  
“/ci/htdocs/ci/rails/external/public/dispatch.fcgi”,  
“bin-environment” =\> ( “RAILS\_ENV” =\> “development” )  
)  
)  
)  
mimetype.assign = (  
“.css” =\> “text/css”,  
“.gif” =\> “image/gif”,  
“.htm” =\> “text/html”,  
“.html” =\> “text/html”,  
“.jpeg” =\> “image/jpeg”,  
“.jpg” =\> “image/jpeg”,  
“.js” =\> “text/javascript”,  
“.png” =\> “image/png”,  
“.swf” =\> “application/x-shockwave-flash”,  
“.txt” =\> “text/plain”

---

<div class="post-metadata">

**Author:** ![phil\_swenson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/f17d59/32.png) [@phil\_swenson](https://www.ruby-forum.com/u/phil_swenson)\
**Post date:** [December 28, 2005, 6:30pm UTC](https://www.ruby-forum.com/t/problems-with-lighty-on-linux/51232/2 "2005-12-28T18:30:46Z")

</div>

On Dec 28, 2005, at 9:35 AM, phil swenson wrote:

> click on the “About your application?s environment” link I get a 404.  
> server.error-handler-404 =  
> “/ci/htdocs/ci/rails/external/public/dispatch.fcgi”  
> server.document-root = “/ci/htdocs/ci/rails/external/public/”

The error-handler-404 needs to be (according to [http://lighttpd.net/](http://lighttpd.net/)  
documentation/configuration.html) the “uri to call if the requested  
file results in a 404”. Thus, it should be specified relative to the  
document-root, e.g. “/dispatch.fcgi”. You might try that and see if  
that works any better.

- Jamis

---

<div class="post-metadata">

**Author:** ![phil\_swenson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/f17d59/32.png) [@phil\_swenson](https://www.ruby-forum.com/u/phil_swenson)\
**Post date:** [December 28, 2005, 6:51pm UTC](https://www.ruby-forum.com/t/problems-with-lighty-on-linux/51232/3 "2005-12-28T18:51:41Z")

</div>

THe problem is I shouldn’t be getting a 404 error at all, I have  
content, controllers, views etc which all give me 404s. If I run  
lighttpd without relational paths it works fine. Something is  
misconfigured…

Jamis B. wrote:

> On Dec 28, 2005, at 9:35 AM, phil swenson wrote:
> 
> > click on the “About your applicationï¿½s environment” link I get a 404.  
> > server.error-handler-404 =  
> > “/ci/htdocs/ci/rails/external/public/dispatch.fcgi”  
> > server.document-root = “/ci/htdocs/ci/rails/external/public/”
> 
> The error-handler-404 needs to be (according to [http://lighttpd.net/](http://lighttpd.net/)  
> documentation/configuration.html) the “uri to call if the requested  
> file results in a 404”. Thus, it should be specified relative to the  
> document-root, e.g. “/dispatch.fcgi”. You might try that and see if  
> that works any better.
> 
> - Jamis

---

<div class="post-metadata">

**Author:** ![phil\_swenson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/f17d59/32.png) [@phil\_swenson](https://www.ruby-forum.com/u/phil_swenson)\
**Post date:** [December 28, 2005, 6:55pm UTC](https://www.ruby-forum.com/t/problems-with-lighty-on-linux/51232/4 "2005-12-28T18:55:31Z")

</div>

I take it back. This solved the problem! Thanks very much!

phil swenson wrote:

> THe problem is I shouldn’t be getting a 404 error at all, I have  
> content, controllers, views etc which all give me 404s. If I run  
> lighttpd without relational paths it works fine. Something is  
> misconfigured…
> 
> Jamis B. wrote:
> 
> > On Dec 28, 2005, at 9:35 AM, phil swenson wrote:
> > 
> > > click on the “About your applicationï¿½s environment” link I get a 404.  
> > > server.error-handler-404 =  
> > > “/ci/htdocs/ci/rails/external/public/dispatch.fcgi”  
> > > server.document-root = “/ci/htdocs/ci/rails/external/public/”
> > 
> > The error-handler-404 needs to be (according to [http://lighttpd.net/](http://lighttpd.net/)  
> > documentation/configuration.html) the “uri to call if the requested  
> > file results in a 404”. Thus, it should be specified relative to the  
> > document-root, e.g. “/dispatch.fcgi”. You might try that and see if  
> > that works any better.
> > 
> > - Jamis
