views:

305

answers:

2

I would like to build an 'ideal' lamp development stack.

  • Dual Server (Virtualised, ESX)
    • Apache / PHP on one, Databases (MySQL, PgSQL, etc) on the other.
  • User (Developer) Manageable mini environments, or instance.
    • Each developer instance shares the top level config (available modules and default config etc)
    • A developer should have control over their apache and php version for each project.
    • A developer might be able to change minor settings, ie magicquotes on for legacy code.
    • Each project would determine its database provider in its code

The idea is that it is one administrate-able server that I can control, and provide globally configured things like APC, Memcached, XDebug etc. Then by moving into subsets for each project, i can allow my users to quickly control their environments for various projects.

Essentially I'm proposing the typical system of a developer running their own stack on their own machine, but centralised. In this way I'd hope to avoid problems like Cross OS code problems, database inconsistencies, slightly different installs producing bugs etc.

I'm happy to manage this in custom builds from source, but if at all possible it would be great to have a large portion of it managed with some sort of package management. We typically use CentOS, so yum?

Has anyone ever built anything like this before? Is there something turnkey that is similar to what I have described? Are there any useful guides I should be reading in order to build something like this?

A: 

My take on the issue, i don't think it covers all of your requirements, but it's pretty close:

  • Have a CentOS server with LAMP stack ( yum install apache2 mysql php etc. ) - or 2 servers one httpd and one mysqld
  • For n developers have n folders with n virtual hosts www.developer-n.com on the host that runst the Apache server
  • Each developer mounts it's server folder (say //192.168.0.1/home/developer-n/www) on the local machine via CIFS in the local-station's /etc/fstab and edits the files from local machine yet runs them on the (unique) server
  • Each developer mini-environment is tweaked via .htaccess
clyfe
You're talking about what is currently implemented, so not really the answer :) plus i established above that tweaking the config via .htaccess is inappropriate.
devians
What does "it would be inappropriate to mangle them" mean?
clyfe
+3  A: 

OK, the way we were running development LAMP setup at my previous job, was like this. A single server running both MySQL and Apache. Each developer is assigned an IP address on the server (the machine is running multiple IPs on the same interface, all IPs are on the same subnet), so each developer can have at least one IP-based virtual host and as many name based as they want (our web site used SSL, so we needed separate IPs, wigthout SSL, you can get away with a single IP and name based vhosts). We had local DNS server serving wildcard A records for each developer in this manner *.john.dev.company IN A 10.1.1.123, where 10.1.1.123 was IP address assigned to John. This way John could define as many name based vhosts as he wanted and they would all get resolved correctly as long as they all ended in john.dev.company (like project1.john.dev.company). Each developer had their own apache config file with their virtual hosts in it and we used Include directive to pull all these files into the main Apache config. The permissions were set, so these config files would be editable by respective developers and each developer had a soft link to their config in their home directory. Also, every developer was allowed to use sudo to restart Apache. The downside of this setup was that once in a while a particular dev would crash entire server by screwing up their config file. We used common database, since everyone was working on a single project, but it shouldn't be difficult to setup multiple individual databases.

Mad Wombat