Results 1 to 10 of 10
-
10-26-2005, 08:20 PM #1Web Hosting Guru
- Join Date
- Nov 2004
- Posts
- 261
Apache: How to add domain without restarting
We are moving to a new server and was wondering if it would be better to use Apache 1.3 instead of Apache 2? Meaning are there any "plugins" for Apache 1.3 that would allow to add domains to apache without restarting it and from a "GUI"?
I wanted to write a script via php to allow users to add domains via a web based gui. I can use MyDNS for the DNS entries, but you still need to add it to Apache config file right?
Thanks
Silly
-
10-26-2005, 08:22 PM #2Web Hosting Guru
- Join Date
- Nov 2004
- Posts
- 261
To explain it a little better, isnt there a plugin to administrate apache via a database like mysql? If so is it for Apache 1.3 or 2?
Thanks
Silly
-
10-27-2005, 10:47 AM #3Junior Guru Wannabe
- Join Date
- Oct 2005
- Location
- Quebec
- Posts
- 60
I know you can issue a kill -USR1 and this will restart apache. This will restart the apache server gradually, as soon as a pid is done serving it's request it will re-read the configuration and then be ready to serve more without killing current connections. If you script something in php you might want to consider this.
-
10-27-2005, 10:50 AM #4Web Hosting Guru
- Join Date
- Nov 2004
- Posts
- 261
After doing a little research I can better ask the question. I want to administrate domain names. Is there a mod in Apache that will store the domain names in mysql so that the user can login and administrate their domains via a gui instead of me manually having to add their domain to the httpd.conf file?
If so, do I still have to restart Apache in order for the changes to take affect? If I do have to restart Apache, is there a way to do it from a script instead of me logging into the server and manually restarting it?
Thanks
Silly
-
10-27-2005, 12:08 PM #5WHT Addict
- Join Date
- May 2004
- Location
- Hungary
- Posts
- 106
If the subdomain is the same as a subfolder in the user's home folder, you can make subdomains that will automatically display the content of the corresponding folder (eg. test.domain.com points to the test folder). This way you (or cron) don't have to restart Apache.
If you want a GUI, you can e.g. write a PHP scripts that edits your httpd.conf and a cron daemon checks the modification time and restarts Apache, if needed.
-
10-27-2005, 01:50 PM #6Web Hosting Guru
- Join Date
- Nov 2004
- Posts
- 261
Hmm. I found a mod that supposidly stores everything in a database and doesnt require a restart. I originally was going to use sqlinclude mod, but that still required a reboot. I was thinking of just using a cron to do a graceful everynight to make all changes go into affect. But then I found this links:
http://www.crazygreek.co.uk/content/mod_shapvh
Anyone have any experience with this mod?
Thanks
Silly
-
10-27-2005, 03:40 PM #7
There really isn't a way to add something to apache without "restarting". Anything claiming this is quite off.. Unfortunately, it's just not a feasible or possible solution, and here's why.
Apache must be physically told where to look for certain things, how to long some things, how to handle ssl redirects for domains, subdomains, etc. It looks for all of this in the configuration files, not a database, or something else.
Realistically, restarting apache takes about 5 seconds, seriously, so why even worry about restarting it? It's not like it takes 5 minutes , restarts the entire server, thusly affecting ftp, email, etc. It's apache, it restarts quickly and effectively.Tom Whiting, WHMCS Guru extraordinaire
Linux problems? WHMCS Problems? Give me a shout
Check out my WHMCS Addons
-
10-27-2005, 03:43 PM #8Web Hosting Master
- Join Date
- Dec 2004
- Location
- New York City, NY, USA
- Posts
- 735
Just to point out what I think is a superior strategy... Why not write out new Apache configuration files every time someone adds a domain? You can then use the USR1 signal (typically simplified on most distributions with `/etc/init.d/apache reload`) to force Apache to reload configuration files.
Apache is already an extremely complex piece of software; having it depend on another complex relational database software is just asking for trouble.Samat Jain | Rhombic Networks, LLC - Partner, CTO
-
10-27-2005, 05:16 PM #9Web Hosting Master
- Join Date
- Aug 2005
- Location
- Canada
- Posts
- 862
I found a few of them, the other day.
http://www.outoforder.cc/projects/apache/mod_vhost_dbi/
http://www.oav.net/projects/mod_vhs/
Personally, I think it's better to avoid MySQL, though ...
I've been thinkgin about modified mod_vhost_alias, or something like that.
-
10-27-2005, 10:22 PM #10Newbie
- Join Date
- Oct 2005
- Posts
- 5
Maybe I'm missing something but why don't you just use dynamic virtual hosts?
Code:NameVirtualHost *:80 <VirtualHost *:80> VirtualDocumentRoot /usr/local/www/data/vhosts/%2+ </VirtualHost>