Apache2 and virtual hosts

E K ekg_ab-FFYn/CNdgSA at public.gmane.org
Tue Jul 17 17:46:21 UTC 2007


--- Madison Kelly <linux-5ZoueyuiTZhBDgjK7y7TUQ at public.gmane.org> wrote:

> Jamon Camisso wrote:
> > Madison Kelly wrote:
> >> Hi all,
> >>
> >>   I'm using Debian and Apache2, which uses individual files for 
> >> virtual hosts. Currently, if any one of the VH containers are 
> >> misconfigured, Apache2 as a whole won't come back up on restart
> or 
> >> will fail on reload.
> >>
> >>   I am writing a management console for our customers who host
> with 
> >> us, and I would like to allow them to edit their own VH
> container 
> >> file. I worry though that a user will make a mistake and take
> the 
> >> whole web server down.
> >>
> >>   Is there a way anyone knows up that I can tell Apache to
> disregard a 
> >> misconfigured VH container (possibly send an alert) and continue
> 
> >> loading the rest of the virtual hosts?
> > 
> > Try apache2ctl -S to at least get an idea if the syntax is
> correct. If 
> > not, maybe a conditional to restore the config(s) from a backed
> up known 
> > working copy?
> > 
> > How about a gui point and click check/radio box type interface
> for 
> > various options? That way your script controls the input but the
> user 
> > gets to choose their options.
> > 
> > Jamon
> 
> I can certainly try validating the syntax first, but was still
> hoping to 
> set Apache2 to ignore defective VH containers, "just in case". :)
> 
> I was thinking about restricting the simple interface options like
> you 
> mentioned, but our clients are, generally speaking, fairly
> technically 
> literate. Certainly any who would want to edit their VH container
> would 
> be. So I want to give them as much flexibility as possible. If I
> can't 
> find a way to adequately guard Apache2 against misconfigurations
> though, 
> I will have to do this.
> 
> Madi
> --

You can delete the soft link in /etc/apache2/sites-enabled which is a
link to the actual configuration file in /etc/apache2/sites-available
if there is a problem with a configuration which you can check using
apache2ctl -S. You can restore the link on the next edit after making
sure that the configuration is alright.

Apache loads the sites in the /etc/apache2/sites-enabled directory.

That is how I do it on Ubuntu.

Hope that helps.

EK

> The Toronto Linux Users Group.      Meetings: http://gtalug.org/
> TLUG requests: Linux topics, No HTML, wrap text below 80 columns
> How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists
> 



      Be smarter than spam. See how smart SpamGuard is at giving junk email the boot with the All-new Yahoo! Mail at http://mrd.mail.yahoo.com/try_beta?.intl=ca

--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list