Web Hosting Talk







View Full Version : config files and version control


Meridien
06-17-2002, 08:55 AM
I'm considering managing all config files under version control on my RH 7.1 installation. Using /etc/hosts as an example, how about this approach:

1. create a top-level directory named config
2. In /etc, mv hosts to /config
3. in /etc, create a link to /config/hosts named hosts
4. import /config/hosts as a new sysconfig project into cvs

Basically, you would wind up with all configuration files in the /config directory and in their reespective places would be a link to the real files in /config. You could edit the file in it's ordinary place or from within the /config directory.

Let's say that you're adding a new virtual host to httpd.conf. You would need to edit httpd.conf, named.conf, named.xxx.xxx.xxx (reverse dns), and named.newvirtualhost.com. Then you'd need to restart named and httpd.

If all of these files were under version control and the updates were correct they could be committed with a single command:

cvs commit -m "added newvirtualhost.com" sysconfig

Is this just busy-work? It does give you a history of changes to your installation that is useful and valuable, but is there a better way? I don't use a control panel (as I'm sure you guessed).

Thanks in advance for opinions.

Ahmad
06-17-2002, 11:32 AM
If you are used to use cvs or you are going to, then it's a nice way to keep old versions of config files.

If you just need to keep copies of the old files, you can create a shell script that gets all these files from there respective places, tar, gzip and store them somewhere.

However, cvs gives you extra features like quick rollback to older versions, update notes, easily compare different versions of the files, store only updates in files (save space?), as well as other features related to concurrent editing (merging, conflict resolution, branches, .. etc).