Install config: lighttpd dead but pid file exists

I'm trying to run rails on RHED (centos 4) by following this tutorial:

http://wiki.rubyonrails.org/rails/pages/RailsOnRHEL

and something is gone a bit astray during the install process that is not allowing lighttpd \ apache to run rails on the web.

Since i'm running Centos, I should mention I'm NOT running SELinux.

As it is, i'm at a total loss as to why this is not working: I've created my init app (admin) with the correct path. The public folder has the dispatch.fcgi. All the logs are correctly located, as is the pid yet STILL when I run:

[root@test lighttpd]# service lighttpd start Starting lighttpd: [ OK ]

I get:

[root@test lighttpd]# service lighttpd status lighttpd dead but pid file exists

Could anyone tell me why lighttpd won't light up!?

Here is my lighttpd.conf for your consideration:

server.document-root = "/home/www/web4/web/admin/"

## where to send error-messages to server.errorlog = "/var/log/lighttpd/error_log.log"

# files to check for if .../ is requested server.indexfiles = ( "index.php", "index.html",                                 "index.htm", "default.htm" )

server.error-handler-404 = "/home/www/web4/web/admin/public/dispatch.fcgi"

server.port = 8080

## to help the rc.scripts server.pid-file = "/var/run/lighttpd.pid"

## change uid to <uid> (default: don't care) server.username = "lighttpd"

## change uid to <uid> (default: don't care) server.groupname = "lighttpd"

fastcgi.server = (         ".fcgi" => (                 "rails" => (                         "socket" => "/tmp/lighttpd-fcgi.socket",                         "bin-path" => "/home/www/web4/web/admin/public/dispatch.fcgi",                         "bin-environment" => ( "RAILS_ENV" => "production" ),                         "min-procs" => 2,                         "max-procs" => 2                 )         ) )

Hi,

I cant see any problems with your setup.

I’d suggest you go on a hunt for clues.

-Can you start webrick? -Can you start lightppd directly from the shell? -Can you find the appropriate log files and see anything

interesting in them?

I’m interested in helping you because I’m thinking about setting up a Centos box which would be well suited for me using Oracle as the DB.

-Dan

I am still not getting any luck getting lighttpd installed and started (properly).

I can determine that webrick is running fine in the console:

[root@test admin]# script/server webrick -p 3000 => Booting WEBrick... => Rails application started on http://0.0.0.0:3000 => Ctrl-C to shutdown server; call with --help for options [2006-09-07 09:12:04] INFO WEBrick 1.3.1 [2006-09-07 09:12:04] INFO ruby 1.8.4 (2005-12-24) [i386-linux] [2006-09-07 09:12:04] INFO WEBrick::HTTPServer#start: pid=21344 port=3000

however, when I try to start lighttpd I get the following:

[root@test admin]# service lighttpd start Starting lighttpd: [ OK ] [root@test admin]# service lighttpd status lighttpd dead but pid file exists

Worse yet, I can find nothing that details the meaning of "lighttpd dead but pin file exists". Does anyone know why lighttpd is failing in this way? The documentation on ROR says that perhaps the conf has some paths incorrect. I've checked and double checked. Included herein is the complete lighttpd.conf file. Perhaps you guys can see what I'm not.

The app is running in /home/www/web4/web/admin, where admin is the rails app. (using vhosts here).

The one thing I'm not able to see is the error logs for lighttpd, which contain no info.

Would *love* to get started with ROR here but need to get the damn thing running. Dan, centOS has been quite nice for a RHED clone. We're using as a test box to mirror our prod box and its gone quite smooth.

-l

p.s. here is my lighttpd.conf

# lighttpd configuration file

############ Options you really have to take care of

It appears that lighttpd won't run without being able to write to the access\error log.

I set up my logs (using vi) and when I try to start lighttpd manually I get:

[root@test log]# /usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf 2006-09-07 15:39:39: (log.c.60) opening errorlog '/home/www/web4/web/admin/log/lighttpd_error.log' failed: Permission denied 2006-09-07 15:39:39: (server.c.654) opening errorlog failed, dying

I tried to chmod the perms to 777 to allow lightly to write to the file but no luck!

Does anyone know whats going on?

-l

lmongill@starbucks.com wrote:

M,

it looks like you have bumped into a pretty good clue.

If the chmod 777 did not work on the file, I’d rm the file and take a very close look at the directories.

Also I’d make sure that the owner of the lighttpd process,

is the same id of the directories.

Also check if lighttpd is happy if you configure it so that the logs live in /tmp.

I know that is not a good place for them permanently but lighttpd should be able to write there.

Also I’ve never used vi to create log files. Instead, I just made sure that lighttpd could write in the log directories and I let it do what it wants.

Also, if you are starting lighttpd straight from the command line,

and you do it as root, you might have problems writing to any directory which lives on another machine but is shared to you via NFS.

If you type

df /home/www/web4/web/admin/log

You will find out if that directory is local or on NFS.

-Dan