• Home
  • Jobs
  • Courses
  • Questions
  • Teachers
  • For business
  • ES/EN

0

51
Views
Handle multiple domains without restarting HTTP server

Let's assume I have multiple domains pointing to one server. I know that I can have multiple virtual hosts in Apache for example, but every time I want to add a new website I have to change the configuration and restart the server.

I am looking for hosting multiple domain names without having to create a config file each time. Why ? because after creating a config file, I have then to restart the HTTP server which means that each domain I add will block all the other domains for a period of time.

Basically I want a config or program that points dynamically each domain to a sub-folder of my main source code without having to create a config file or restarting the HTTP server.

Please let me know if this is doable with the current HTTP servers or if not point me to some resources that will help me do this programatically.

3 months ago ·

Santiago Trujillo

2 answers
Answer question

0

With most standard web servers you simply cannot do this without a restart or at least reload of the service (so it picks up the new configs).

Of course you could build your own solution, based on your requirements.

3 months ago · Santiago Trujillo Report

0

You can reload the server without restart it, a reload keep the active connections up, so you can load the changes in your configuration without restarting the server.

Command for nginx: nginx -s reload

I suggest to use nginx -t && nginx -s reload in order to check the configuration before reloading

Command for Apache: apachectl -k graceful, systemctl reload httpd.service, service apache2 reload, service httpd reload (it depends on your environment)

3 months ago · Santiago Trujillo Report
Answer question
Find remote jobs
Loading

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post job Plans Our process Sales
Legal
Terms and conditions Privacy policy
© 2022 PeakU Inc. All Rights Reserved.