[PLUG] httpd down

Randall Lucas rlucas at tercent.com
Tue Nov 9 19:33:54 UTC 2004


Hi Richard,

1. When you went to restart httpd, you just invoked the program as root 
-- it probably didn't get the right options for startup, like file 
locations and modules to use.  If you were missing one of the 
more-or-less standard modules to apache, like the MIME determination 
modules, it may not have been able to guess the file types and so served 
plaintext.

2. When you found /etc/rc1.d/KNNhttpd, you found the runlevel 1 (rc1.d) 
non-start (kill -- "K") in alphanumeric order ("NN") script for httpd. 
Each runlevel (Redhat as a server usually uses 3, debian 2) has a rc.d 
directory with symlinks to the main init directory (generally 
/etc/rc.d/init.d), and the naming of the symlinks determines what is 
done on startup.  "K" services are not started.  "S" services are 
started in NN order with "start" as first argument.  The "K" services, 
however, are still symlinks to the /etc/rc.d/init.d scripts that 
actually start and stop things -- only the first letter of the symlink 
name is different -- which is why you were able to run that script with 
"start" to get up and running again.

If you have services that need to start in order, you use the NN numbers 
to order them -- notice that SNNnetworking is before SMMhttpd, since 
httpd needs networking up to run.

Redhat has something called "chkconfig" which I believe handles this 
stuff, if you're not into organizing the symlinks by hand.

Starting a service in this manner doesn't give any guarantees that it 
will be restarted if it crashes, IIRC.  You may want to look at a tool 
published by DJB that does just that, if things get too crashprone.

You may also want to examine your uptime and runlevel.  If your computer 
was rebooted lately and went into a runlevel where the init script was 
"K" -- "do not start" -- then that may explain things.  Even the apache 
from an old Red Hat should be stable enough not to mysteriously quit 
under no load.  Apache error log *may* have more to say about it as well.

Best,

Randall

-- 
Randall Lucas
Tercent, Inc / SuperSurvey Online Surveys
http://www.supersurvey.com



More information about the PLUG mailing list