LAMP Webhosting Question - Aliases

CaptainKahuna

Platinum Member
May 19, 2002
2,228
0
0
www.billda.com
OK, here's my slightly complex situation:

I need to maintain phpBB installs at /duke and /unc and /wfu and /clemson, etc. These are custom phpBB installs, however they will use the same code, the only difference is the config.php in the root directory which tells them which mySQL database to connect to.

Now, I could simply copy all the files to every directory and edit the config.php's. However, should I need to make a change to a file, I need to make it in every directory. So my question is - is there a better way?

I think that I should be able to keep a "master directory" with the files, and create aliases to them in all of the directories. That way, I would only have to change the one file that all the aliases point to, and all the phpBB installations are affected. The only file that would not be an alias would be config.php, which specifies the database settings.

Would this work? How do I go about setting this up?
 

cleverhandle

Diamond Member
Dec 17, 2001
3,566
3
81
I don't know anything about phpBB, so I'm just thinking of general ways to accomplish this...

The elegant solution would be to modify the PHP code to detect what site is being called and use the appropriate database config - then everything could live happily in just one directory. If you know some PHP already, this would probably not be terribly hard to do. Also, you may want to check if someone has already done something like this.

A hacky solution would be to use lndir to duplicate directories with symlinks. Basically, lndir makes a copy of a directory tree, duplicating original directories with new directories and original files with symlinks. You could do the same thing by hand, but it would take forever. So long as your Apache server is set to follow symlinks, I think that should work. For config.php, of course, you would delete the symlink and make a real copy instead.