New a2enpkg / a2dispkg script should be written - Improve virtual host configuration
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
apache2 (Ubuntu) |
Fix Released
|
Wishlist
|
Unassigned |
Bug Description
Binary package hint: apache2
I have a wishlist item for the community to consider.
The issue is what to do with packages that put their config files
in /etc/apache2/
Because ./conf.d gets read before ./sites-enabled, the configurations
in ./conf.d can end up overriding ./sites-
files in /etc/apache2/conf.d affect all sites, which isn't necessarily what
is intended.
I usually end up moving them to /etc/apache2/
problem and soI can toggle them on and off with a2ensite. But more thought
should be given to this for the regular automated installation.
What I would like is a new script a2enpkg and a2dispkg that operate similarly
to a2ensite / a2dissite and a2enmod / a2dismod.
Each site should get a subdirectory in ./sites-available so that conf
files can be separately maintained for each site. a2ensite would do
essentially as it does now, but the include statement in apache2.conf would
be recursive.
I'm thinking we'd treat the various packages something like the sites, with
a ./pkg-available directory. A new script "a2enpkg" that would copy the
pkg.conf file to the site's subdirectory.
E.g.,
./conf.d/ # for things affect everything on the server
./conf.d/charset
./conf.d/portmap
[snip modules stuff]
./pkg-available/ # packages available to virtual server
./pkg-
./pkg-
./pkg-
./pkg-
./pkg-
./pkg-
./sites-
./sites-
./sites-
./sites-
./sites-
./sites-
./sites-
./sites-
./sites-
./sites-
./sites-
./sites-
./sites-
./sites-
./sites-
./sites-
a2enpkg would act something like this:
What package do you want to enable? Choices are:
dwww dpkg-www drupal mediawiki mydms roundcube
-> mydms roundcube
For which sites do you want to enable the packages? Choices are:
default site1 site2 site3 new
--> new
What is the name of the new site?
--> site4.com
Creating new directory site4 in ./sites-available . . . .
Directory ./sites-
Do you want to keep the default configurations or specially configure mydms?
--> default
Creating symlink in site4 to mydms.conf . . . .
Do you want to keep the default configurations or specially configure
roundcube?
--> special
Copying roundcube.conf to site4 . . . .
When you are ready to enable site4.com, run a2ensite.
Done.
The added file structure would look like this:
./sites-
./sites-
./sites-
In this way, the functionality of the server would become modular in the same
way as the sites and the modules. It would allow an admin to install a new
package and get it configured before turning it on with a2enpkg. Similarly,
a2dispkg would turn off the functionality for a particular site quickly and
easily.
From what I've seen of the a2ensite and a2enmod scripts, it should be fairly easy to
adapt that code to this idea.
Of course, everything will work the way it is, so it's not anything to kill
ourselves over. But I'd be interested in what others think about the idea.
Changed in apache2: | |
status: | New → Triaged |
Thank you for your suggestion.
a2enpkg and a2dispkg are scripts developed by the apache2 debian maintainers. The feature change you're proposing should also be discussed with them. Opening a bug in the Debian But Track system could be the first step in that direction.