Discussion:
Freely choose DocumentRoot for vhosts without restarting Apache
(too old to reply)
SuperSachin
2012-02-14 16:39:44 UTC
Permalink
To avoid Apache restart, "Dynamically Configured Mass Virtual
Hosting" (http://httpd.apache.org/docs/2.0/vhosts/mass.html) is used.
But, --in this case-- Apache takes vhost configurations from directory
pattern. So, I am not free to choose DocumentRoot directory which
doesn't match with selected pattern. For example, if I have set
pattern like ...user/www/domain/subdomain, I will have to create
directories like the pattern to add a domain/subdomain as vhost.

But, cPanel allows its users to freely choose DocumentRoot for add-on
domains & subdomains they add. And, it doesn't restart Apache each
time a change is made. Changes are instantaneous too.

What does cPanel exactly do to Apache configurations?
I've guessed that it has to do with the same Dynamically Configured
Mass Virtual Hosting, but I've given up after few days of
brainstorming.

Can you please help?
Mads Toftum
2012-02-19 11:06:40 UTC
Permalink
Post by SuperSachin
But, cPanel allows its users to freely choose DocumentRoot for add-on
domains & subdomains they add. And, it doesn't restart Apache each
time a change is made. Changes are instantaneous too.
What does cPanel exactly do to Apache configurations?
I've guessed that it has to do with the same Dynamically Configured
Mass Virtual Hosting, but I've given up after few days of
brainstorming.
The most likely way of doing this is symlinks. That'll make it all dynamic at the cost
of slowing down slightly because of the extra filesystem access.

vh

Mads Toftum
--
http://soulfood.dk
SuperSachin
2012-02-21 13:17:32 UTC
Permalink
Post by SuperSachin
To avoid Apache restart, "Dynamically Configured Mass Virtual
Hosting" (http://httpd.apache.org/docs/2.0/vhosts/mass.html) is used.
But, --in this case-- Apache takes vhost configurations from directory
pattern. So, I am not free to choose DocumentRoot directory which
doesn't match with selected pattern. For example, if I have set
pattern like ...user/www/domain/subdomain, I will have to create
directories like the pattern to add a domain/subdomain as vhost.
But, cPanel allows its users to freely choose DocumentRoot for add-on
domains & subdomains they add. And, it doesn't restart Apache each
time a change is made. Changes are instantaneous too.
What does cPanel exactly do to Apache configurations?
I've guessed that it has to do with the same Dynamically Configured
Mass Virtual Hosting, but I've given up after few days of
brainstorming.
Can you please help?
I don't know how cPanel does it, but I've found the solution. If you
are curious:
Apache provides "apachectl" which reloads configuration files without
terminating current connections to server (command: "apachectl
graceful"). If you haven't compiled from source, its name may be
different from system to system. With default apt-get package
installation on Debian, its binary was /usr/sbin/apachectl.

Loading...