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, 25 Jan 2011, 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?

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 :)

We have an automated approach... and I wrote my own PHP control panel for my hosting services some years back. It basically builds up the apache config file(s) (as well as email configs, accounts, etc.) I'm not proud enough of it to release it as GPL though... it's a bit "engineering" quality.

For MySQL is there is phpMyAdmin which is good if overly general purpose.

The biggest issue - as you've noticed - I had is that you can't run PHP as root inside apache - which you really don't want to do, but need to do, to do a few operations like restart sendmail and poke apache to reload it's config files, change ownership of files, etc. so I wrote a setuid program in C based on the suexec program that comes with apache to do a few very limited actions.

There are many free and non-free solutions though - webmin http://www.webmin.com/ is free and GPL, cPanel and Plesk are non-free and cost money.

It does mean that when you commit config files to automation, you lose the ability to hand-edit changes into them unless you're careful - although in the case of apache, you can allow overrides to set additional stuff in a .htaccess file.

If you're only playing with one or 2 sites then it's probably not worth it.

Gordon

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