Iâ??ve been working with Ruby on Rails for about 2 months now and have
really enjoyed the ease of use of it. Iâ??m only been doing development
on it so Iâ??ve been using WeBrick. Recently, I have built a server
running Debian Linux, with ruby 1.8.2, rails 1.0.0, lighty 1.4.3, and
Mysql 5.0.18. I used WeBrick to generate a lighttpd.conf file for me, I
changed the paths in the file to absolute paths. I’m not even sure is
all is working because I discovered thant when I start lighty then try
to restart the server, I get an error saying that the port that Iâ??m
using is already in use. Here is my lighttpd.conf file:
That’s probably port 80. Are you sure you’re shutting it down correctly?
I’m pretty sure, I’m using:
/etc/init.d/lighttpd start/stop/restart/reload/force-reload (not all at
once )
One other thing. when I click on “About your applicationâ??s environment”
I get a 404 - Not Found instead of the typical “For security purposes,
this information is only available to local requests.”
That’s probably port 80. Are you sure you’re shutting it down correctly?
I’m pretty sure, I’m using:
/etc/init.d/lighttpd start/stop/restart/reload/force-reload (not all at
once )
One other thing. when I click on “About your applicationâ??s environment”
I get a 404 - Not Found instead of the typical “For security purposes,
this information is only available to local requests.”
If you’re using firefox 1.5 try clearing all your cache files. I know
this sounds dumb, but I had a similar problem and it was solved by doing
that.
The /etc/init.d/lighttpd command on debian doesn't seem to shut down
the dispacth fcgi processes very well and sometimes not even lighty
either. I am assuming you installed lighty from a .deb package from
somewhere. I have a brute force script that will work for you.
But before that there are a few issues I see in your conf file here.
server.error-handler-404 = “/var/coar/public/dispatch.cgi”
should be
server.error-handler-404 = “/dispatch.fcgi”
Also you are spawning 5 fcgi listeners with the min-max procs
statements. Unless your site is getting around 80,000 hits a day you
dont need anywhere near that amount of listeners. You should set
bothe the min-procs and max-procs to either 1 or 2 and make sure they
are both set to the same number of procs. The dynamic spawning is
disabled in lighty in all newer versions so the min-procs doesn’t
really do much. Start with 2 listeners, you will be bale to handle
quite a bit of traffic with just 2.
And here is a script for you that will restart lighty and the
dispacthers for you. Put this in a file somehwere like this:
in: /usr/local/bin/bounce
puts “\nLighttpd pid: #{lighty}”
puts ‘=’*25
puts “dispatch.fcgi’s pids: #{dispatchers.join(” : “)}”
if system “kill -9 #{lighty} #{dispatchers.join(’ ')}”
# make sure to change the follwing line to point to the correct
# lighttpd.conf file for your app.
system “/usr/sbin/lighttpd -f /path/to/lighttpd.conf”
puts “Restarted Lighttpd & Dispatchers…”
else
puts “Error occured. Please restart lighty by hand”
end
Now you can restart your lighttpd and fcgi processes by typing:
$ bounce
Make sure to chmod +x the bounce file after you save it so its
executable.
Cheers-
-Ezra
On Feb 7, 2006, at 7:40 AM, Nick C. wrote:
to restart the server, I get an error saying that the port that I?m
server.document-root = “/var/coar/public/”
need to execute a second request while the first is still pending.