The environment I work in is a complex mess of COTS tools and custom developed code. We're preparing to bring up a new server farm, and clean up this inherited mess and as the lead developer I'm tasked with making some critical development decisions with regard to this environment.
One of these decisions is surrounding data connectivity. Currently, every application has it's own data configuration file, or the server names are hardcoded in the files. I completely hate this, as when we prepared to bring up a new mysql server, it was a nightmare task of searching and find/replace in files.
I was contemplating adding a PHP variable in the Apache Config, but that wouldn't help with COTS tools, unless I modify their configuration:
SetEnv mysql.server "localhost"
We currently make use of SetEnv to configure things like CakePHP paths
SetEnv cake_includes_path "/path/to/lib/"
SetEnv cake_apps_path "/path/to/apps/"
The change I'm attempting to make is standardizing the server configuration. I'm planning to add a host entry into the web servers called mysql.server. This will allow all the COTS tools to easily be configured to use the server, as well as any coding applications.
Does anyone have any other best practices with load balanced Apache servers in terms of database connectivity?