# Rails on lighttpd locks up, freezes, unresponsive every day

**URL:** <https://www.ruby-forum.com/t/rails-on-lighttpd-locks-up-freezes-unresponsive-every-day/71842>\
**Category:** Rails\
**Created:** [February 22, 2006, 4:06pm UTC](https://www.ruby-forum.com/t/rails-on-lighttpd-locks-up-freezes-unresponsive-every-day/71842 "2006-02-22T16:06:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mike-moscow](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/53a042/32.png) [@mike-moscow](https://www.ruby-forum.com/u/mike-moscow)\
**Post date:** [February 22, 2006, 4:06pm UTC](https://www.ruby-forum.com/t/rails-on-lighttpd-locks-up-freezes-unresponsive-every-day/71842/1 "2006-02-22T16:06:33Z")

</div>

I have RoR running on lighttpd on RedHat Linux and every morning that I  
check the web page it just keeps waiting to refresh it forever, Firefox  
and IE never times out on any of the pages I try. Has anyone seen that  
happening to their RoR? I also removed lighttpd completely and just ran  
webrick but there was no difference. The linux box has a pretty old  
kernel 2.4.21-4, could that be the problem, I’m just guessing?  
Any help would be appreciated.  
Thanks,  
Mike M.

---

<div class="post-metadata">

**Author:** ![mike-moscow](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/53a042/32.png) [@mike-moscow](https://www.ruby-forum.com/u/mike-moscow)\
**Post date:** [February 22, 2006, 6:07pm UTC](https://www.ruby-forum.com/t/rails-on-lighttpd-locks-up-freezes-unresponsive-every-day/71842/2 "2006-02-22T18:07:13Z")

</div>

On 22/02/06, Mike M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I have RoR running on lighttpd on RedHat Linux and every morning that I  
> check the web page it just keeps waiting to refresh it forever, Firefox  
> and IE never times out on any of the pages I try. Has anyone seen that  
> happening to their RoR? I also removed lighttpd completely and just ran  
> webrick but there was no difference. The linux box has a pretty old  
> kernel 2.4.21-4, could that be the problem, I’m just guessing?  
> Any help would be appreciated.

When it comes to lighttpd ‘idle-timeout’ directive might be the  
problem. You may safely get rid of it. I am not sure why webrick  
doesn’t work.

---

<div class="post-metadata">

**Author:** ![mike-moscow](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/53a042/32.png) [@mike-moscow](https://www.ruby-forum.com/u/mike-moscow)\
**Post date:** [February 22, 2006, 9:06pm UTC](https://www.ruby-forum.com/t/rails-on-lighttpd-locks-up-freezes-unresponsive-every-day/71842/3 "2006-02-22T21:06:39Z")

</div>

Mike M. wrote:

> I have RoR running on lighttpd on RedHat Linux and every morning that I  
> check the web page it just keeps waiting to refresh it forever, Firefox  
> and IE never times out on any of the pages I try. Has anyone seen that  
> happening to their RoR? I also removed lighttpd completely and just ran  
> webrick but there was no difference. The linux box has a pretty old  
> kernel 2.4.21-4, could that be the problem, I’m just guessing?  
> Any help would be appreciated.  
> Thanks,  
> Mike M.

I am running RoR with lighttpd (1.3.16) and MySQL (4.1.14) on Gentoo  
Linux with kernel 2.6.14. I do not have any problem at all. I also use  
virtual host in lighttpd configuration.

Here is my gem list:

\*\*\* LOCAL GEMS \*\*\*

actionmailer (1.1.5)  
Service layer for easy email delivery and testing.

actionpack (1.11.2)  
Web-flow and rendering framework putting the VC in MVC.

actionwebservice (1.0.0)  
Web service support for Action Pack.

activerecord (1.13.2)  
Implements the ActiveRecord pattern for ORM.

activesupport (1.2.5)  
Support and utility classes used by the Rails framework.

color-tools (1.3.0)  
color-tools provides colour space definition and manpiulation as  
well as commonly named RGB colours.

gruff (0.0.7)  
Beautiful graphs for one or multiple datasets.

pdf-writer (1.1.3)  
A pure Ruby PDF document creation library.

rails (1.0.0)  
Web-application framework with template engine, control-flow layer,  
and ORM.

rake (0.6.2)  
Ruby based make-like utility.

sources (0.0.1)  
This package provides download sources for remote gem installation

transaction-simple (1.3.0)  
Simple object transaction support for Ruby.

---

<div class="post-metadata">

**Author:** ![mike-moscow](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/53a042/32.png) [@mike-moscow](https://www.ruby-forum.com/u/mike-moscow)\
**Post date:** [February 23, 2006, 3:55pm UTC](https://www.ruby-forum.com/t/rails-on-lighttpd-locks-up-freezes-unresponsive-every-day/71842/4 "2006-02-23T15:55:51Z")

</div>

Åukasz Piestrzeniewicz wrote:

> On 22/02/06, Mike M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > I have RoR running on lighttpd on RedHat Linux and every morning that I  
> > check the web page it just keeps waiting to refresh it forever, Firefox  
> > and IE never times out on any of the pages I try. Has anyone seen that  
> > happening to their RoR? I also removed lighttpd completely and just ran  
> > webrick but there was no difference. The linux box has a pretty old  
> > kernel 2.4.21-4, could that be the problem, I’m just guessing?  
> > Any help would be appreciated.
> 
> When it comes to lighttpd ‘idle-timeout’ directive might be the  
> problem. You may safely get rid of it. I am not sure why webrick  
> doesn’t work.

I don’t have an ‘idle-timeout’ directive in my lighttpd.conf file. I  
checked it this morning and it’s frozen again, time to restart it. I  
think I’ll put in a cron job to restart it every night and see if that  
helps.  
Mike M.

---

<div class="post-metadata">

**Author:** ![mike-moscow](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/53a042/32.png) [@mike-moscow](https://www.ruby-forum.com/u/mike-moscow)\
**Post date:** [February 23, 2006, 5:17pm UTC](https://www.ruby-forum.com/t/rails-on-lighttpd-locks-up-freezes-unresponsive-every-day/71842/5 "2006-02-23T17:17:54Z")

</div>

Here is my lighttpd.conf file for your reference:-

server.modules = (  
“mod\_redirect”,  
“mod\_access”,  
“mod\_fastcgi”,  
“mod\_simple\_vhost”,  
“mod\_accesslog” )

server.document-root = “/var/www/localhost/htdocs/”

server.errorlog = “/var/log/lighttpd/error.log”

server.indexfiles = ( “index.php”, “index.html”,  
“index.htm”, “default.htm” )

mimetype.assign = (  
“.pdf” =\> “application/pdf”,  
“.sig” =\> “application/pgp-signature”,  
“.spl” =\> “application/futuresplash”,  
“.class” =\> “application/octet-stream”,  
“.ps” =\> “application/postscript”,  
“.torrent” =\> “application/x-bittorrent”,  
“.dvi” =\> “application/x-dvi”,  
“.gz” =\> “application/x-gzip”,  
“.pac” =\> “application/x-ns-proxy-autoconfig”,  
“.swf” =\> “application/x-shockwave-flash”,  
“.tar.gz” =\> “application/x-tgz”,  
“.tgz” =\> “application/x-tgz”,  
“.tar” =\> “application/x-tar”,  
“.zip” =\> “application/zip”,  
“.mp3” =\> “audio/mpeg”,  
“.m3u” =\> “audio/x-mpegurl”,  
“.wma” =\> “audio/x-ms-wma”,  
“.wax” =\> “audio/x-ms-wax”,  
“.ogg” =\> “application/ogg”,  
“.wav” =\> “audio/x-wav”,  
“.gif” =\> “image/gif”,  
“.jpg” =\> “image/jpeg”,  
“.jpeg” =\> “image/jpeg”,  
“.png” =\> “image/png”,  
“.xbm” =\> “image/x-xbitmap”,  
“.xpm” =\> “image/x-xpixmap”,  
“.xwd” =\> “image/x-xwindowdump”,  
“.css” =\> “text/css”,  
“.html” =\> “text/html”,  
“.htm” =\> “text/html”,  
“.js” =\> “text/javascript”,  
“.asc” =\> “text/plain”,  
“.c” =\> “text/plain”,  
“.cpp” =\> “text/plain”,  
“.log” =\> “text/plain”,  
“.conf” =\> “text/plain”,  
“.text” =\> “text/plain”,  
“.txt” =\> “text/plain”,  
“.dtd” =\> “text/xml”,  
“.xml” =\> “text/xml”,  
“.mpeg” =\> “video/mpeg”,  
“.mpg” =\> “video/mpeg”,  
“.mov” =\> “video/quicktime”,  
“.qt” =\> “video/quicktime”,  
“.avi” =\> “video/x-msvideo”,  
“.asf” =\> “video/x-ms-asf”,  
“.asx” =\> “video/x-ms-asf”,  
“.wmv” =\> “video/x-ms-wmv”,  
“.bz2” =\> “application/x-bzip”,  
“.tbz” =\> “application/x-bzip-compressed-tar”,  
“.tar.bz2” =\> “application/x-bzip-compressed-tar”  
)

accesslog.filename = “/var/log/lighttpd/access.log”

url.access-deny = ( “~”, “.inc” )

$HTTP[“url”] =~ “.pdf$” {  
server.range-requests = “disable”  
}

server.pid-file = “/var/run/lighttpd.pid”

$SERVER[“socket”] == “172.18.2.83:4000” {  
simple-vhost.document-root = “/var/www/rails/myapp1/public”  
server.document-root = “/var/www/rails/myapp1/public/”  
accesslog.filename = “/var/log/lighttpd/00rail\_access\_myapp1.log”  
errorlog.filename = “/var/log/lighttpd/00rail\_error\_myapp1.log”  
server.indexfiles = ( “dispatch.fcgi”, “index.html” )  
server.error-handler-404 = “/dispatch.fcgi”  
server.error-handler-500 = “/dispatch.fcgi”

## rails stuff

### fastcgi module

fastcgi.server = (  
“.fcgi” =\> (  
“172.18.2.83” =\> (  
“socket” =\> “/tmp/rail\_myapp1.sck”,  
“bin-path” =\> “/var/www/rails/bdo/myapp1/public/dispatch.fcgi”,  
“min-procs” =\> 1,  
“max-procs” =\> 5  
)  
)  
)  
}  
$SERVER[“socket”] == “172.18.2.83:3000” {  
simple-vhost.document-root = “/var/www/rails/myapp2/public”  
server.document-root = “/var/www/rails/myapp2/public/”  
accesslog.filename = “/var/log/lighttpd/00rail\_access\_myapp2.log”  
errorlog.filename = “/var/log/lighttpd/00rail\_error\_myapp2.log”  
server.indexfiles = ( “dispatch.fcgi”, “index.html” )  
server.error-handler-404 = “/dispatch.fcgi”  
server.error-handler-500 = “/dispatch.fcgi”

## rails stuff

### fastcgi module

fastcgi.server = (  
“.fcgi” =\> (  
“172.18.2.83” =\> (  
“socket” =\> “/tmp/rail\_myapp2.sck”,  
“bin-path” =\> “/var/www/rails/myapp2/public/dispatch.fcgi”,  
“min-procs” =\> 1,  
“max-procs” =\> 5  
)  
)  
)  
}

---

<div class="post-metadata">

**Author:** ![mike-moscow](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/53a042/32.png) [@mike-moscow](https://www.ruby-forum.com/u/mike-moscow)\
**Post date:** [February 24, 2006, 6:16pm UTC](https://www.ruby-forum.com/t/rails-on-lighttpd-locks-up-freezes-unresponsive-every-day/71842/6 "2006-02-24T18:16:35Z")

</div>

I solved the problem. It turns out that when I was resyncing my RoR  
directory on my Linux box the from a Windows box every day, the files  
were copied in Windows format not Unix. Once I converted all dispatch.\*  
files in the public directory to Unix using the dos2unix command  
everything was fine.

Thanks for your help.

Mike M.
