Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm backing up files on my server, but I'd like to know the location of the most important server configuration files. I.E. - if I lose everything on my server, but I want to come back with the same configuration settings for PHP, MySQL, CPanel, WHM, DNS, etc... - what folders must I backup to be sure I can have a smooth transition back?

Of course, the DB and all web-app files are backed up in other methods.

Thanks for the help.

CentOS5, CPanel/WHM, MySQL, PHP...

share|improve this question
up vote 1 down vote accepted

cPanel provides it's own backup facility, you can run it from shell/cron:

# /scripts/cpbackup --force

Configuration file resides in /etc/cpbackup.conf

MySQL database is usually stored in /var/lib/mysql, but it's safer to use mysqldump.

DNS configuration is located in /etc/named, but it's okay to backup /var/named too.

I also use etckeeper (can be installed from EPEL) to keep track of what was changed in /etc and optionally pull it with git/mercurial.

share|improve this answer

In general, /etc is the most important directory. In any Red Hat type system (as CentOS is), you'll find some settings in /etc/sysconfig, but that's pretty limited. Back up all of /etc to be safe.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.