D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Apache Web Hosting Automation

 

On Tue, 2011-01-25 at 20:03 +0000, Gibbs wrote:
> I'm setting up a web hosting environment on a VPS I have (for fun and 
> learning initially) and already have virtual users setup in a database. 
> Now I want to create a web front-end to create the necessary apache 
> config files, directories etc to automate the creation of virtual hosts 
> and new websites. I won't have the back-end do this directly, as root 
> access will be required, so I'm trying to think of an approach to this - 
> maybe a cron job?

Cron jobs work well for this kind of thing, insert the row into the
database from the webfront-end and then have the crontab check the DB
and set a flag on the row to say the setup has already been done.

> Does, say, a web hosting company manually set up websites on Apache or 
> is it common to take an "automated" approach like I'm trying to achieve? 
> It just seems a bit laborious having to manually configure everything 
> and be needed to do it :)

use mod_rewrite and RewriteMap to make life easy on youself, that way
you have a single configuration file which reads the paths from either
the database or the filesystem and applies settings accordingly instead
of having one config file for each site.

HTH,

M.
-- 
Matthew Macdonald-Wallace
matthew@xxxxxxxxxxxxxxxxxxxxx
http://www.threedrunkensysadsonthe.net/


-- 
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/listfaq