On 19.11.2011 20:23, Olivier Beaton wrote:
And it should be noted that all you rename in
debian-apache are softlinks
in the mods-enabled and sites-enabled directories. You would keep
regular
non-prefixed filenames in mods-available and
sites-available. Using this
method you could also allow some of your users to own the files
themselves
(although this is a security risk, you may want
to install a panel if you
have many users).
If you don't need to micromanage the load order of a module, debian
provides some useful commands for enabling and disabling mods and sites.
a2enmod a2dismod,
a2ensite a2dissite.
They merely take the name of the module / vhost in -available directories
and it creates or removes the site without having to comment out large
chunks of files. And by using these soft links you can keep the
configuration for the vhost while still removing it, without having to
move
it or rename it. It's convenient.
> From what I understand all this isn't great with puppet though, and
many
of
those users (like wmf) just flatten the whole
thing into a single
configuration file, which is your prerogative.
If one wants to have their virtual hosts in separate small files, there
is much better setup than Debian / Ubuntu offers:
1. Create separate small virtual hosts files as usual.
2. Include them line by line in main httpd.conf file.
3. Change of virtual hosts order is a simple line cut / paste in
httpd.conf file. Enabling / disabling one virtual host is just a #
character in the start of the line.
4. No symlinks, no silly numeric prefixes.
5. The utility that manages these one line includes in httpd.conf can be
developed as well.
6. Single httpd.conf file read/write is atomic.
7. There is no guarantee that every FS will list the filenames in dir in
ascending literal order. Although modern do, of course.
etc.
Dmitriy
"Better" here is clearly in the eye of the beholder. The system you've
just described is virtually semantically identical to the Debian/Ubuntu
setup: you have a load of small vhost files, create a list of them sorted
however you want, and get apache to load them all in order. Having the
list as symlinks is easier and safer to script, as the corresponding OS
filesystem functions are very well defined, but ordering the list is a
little more difficult. If you put the list in httpd.conf as a list of
includes you are dependent on having a safe and effective system for
editing it via script, which is substantially harder to develop; but the
ordering is a little more elegant.
Personally I'd say that the list-of-includes method was the "ugly option"
"reminding me of ancient programming languages" and the symlink method was
the "better setup", but there's no cast-iron reason why it should be so;
it's basically a personal preference. It's the sort of distinction you'd
discuss over a beer or ten, not one to discuss with the expectation of a
meaningful outcome.
--HM