Operating System - HP-UX
1827313 Members
2953 Online
109961 Solutions
New Discussion

How to Shutdown Apache Server

 
SOLVED
Go to solution
Steven Chen_1
Super Advisor

How to Shutdown Apache Server

Hello,

Somehow we don't want Apache server to run and I would like to know how to shut it down nicely.

Is it by kill -9?

How to disable it from startup, which is the 2nd puzzle.

Thanks a millions in advance.

Steven
Steve
5 REPLIES 5
Mark Greene_1
Honored Contributor
Solution

Re: How to Shutdown Apache Server

look to see if you have a start/stop script in /sbin/init.d for apache. if so, you should stop it with that:

/sbin/init.d/apache stop

and then look in /sbin/rc2.d to see if you have a link back to the script above, and if so remove it.

HTH
mark
the future will be a lot like now, only later
Patrick Wallek
Honored Contributor

Re: How to Shutdown Apache Server

No, don't do a kill -9 on it.

First off, is this HP's apache? If so, to stop it do:

# /sbin/init.d/apache stop

If it is not HP's do:

# /opt/apache/bin/apachectl stop

To keep from restarting on startup:

If HP's apache, modify /etc/rc.config.d/apacheconf and modify the line that says APACHE_START so that it looks like:

APACHE_START=0

If it is not HP's, then see if you have your own start/stop scripts for controlling the Apache daemon.
S.K. Chan
Honored Contributor

Re: How to Shutdown Apache Server

You can use the start/stop script ..
# /sbin/init.d/apache stop

or ..

# /opt/apache/bin/apachectl stop

Helen French
Honored Contributor

Re: How to Shutdown Apache Server

Hi,

For shutting it down,

# /sbin/init.d/apache stop

For disabling this permanently, you can either stop is by editing the file /etc/rc.config.d/apacheconf and putting a '0' instead of '1' at the START command OR rename the startup and kill scripts in rc scripts.

HTH,
Shiju
Life is a promise, fulfill it!
A. Clay Stephenson
Acclaimed Contributor

Re: How to Shutdown Apache Server

Hi:

Normally when apache installs it creates some /sbin/init.d startup scripts.

1) Check to see if you have a file called /etc/rc.config.d/apache. The variable APACHE_START should be set to 1 and APACHE_ROOT should be defined.

2) You should also have a file called /sbin/init.d/apache. To stop apache, simply '/sbin/init.d/apache stop'.

If these files do not exist, please say so and someone can easily supply them. Normally, apache writes a small file with the PID's that need to send a kill.

P.S. Kill -9 is ALMOST ALWAYS A BAD IDEA for Apache or anything else. It does no cleanup so shared memory and temp files are left dangling.
When you kill, kill in this order: kill -15, -1,-2,-3,-11 and finally and only if absolutely necessary kill -9. Kill -11 is almost as sure a kill as kill -9 as it does cleanup.
If it ain't broke, I can fix that.