LinuxSA Mailing list archives

Index: [thread] [date] [subject] [author]
  From: Andrew Speer <andrew.speer@isolutions.com.au>
  To  : lloy0076@senet.com.au, linuxsa <linuxsa@linuxsa.org.au>
  Date: Thu, 25 Nov 1999 14:01:09 +1030

Re: Apache (Only Want One)

As Toby Corkindale noted, two processes is normal when running Apache as a
daemon. If (for some reason)
your *really* only want one process, you could start it in single process
mode from "init". Edit "/etc/inittab" to
look something like this:

#  Single user web server
#
ht:3:respawn:/usr/sbin/httpd -X

The "-X" tells apache not to fork any child processes, and not to detach
from the controlling terminal. If you
are going to do this permanently, make sure you turn off the /etc/rc.d
startup script for Apache:

/etc/rc.d/init/httpd stop  # Stop any current httpd servers
chkconfig httpd off   #  Disable the rc.d script for httpd

And tell init about the line you added to inittab via:

killall -HUP init

You should now only have a single httpd process running. If you ever need to
restart Apache completely (as
opposed to sending it a HUP signal), just

killall httpd

Will kill the running process, which init will then respawn


One of the downsides to this is that if you ever muck up something in the
httpd.conf file (eg incorrect command/syntax or something), and restart
httpd then httpd will start, then stop with an error message. But init has
the "respawn" param, so it will restart httpd again - then again etc until
it finally gives up and you get a message (via syslog) that:

init: Id "ht" respawning too fast: disabled for 5 minutes

To see the message that is causing problem, just try and start apache
manually from your terminal

httpd -X

And you should see an error message, giving you some clue as to what is
wrong. Correct it and do a

killall -HUP init

and init will respawn apache again.


Hope this helps,

Andrew Speer
andrew.speer@isolutions.com.au

P.S. I find the above method useful for testing the performance of my Apache
handlers. You can benchmark
how many replies you are getting from the web server/second without having
to worry about the impact of
child httpd processes being spawned etc.


----- Original Message -----
From: lloy0076 <lloy0076@senet.com.au>
To: linuxsa <linuxsa@linuxsa.org.au>
Sent: Thursday, November 25, 1999 10:12 AM
Subject: Apache (Only Want One)



[snip]
>
> Because only *I* access this particular Apache daemon I really only need
> one, hence the Min and Max and Start values. However, Apache always
> starts two processes (ps -aux tells me this). How do I force it to have
> only one?
>
> DAVID
> (incidentally my version is Apache 1.3.3 from the O'Reilly Definitive
> Guide)
>



-- 
LinuxSA WWW: http://www.linuxsa.org.au/  IRC: #linuxsa on irc.linux.org.au
To unsubscribe from the LinuxSA list:
  mail linuxsa-request@linuxsa.org.au with "unsubscribe" as the subject


Index: [thread] [date] [subject] [author]
Return to the LinuxSA Mailing List Information Page