Jump to content
The Uniform Server Community

Unable to shut down Apache


Recommended Posts

I am attempting to set up a "Wiki on a Stick" following the advice at: http://meta.wikimedia.org/wiki/Wiki_on_a_stick

The installation went remarkably smoothly, with Uniform Server 3.3 and MediaWiki 1.6.6 on Windows 2000 SP3. I've installed MediaWiki before on a hard drive, so everything appeared successful, and the functional Wiki appears fully operational. Too good to be true, right?


Right. The problem came when I tried to shut it down. The "Stop.bat" produces a "." in one line, which seems to indicate a return code. Using the Uniform Server control panel, appears to work: when I confirm that I want to shut down Apache, I get an hourglass in my browser, presumably because Apache is no longer responding.


However, in either case, when I try to "stop" the USB drive, Windows tells me I'm not allowed to. Bringing up the Task Manager, I find that Apache is still running. When I try to shut it down using the Task Manager, I'm told "Access denied!" If I open a command window, cd to ...\Apache2\bin and execute "apache -k stop" I get the message "[error](OS 2)The system cannot find the file specified.: No installed service named "Apache".


I followed the Wiki_on_a_stick advice under "No other Apache.exe" to rename Apache to Apache2, to see if that would help, but it didn't.


Typically, after I try to shut it down, about 3 minutes later the monitor goes black, the keyboard and mouse are unresponsive, and only a power-off gets the computer's attention. The "access.log" looks like this: - - [23/Jun/2006:12:46:31 -0700] "GET /apanel/index.php HTTP/1.1" 200 690 "http://localhost/apanel/" "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6" - - [23/Jun/2006:12:46:34 -0700] "GET /wi/index.php/Main_Page HTTP/1.1" 200 2448 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6"


The preceding text was copied and pasted from the access file. The "y"s go on for many lines. I'm guessing that your "pskill" program is trying to send a message, and filling up some kind of buffer.


I have not found any posts similar to this.

Can you tell me how to stop Apache without using "pskill?"

Any other ideas?





Link to comment
Share on other sites

If pskill is really the problem. You should try to replace the pskill in Uniform Server with this one. Previous versions of Uniform Server use to use that but as the executable is big (compared to the one we have now) and lots of virus scanners wrongly detect it as a virus, it was replaced with a home made version.


Once you've placed the new pskill.exe in the right place, you should open Stop.bat in notepad and change

diskw\home\admin\program\pskill.exe Apache.exe c


diskw\home\admin\program\pskill.exe -t Apache.exe

Link to comment
Share on other sites

Thanks for the suggestion MrX!


I tried your changes. It turns out that the Server_Start batch file also uses pskill, and expects a return code if Apache is not running. The result was that the script complained and quit. Next, I started Apache manually and tried your pskill program to stop it. Your program returned a message in the DOS window 'Access is denied.' just like the Task Manager.


Next, I renamed your tool pskill2.exe, used the original pskill in the Start script, and your tool in the Stop script. It hung the system.


Finally, I tried using your tool manually to kill the Apache task. It started in the DOS window and hung, but politely. I could kill pskill with Ctrl-C. I could not, however, get it to kill Apache.


Incidentally, I am running all these tests in an account with Administrator privileges.



Link to comment
Share on other sites

You shouldn't be getting "Access denied" errors on an administrator account unless you've installed Uniform Server as a service.


Did you touch anything in Uniform Server's plugins folder and where did you learn how to use "apache -k stop"? That command is for stopping Apache if you've installed it as a service.


By the way, you might want to try "apache -n Apache2 -k stop". For your information, "-n" defines the service name Apache is installed as.


I hope that helps :)

Link to comment
Share on other sites

Success! Sometimes it helps to "sleep on" a question. The question: If "the system" shouldn't be telling the Adminstrator "Access is denied," what might be doing it?


Answer: the firewall! I have a ZoneAlarm software firewall. Shutting it down removed the problem. MrX, your PsKill now does the job as you expected it to. I can shut down Apache, and also get permission from Windows to remove the Jump drive. This probably means the original PsKill would also work. Conclusion: with your assistance, the problem has been solved!




Other answers to questions now of academic interest: I got "apache -k stop" from the Apache website. I am a retired scientific programmer who knows just enough about systems to get myself into trouble. I have been using phpBB2 for about 5 years as a "content management" system, and I am looking for something more flexible. MediaWiki looked like a plausible candidate, and making it as portable as a jump drive seemed very enticing. Now, thanks to your help, I will be able to test that hypothesis.


Thanks again! :)



Link to comment
Share on other sites

  • 2 weeks later...

The pskill is not made to shut down the server in service mode... It is made to shut it down in normal mobile mode. For Service, you have to use the services.msc command in Run and the find Apache and stop it.... Not the pskill.....


Please discontinue that method as it kills the app when the service might still be running....

Link to comment
Share on other sites

If you can't understand what Olajide said above (about 90% of you won't), then view this log:

(12:20:42) The culprit was his firewall (ZoneAlarm)

(12:20:51) not services :/

(12:21:13) but he is using the server in service mod...

(12:21:26) No

(12:21:33) pskill is not meant to shut the server down in service mode...

(12:21:50) You probably need sleep

(12:21:53) didn't i read somewhere that he was using it as a service?

(12:22:02) That was my guess

(12:22:05) oh well.... might be because i am sleepy

(12:22:07) but he wasn't using it

(12:22:24) so the pskill from sysinternals has no problem right?

(12:22:30) Yes

(12:22:33) and ours too

(12:22:38) we can use that and it would be perfect right>

(12:22:47) You were using that

(12:22:49) so ours is ok too

(12:22:58) Ours causes problems with ZoneAlarm

(12:22:59) so that was the old pskill?

(12:23:03) Yes

(12:23:08) didn't know... i thought taras made it

(12:23:20) SysInternals' pskill also causes problems with ZoneAlarm

(12:23:22) what problems with zonealarm

(12:23:33) "Finally, I tried using your tool manually to kill the Apache task. It started in the DOS window and hung, but politely."

(12:23:43) It can't kill Apache if ZoneAlarm is running

(12:23:47) But there is a difference

(12:23:57) Ours makes the PC become unresponsive

(12:24:18) whereas, SysInternal's doesn't

(12:24:23) hmm....

(12:24:32) It starts but doesn't do anything, and can be killed with Ctrl + C

(12:24:51) then whats the use of the update... i think micheal just rewrote it in vc++ from the old lang

(12:25:00) No

(12:25:03) and that was it... just lanuage conversion....

(12:25:05) The update fixed NT and 9x problem

(12:25:15) that was for uniserv.exe i think

(12:25:17) NT had some Process32Next and Process32Last problems

(12:25:26) and on 9x, it doesn't work

(12:25:26) yes

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...