Restart

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cheesecaker
    New Member
    • Feb 2007
    • 66

    Restart

    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.
  • cheesecaker
    New Member
    • Feb 2007
    • 66

    #2
    Anybody? I can provide further information if necessary.

    Comment

    • docdiesel
      Recognized Expert Contributor
      • Aug 2007
      • 297

      #3
      Hi,

      which error code is appearing in the browser? 403, 404? Did you check if port 80 (and maybe 443 for ssl) are open (netstat -lntp)? What's apache saying in error.log?

      Regards, Bernd

      Comment

      • cheesecaker
        New Member
        • Feb 2007
        • 66

        #4
        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
        I think everything's fine until line 10. Why does it exit again?

        My restart command is as follows:
        Code:
        httpd -n "Apache2" -k restart
        And it seems like it works, but then the server just doesn't respond.

        Comment

        • cheesecaker
          New Member
          • Feb 2007
          • 66

          #5
          Anybody else have an idea?

          Comment

          • Motoma
            Recognized Expert Specialist
            • Jan 2007
            • 3236

            #6
            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

            • cheesecaker
              New Member
              • Feb 2007
              • 66

              #7
              Originally posted by Motoma
              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.
              Again, 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

              • Motoma
                Recognized Expert Specialist
                • Jan 2007
                • 3236

                #8
                Originally posted by cheesecaker
                Again, 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.
                Does the graceful restart option work?

                Comment

                • pushpinderbagga
                  New Member
                  • Sep 2007
                  • 10

                  #9
                  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

                  • pushpinderbagga
                    New Member
                    • Sep 2007
                    • 10

                    #10
                    :p












                    p

                    Comment

                    • cheesecaker
                      New Member
                      • Feb 2007
                      • 66

                      #11
                      Originally posted by Motoma
                      Does the graceful restart option work?
                      I'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

                      • Motoma
                        Recognized Expert Specialist
                        • Jan 2007
                        • 3236

                        #12
                        Originally posted by cheesecaker
                        I'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.
                        Well then, have you tried the un-graceful approach?

                        Comment

                        • cheesecaker
                          New Member
                          • Feb 2007
                          • 66

                          #13
                          Originally posted by Motoma
                          Well then, have you tried the un-graceful approach?
                          I'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.

                          Comment

                          • Motoma
                            Recognized Expert Specialist
                            • Jan 2007
                            • 3236

                            #14
                            Originally posted by cheesecaker
                            I'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

                            • docdiesel
                              Recognized Expert Contributor
                              • Aug 2007
                              • 297

                              #15
                              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, Bernd

                              Comment

                              Working...