apache2-common: a2ensite rewritten to allow globbing/multiple site enabling

Bug #84142 reported by speeves
4
Affects Status Importance Assigned to Milestone
apache2 (Debian)
Fix Released
Unknown
apache2 (Ubuntu)
Fix Released
Wishlist
Unassigned

Bug Description

Binary package hint: apache2-common

I have modified a2ensite to :

1. enable multiple sites at a time, (including file globbing).
  (Both from the command-line, and from the "Site Name?" prompt)
2. modified the sites-available listing to be columnar, as opposed to space-delimited.
  (Helps when you have hundreds of sites available).
3. allow for interactive or non-interactive modes, (using -f).
  (interactive mode prompts for confirmation before enabling a site).
4. generates a help message (-h).
5. I have also written a man page "a2ensite(8)", which documents all of the features that
I have included in this revision.

Revision history for this message
speeves (speeves) wrote :
Revision history for this message
speeves (speeves) wrote :
Revision history for this message
speeves (speeves) wrote :

This has been tested successfully on Ubuntu Edgy/Feisty (apache2-common and apache2.2-common) and Debian Sarge/Etch (apache2-common and apache2.2-common).

Revision history for this message
Loye Young (loyeyoung) wrote :

1. THANKS!!!
2. Is it possible for a2ensite to list only those sites that are not already enabled? Similarly, a2enmod should do the same.
3. Have you posted this upstream to Apache.org? If not, please do.

Loye Young
http://www.iycc.biz
Laredo, Texas

Revision history for this message
Paul Dufresne (paulduf) wrote :

Thanks for your suggested patch, I am rejecting this because this is not a patch for a bug, but rather a new feature patch.
However, I have posted a message on Apache development mailing-list, to ask someone for reviewing your patch.
My message should be readable at:
http://marc.info/?l=apache-httpd-dev&m=118297357029467&w=2

Changed in apache2:
status: New → Invalid
Revision history for this message
Paul Dufresne (paulduf) wrote :

I was informed that files like a2ensite (all a2* files in fact), are not part of official appache, but Debian specific.

Revision history for this message
Loye Young (loyeyoung) wrote : Re: [Bug 84142] Re: apache2-common: a2ensite rewritten to allow globbing/multiple site enabling

On Wednesday, June 27, 2007 4:33:32 pm Paul Dufresne wrote:
> I was informed that files like a2ensite (all a2* files in fact), are not
> part of official appache, but Debian specific.

I had forgotten that. It should go to the Debian Bug Tracking System.
http://www.debian.org/Bugs/Reporting

Revision history for this message
Paul Dufresne (paulduf) wrote :

Was already reported on Debian by initial reporter.
I have just added the link in Debian Bug tracking.

Reverting back to new, I would normally make it a wishlist, but I am not in QA Team.

Changed in apache2:
status: Invalid → New
Paul Dufresne (paulduf)
Changed in apache2:
status: New → Confirmed
Revision history for this message
speeves (speeves) wrote :

On 6/27/07, Paul Dufresne <email address hidden> wrote:
>
> ** Changed in: apache2 (Ubuntu)
> Status: New => Confirmed
>
> --
> apache2-common: a2ensite rewritten to allow globbing/multiple site
> enabling
> https://bugs.launchpad.net/bugs/84142
> You received this bug notification because you are a direct subscriber
> of the bug.
>
Thanks for looking at this guys! It sat in Debian BTS for quite some time,
so I thought that I might get more response from the Ubuntu developers. I
am actually starting down the path to becoming a Debian developer, as there
are issues in the apache packages which need to be addressed in Debian, (and
which will flow downstream to Ubuntu).

Paul, if you can put me in touch with the Apache maintainers in Ubuntu, I
would be more than happy to help maintain it...?

thanks

--
Shannon Eric Peevey
<email address hidden>
http://speeves.erikin.com

Revision history for this message
Paul Dufresne (paulduf) wrote :

The Ubuntu Maintainer is: Debian Apache Maintainers
Looking at http://packages.qa.debian.org/a/apache.html you will find emails of people.
Believe me, most co-maintainers are very active Ubuntu developers.
So I would really suggest you try to help on Debian side, Ubuntu take snapshot of Debian every 6 months.

Changed in apache2:
status: Unknown → New
Revision history for this message
Loye Young (loyeyoung) wrote :
Download full text (3.7 KiB)

While we're on a wishlist, I have something to consider while you're working
on a2ensite.

The issue is what to do with packages that put their config files
in /etc/apache2/conf.d? I'm talking about dwww, dpkg-www, roundcube, etc.
Because ./conf.d gets read before ./sites-enabled, the configurations
in ./conf.d can end up overriding ./sites-enabled/000-default. Also the conf
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/sites-available to avoid the
problem and soI can toggle them on and off with a2ensite. But more thought
should be given to this for the regular automated installation.

Perhaps 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-available/dwww.conf
./pkg-available/dpkg-www.conf
./pkg-available/drupal.conf
./pkg-available/mediawiki.conf
./pkg-available/mydms.conf
./pkg-available/roundcube.conf

./sites-available/default/
./sites-available/default/default.conf
./sites-available/default/dwww.conf --> ./pkg-available/dwww.conf
./sites-available/default/dpkg-www.conf --> ./pkg-available/dpkg-www.conf
./sites-available/site1.com/
./sites-available/site1.com/roundcube.conf --> ./pkg-available/roundcube.conf
./sites-available/site1.com/drupal.conf --> ./pkg-available/drupal.conf
./sites-available/site2.com/
./sites-available/site2.com/mydms.conf --> ./pkg-available/mydms.conf
./sites-available/site2.com/mediawiki.conf --> ./pkg-available/mediawiki.conf
./sites-available/site3.com/
./sites-available/site3.com/drupal.conf --> ./pkg-available/drupal.conf

./sites-enabled/000-default --> ./sites-available/default
./sites-enabled/site1.com --> ./sites-available/site1.com/
./sites-enabled/site2.com --> ./sites-available/site2.com/
./sites-enabled/site3.com --> ./sites-available/site3.com/

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-available/site4.com/ created.
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 new structure would look like this:
./sites-available/si...

Read more...

Revision history for this message
Paul Dufresne (paulduf) wrote :

I will deceived you, but I am not working on a2ensite, in fact I don't even understand what it does.
I am a member of bug squashing, making sure bugs are complete, then a QA should review the bug, then
make it <triaged>, indicating then to a developer that it is ready to be tackle.

By adding new suggestion in this bug, you are making it less clear for the developer what is going on with your suggested patch.

What you suggest seems to me a good candidate for a new specification.
Please read https://wiki.ubuntu.com/SpecSpec and take a look at:
http://blueprints.launchpad.net/ubuntu/ for examples of what it does looks like.

Changed in apache2:
importance: Undecided → Wishlist
status: Confirmed → Triaged
Revision history for this message
speeves (speeves) wrote :

On 6/28/07, Loye Young <email address hidden> wrote:
>
> While we're on a wishlist, I have something to consider while you're
> working
> on a2ensite.
>
>
>
Hi Loye,

I would open a new bug for this as a wishlist item. That way we can track
this separately.

thanks,

--
Shannon Eric Peevey
<email address hidden>
http://speeves.erikin.com

Revision history for this message
Loye Young (loyeyoung) wrote :

On Thursday, June 28, 2007 1:34:27 pm speeves wrote:
> I would open a new bug for this as a wishlist item.

Done. See https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/122885

Changed in apache2:
status: New → Fix Committed
Changed in apache2:
status: Fix Committed → Fix Released
Revision history for this message
Chuck Short (zulcss) wrote :

This has been added for intrepid. Thanks for the bug report.

Changed in apache2:
status: Triaged → Fix Committed
Chuck Short (zulcss)
Changed in apache2:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.