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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I shut down Apache with a script?

Status
Not open for further replies.

KevinAr18

Programmer
Apr 25, 2002
309
US
I have an apache server on my own computer that I use for localhost host type stuff. It's not for use on the internet. I would like to be able to make a script that shuts down the apache server instead of having to manually click on the shortcut on my start menu.

The shotcut for shutdown is as follows:

C:\Sierra\op2map\bin\Apache.exe -f "C:/Sierra/op2map/conf/httpd.conf" -k shutdown

I tried making it into a script like this:
#!perl
#
exec('C:\Sierra\op2map\bin\Apache.exe -f \"C:/Sierra/op2map/conf/httpd.conf\" -k shutdown');

but I got this error:
[Wed Jul 17 16:29:50 2002] [error] Access to config file
c:/sierra/op2map/bin/"c:/sierra/op2map/conf/httpd.conf" denied: not a valid filename
fopen: Permission denied
Apache.exe: could not open document config file c:/sierra/op2map/bin/"c:/sierra/
op2map/conf/httpd.conf"
Note the errors or messages above, and press the <ESC> key to exit. 19...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top