views:

26

answers:

1

Hi,

We have a web app built on codeigniter. We have a VPS, with different accounts on it. I was wondering how can we setup in a way that there will be only one copy of the php code for all accounts. each account will have a different domain name, and each account will have their own mysql database.

Therefor: code sits on a folder on the server called mycode. example1.com has it's own db but runs the code sitting on mycode. example2.com has it's own db but runs the code sitting on mycode.

the vps server has a WHM for the hosting manager, and all other accounts will have their own cpanel: example1.com/cpanel...

thanks,

+1  A: 

What OS is the VPS running?

If it is 1 VPS with multiple user accounts and running Linux/Unix you can try configuring symbolic links within each account pointing to a common code base.

Another option is to put together a script to copy your code from a central location to the appropriate location for each account. You can either call the script manually or have it scheduled to run periodically. You can also tie in your favorite version control system to make things a bit easier.

pferate
`rsync` would be ideal for such a script, though symlinks are far more likely to Just Work(tm).
Charles