logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


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: Restart service after adding vhost
Author
Materix



Joined: 30 Aug 2012
Posts: 41

PostPosted: Wed 05 Jun '24 10:47    Post subject: Restart service after adding vhost Reply with quote

Does it require a full restart of Apache (when running as a service), after adding a new vhost to the configuration?
Back to top
James Blond
Moderator


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

PostPosted: Wed 05 Jun '24 12:50    Post subject: Reply with quote

Yes, you need to restart to make the changes known to the apache process.
Back to top
Materix



Joined: 30 Aug 2012
Posts: 41

PostPosted: Wed 05 Jun '24 13:08    Post subject: Reply with quote

When running Apache as a service on a Windows server, is there a stable method to set Apache to restart once per day?
Back to top
Otomatic



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

PostPosted: Wed 05 Jun '24 14:48    Post subject: Reply with quote

Hi,

With the task scheduler, create a task once a day at the time of your choice.
Code:
httpd.exe -n service_name -k restart

It is a graceful restart of Apache.

Maybe it won't be enough to support the new VirtualHost, in which case you'll have to stop and restart the service with a batch file. For example:
Code:
net stop service_name
net start service_name

or
Code:
httpd.exe -n service_name -k stop
httpd.exe -n service_name -k start
Back to top
James Blond
Moderator


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

PostPosted: Wed 12 Jun '24 11:01    Post subject: Reply with quote

A side note: The graceful restart might be preferred since it does not kill an active connection. And the graceful restart is enough to get a new vhost working.
Back to top
Materix



Joined: 30 Aug 2012
Posts: 41

PostPosted: Wed 12 Jun '24 11:38    Post subject: Reply with quote

Awesome, thanks for the advice.

Apachelounge.com is the most valuable resource of all for people running Apache on Windows.
Back to top


Reply to topic   Topic: Restart service after adding vhost View previous topic :: View next topic
Post new topic   Forum Index -> Apache