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...
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.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 usemysqldump
.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.