The Restart shortcut for Apache doesn't work properly for me. The restart seems to have succeeded, but then I can't access any pages on the server. Requests time out. It does work when I stop then server, then start the server. I've written a batch file to do it automatically, but I'd still like to know why a regular restart doesn't work.
Restart
Collapse
X
-
Tags: None
-
-
Well, here's the log for the restart.
Code:[Wed Sep 26 16:30:48 2007] [notice] Parent: Received restart signal -- Restarting the server. [Wed Sep 26 16:30:48 2007] [notice] Child 5716: Exit event signaled. Child process is ending. [Wed Sep 26 16:30:49 2007] [notice] Apache/2.2.4 (Win32) mod_ssl/2.2.4 OpenSSL/0.9.8d PHP/5.2.4 configured -- resuming normal operations [Wed Sep 26 16:30:49 2007] [notice] Server built: Jan 9 2007 23:17:20 [Wed Sep 26 16:30:49 2007] [notice] Parent: Created child process 6540 [Wed Sep 26 16:30:49 2007] [notice] Child 5716: Released the start mutex [Wed Sep 26 16:30:50 2007] [notice] Child 6540: Child process is running [Wed Sep 26 16:30:50 2007] [notice] Child 6540: Acquired the start mutex. [Wed Sep 26 16:30:50 2007] [notice] Child 6540: Starting 250 worker threads. [Wed Sep 26 16:30:50 2007] [notice] Child 5716: Waiting for 250 worker threads to exit. [Wed Sep 26 16:30:50 2007] [notice] Child 5716: All worker threads have exited. Error in my_thread_global_end(): 2 threads didn't exit thread to listen on port 8080. [Wed Sep 26 16:30:50 2007] [notice] Child 6540: Starting thread to listen on port 443. [Wed Sep 26 16:30:55 2007] [notice] Child 5716: Child process is exiting
My restart command is as follows:
Code:httpd -n "Apache2" -k restart
Comment
-
-
It looks like two threads did not stop, meaning you didn't get access to the port back.
Try a full stop, and search through the output of ps to see if any httpd/apache threads are still running, and kill them. Then start the service again.Comment
-
Originally posted by MotomaIt looks like two threads did not stop, meaning you didn't get access to the port back.
Try a full stop, and search through the output of ps to see if any httpd/apache threads are still running, and kill them. Then start the service again.Comment
-
Originally posted by cheesecakerAgain, it works if I do httpd -k stop then httpd -k start. But a full stop/start of the service takes much longer than a simple httpd -k restart. That's why I'm asking.Comment
-
might be multiple instances opening.. like connection pools ... they cause this to occur...
also may me its already started in you dont see the refreshed version ...
well this is a major issue with apache ... me face it often ... that's why me shifted to WAMP server..
WampServer est une plate-forme de développement Web sous Windows pour des applications Web dynamiques à l’aide du serveur Apache2, du langage de scripts PHP et d’une base de données MySQL.
its a much more user friendly ... for PHP i mean ...Comment
-
-
Originally posted by MotomaDoes the graceful restart option work?
Also, I can't switch servers. I'm committed to Apache, I'm learning it's modules, etc. It took forever to get it set up the way it is now. Switching server software is not an option.Comment
-
Originally posted by cheesecakerI'm fairly certain that httpd -k restart is graceful by default.
Also, I can't switch servers. I'm committed to Apache, I'm learning it's modules, etc. It took forever to get it set up the way it is now. Switching server software is not an option.Comment
-
Originally posted by MotomaWell then, have you tried the un-graceful approach?Comment
-
Originally posted by cheesecakerI'm not sure how to do that. I'm pretty sure the ungraceful approach is simply shutting down the apache2 windows service and restarting it. Again, though, that's what I'm trying to avoid. Takes a while.
I'm sorry, I completely overlooked that you were running on Windows.
How did you go about installing Apache? Did you use the Apache standalone installer, or did you opt to go with a bundled package, such as WAMP or Netserver?Comment
-
Hi,
as far as I can see from the log port 443 is opening again, so you should be able to access your html pages via https. What's missing, is port 8080/http. Looks as if it could not be detached while stopping the Apache. Could be there's some old, broken requests still blocking a socket.
Try restarting the Apache after a fresh start, when there has been no http call so far. Still the same problem? If not, have a look at the ones behind Apache (e.g. PHP and MySQL).
Regards, BerndComment
Comment