Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to stop active web servers

Status
Not open for further replies.

Aych

Programmer
Feb 12, 2002
3
US
I need to come up with a script to stop any active web servers. Is there a way to get a list of PIDs for web servers only?

Thanks,

-Aych
 
For apache, something like the following should kill the process numbers:
Code:
ps -ef | awk '/httpd/{print $2}' | xargs kill -INT
Cheers, Neil :cool:
 
I can't be sure what web servers will be installed and running, on my development system we're running apache and iPlanet, but we might have any number of servers on the target system.
 
Well you will have to define then what a web server is....

because all "web server"s are just programs that sit on a tcp port and respond to client requests usually with the http protocol but not nesessarily (sp?).

the only way i can think of to really ensure they are ALL stopped is to stop the tcp protocol, do your process, and then restart the tcp protocol.

have fun
stan
 
Well, even throwing this at the web servers would not do. I had hoped there was a way to could access a list of programs which were accessing the tcp ports. I need to swap out some provider runtime files while the web server servlet engine is not using them.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top