Showing posts with label backup. Show all posts
Showing posts with label backup. Show all posts

Sunday, 4 October 2009

Installing Mediawiki using SQLite Database in GNU/Debian

NOTE: These article commands have been tested in GNU/Debian Sid. They should also work in Ubuntu flavours.

First we need to install php, apache and SQLite if they are not installed. This command will do the trick:
#apt-get install php5-sqlite

Following mediawiki recommendation we add some extensions to php for SQLite to work:
Edit /etc/php5/apache2/php.ini
Add these two lines in that file:

extension=php_pdo_sqlite.so
extension=php_pdo.so


To solve servername warning when launching apache daemon:
#echo "ServerName localhost" >> /etc/apache2/httpd.conf

We start apache web server:
#apache2ctl start


DOWNLOAD MEDIAWIKI SOURCE CODE


#cd /var/www

We get latest mediawiki source code tarball (current one when writting this article is 1.15.1):
#wget http://download.wikimedia.org/mediawiki/1.15/mediawiki-1.15.1.tar.gz

Uncompress it:
#tar xvfz mediawiki-1.15.1.tar.gz
#cd mediawiki-1.15.1
#ln -s mediawiki-1.15.1 mediawiki

We set writting permissions to config directory so we will be able to configure our wiki:
#chmod a+w config


CONFIGURING THE WIKI

Monday, 30 July 2007

Backup your system using TAR

My system is a Debian Sid one (This article was first tested in an Ubuntu Feisty system)
Anyway this article is also useful in most other linux distros.

Tar tool allows us to make backups or even restore them, while our system is running.


It is a good idea becoming root to be able to access every file on the system, or at least you should use sudo command:

$sudo tar cvzpf /home/Backup.tgz --same-owner --exclude=/home/Backup.tgz --exclude=/home/error.log --exclude=/proc/* --exclude=/media/* --exclude=/dev/* --exclude=/mnt/* --exclude=/sys/* --exclude=/tmp/* / 2>/home/error.log


Tar options and arguments


c creates a tar backup
v activates verbose mode
z will compress data using gzip format
p preserves file permissions
f sends output to a file instead of standard output.

After f option it is necessary to write the file name where backup will be stored.
i.e: tar cvzpf /home/Backup.tgz is correct, but
tar cvzfp /home/Backup.tgz is wrong.

/home/Backup.tgz is our backup file name.

--same-owner preserve file ownership, it is not necessary because, being root, is a default option.



Excluding files from Backup


--exclude option gives us the possibility of excluding files and directories from backup.

--exclude=/home/Backup.tgz --exclude=/home/error.log Prevent Backup file and error log file to be stored.


--exclude=/proc/* --exclude=/dev/* --exclude=/sys/*

These are virtual directories so will not be stored.

NOTE: Difference between --exclude=/proc/* and --exclude=/proc is that first option would store a void proc directory, and second one would store nothing.

--exclude=/tmp/*

/tmp is a temporary directory, and is deleted on every boot, so will not be backed up either.


--exclude=/mnt/* --exclude=/media/*

If you want to save your main system only, and not what you have mounted on it, you should exclude these directories.


WHICH DIRECTORIES TO EXCLUDE?