logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in  RSS Apache Lounge  


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.


Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Graceful Restart on Windows
Author
Otomatic



Joined: 01 Sep 2011
Posts: 44
Location: Paris, France, EU

PostPosted: Tue 27 Jul '21 12:56    Post subject: Graceful Restart on Windows Reply with quote

Hi,

As I understand it, a "Graceful Restart" Apache means, reloading the Apache Configuration(httpd.conf) without restarting the Web Server. When we do the Graceful Restart it only reloading the Configuration file and do not restart the Apache Web Server. So the currently open connections will not be aborted.

When Apache is started as a service, a graceful restart can be performed by :
Code:
httpd.exe -n ServiceName -k restart

and it works very well.

I want to integrate this possibility in the next version of Wampserver, but Wampserver can work with any version of Apache 2.4 (2.4.4 to 2.4.48 ) and I would like to know if this "Graceful Restart" under Windows was possible with all versions of Apache in order to eventually limit the "Graceful Restart" to Apache versions supporting it.

Thank you.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 6998
Location: Germany, Next to Hamburg

PostPosted: Tue 27 Jul '21 16:15    Post subject: Reply with quote

A graceful restart is a full restart. It is only so "graceful" so keep the current client connection. Apache starts a new child process with the "new" config file and maybe different loaded modules. The old child process dies after the last client has closed the connection.

On Windows there are only graceful restarts with httpd apache.

Well, you can't exchange the running binary on windows. So you have to stop apache and start the new version. I recommend to use a different folder for the new version. Stop the old one and spin up the new one. The interrupt can be less than a second, if done via script.
Back to top
Otomatic



Joined: 01 Sep 2011
Posts: 44
Location: Paris, France, EU

PostPosted: Tue 27 Jul '21 17:17    Post subject: Reply with quote

Hi,

I explained myself wrong!
It's not to change Apache version with a Graceful Restart, but to know if all Apache versions (2.4.4 to 2.4.4Cool support Graceful Restart.

The main goal is to be able to create VirtualHosts and to make Apache take them into account without having to restart the server.

Thanks
Back to top
tangent



Joined: 16 Aug 2020
Posts: 125
Location: UK

PostPosted: Tue 27 Jul '21 21:47    Post subject: Reply with quote

My understanding has always been that Apache Web Server on Windows only supports Graceful Restarts.

If you look in server\mpm\winnt\mpm_winnt.c you'll find the following comment in the ap_signal_parent() function.
Code:
/* This MPM supports only graceful restarts right now */   

A quick check shows this comment is present in Apache release 2.4.1 and 2.4.48, so I'd say it's reasonable to assume it's valid for all intervening releases of the 2.4 series.

The comments preceding the ap_signal_parent() function, starting at "Signalling Apache on NT", are equally similar, although the module code has clearly been refined and improved through the various releases.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 6998
Location: Germany, Next to Hamburg

PostPosted: Wed 28 Jul '21 8:34    Post subject: Reply with quote

Otomatic wrote:

The main goal is to be able to create VirtualHosts and to make Apache take them into account without having to restart the server.


httpd Apache has to be restarted to read the new configuration. Unless you use mod_vhost_dbd[1]. I haven't seen a release since 2012, but it compiles against Apache 2.4.x and on windows.



[1] https://sourceforge.net/p/dbd-modules/code/HEAD/tree/
Back to top


Reply to topic   Topic: Graceful Restart on Windows View previous topic :: View next topic
Post new topic   Forum Index -> Apache