views:

7

answers:

1

The common issue: you move an application from one server to another, usually this means other directories to configure in your application configuration files and in apache conf files.

How can you minimize if even eliminate the hardcoded paths in config files?

In my case these applications are in languages like PHP, Python, Perl or Ruby. I will keep Java out of this question because for Java there are different ways of doing this.

I'm looking for a solution that would enable you to ease these troubles, one that would allow you to keep the config files in SCM and deploy them to one or more servers.

Please, do not vote this to be moved on serverfault.com, it is a question regarding how do you setup your development, staging and production environment.

A: 
$ ls ./apache-config-files
development.cnf  staging.cnf  production.cnf

$ ln -s ./apache-config-files/staging.cnf ./.htaccess
Justice
Let me explain a little bit, this is more about what you put inside these config files, like the path to the location of your applications. Is there a way to make this less dependent on a hardcoded path that is different on RedHat and Ubuntu for example.
Sorin Sbarnea