Ubuntu: Saving/copy back configurations from Apache, Mysql? Because I want to reinstall Ubuntu 14.04 server.



Question:

On my server I have installed Ubuntu 14.04. Bind9, Apache, MySql etc worked fine, until a few month ago I got some problems with mailman. I don't know what happened, but I can't install, remove or reinstall mailman. And because the mailman-update isn't installed, it keeps coming back and is prefenting me from updating other software (e.g. Bind9, Mysql, etc) when available. :(

Now, I want to install Ubuntu 14.04-server from scratch. But this means I have to configure all the server software. Unless there has to be a way that the configurations that are made in Bind9, Apache, Mysql, etc can be copied to e.g. an external USB-harddrive, and later, can be copied back to the fresh installed Ubuntu 14.04-server harddrive.

If this is possible, which files (and/or folders) do I have to copy to external harddrive for:

  • Apache

  • Bind9

  • Mysql

  • Postfix

I would be great if this is possible. It would save me a lot of time. ;)

Kevin


Solution:1

I've been working along the same lines. I have made this list of files & directories that I rsync to my backup. At some point I have edited or done something to each of these. Configurations will vary (for example, I use nullmailer instead of postfix, and I don't have mysql), but perhaps this will be a starting point for you.

/etc/apache2   /etc/sysctl.conf   /etc/fstab   /etc/bind   /etc/host.conf   /etc/modsecurity   /etc/fail2ban   /etc/psad   /etc/ufw  /etc/ddclient.conf   /etc/default/ddclient   /etc/default/bind9  /etc/ssh   /etc/rkhunter.conf   /etc/openvpn   /etc/hosts  /etc/nullmailer  /etc/mailname  /etc/samba  /etc/rsyslog.d/20-ufw.conf  /etc/sudoers.d/sudoers  /etc/tripwire  /etc/pwrstatd.conf  /etc/pwrstatd-email.sh  /etc/pwrstatd-lowbatt.sh  /etc/pwrstatd-powerfail.sh  /lib/ufw   /usr/share/modsecurity-crs   /usr/share/GeoIP  /usr/share/logwatch    /var/www  


Solution:2

During an upgrade the mailman troubles started ? Can you try : sudo dpkg -P mailman

If that doesn't work, do : sudo dpkg -i --force-all /var/cache/apt/archives/mailman*

(If that gives troubles : sudo apt-get -f install) and then try : sudo dpkg -P mailman to purge mailman package.

Regarding backups, if you rsync /etc/ /var/lib/ /var/www/ then things should be fine in general.

In Debian/Ubuntu based server installs /etc/ is where all config files live, and in /var/lib/ there's e.g. mysql, LDAP, samba directories which have some importance. For mysql it is actually recommended to use mysqldumps as well, especially if you use innoDB format.

On servers I always like to install automysqlbackup package.

sudo apt-get install automysqlbackup  

http://packages.ubuntu.com/search?keywords=automysqlbackup

It is really easy and convenient to have.

You can install it, and it will then use a cronjob to put nightly backups in /var/lib/automysqlbackup/daily/ but you can run the command "automysqlbackup" right away with sudo right to produce that mysqldump on the fly, ready to be copied to your backup location.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »