Saturday, February 25, 2012

Installing Bacula 5.2.6 with webmin on Centos 6.2

If you are looking for a free open source network backup solution, Bacula is your answer.
It's a network Client/Server based backup program that has many benefits.
To list a few:
  • Cross- platform (I installed clients on different OS's, Centos, Ubuntu, Mac OS X, Win7, WinXP, Win Vista, Solaris)
  • Totally free (It's main advantage over Amanda is that all the clients are for free and so is the GUI)
  • Relatively easy to install and manage.
  • In addition to many backup features such as: Schedules, Data & Communication encryption, Data compression, many backup levels, open files backup...
Detailed info can be found on the Project's official website: http://www.bacula.org


Installation on Centos 6.2:


The installation on Bacula is relatively easy for the Linux experienced user.


First we need to install the C and C++ compiler. As a root user:


#yum install gcc gcc-c++ autoconf automake


Bacula supports many databases engines, i will be using MySQL:
Install MySQL
#yum install mysql-server mysql mysql-devel php-mysql
Start MySQL
#service mysqld start
Set the MySQL root user password: (replace the password between brackets)
#mysql
 >use mysql;
 >UPDATE user SET Password=PASSWORD('password') WHERE user='root';
 >flush privileges;
 >exit


Installing Bacula:


#wget http://sourceforge.net/projects/bacula/files/bacula/5.2.6/bacula-5.2.6.tar.gz
#tar -xvzf bacula-5.2.6.tar.gz
#cd bacula-5.2.6
# CFLAGS="-g -Wall" ./configure \
 --prefix=/usr \
  --sbindir=/usr/sbin \
  --sysconfdir=/etc/bacula \
  --with-scriptdir=/etc/bacula \
  --enable-smartalloc \
  --with-mysql \
  --with-openssl \
  --with-working-dir=/var/bacula \
  --with-pid-dir=/var/run \
  --enable-batch-insert \
  --enable-tray-monitor \
#make
#make install

Create the Bacula MySQL Database and Tables:

#/etc/bacula/create_mysql_database -u root -p
#/etc/bacula/make_mysql_tables -u root -p
#/etc/bacula/grant_mysql_privileges -u root -p
#/etc/bacula/grant_bacula_privileges -u root -p

Set the MySQL Bacula user bacula password:

#mysql -u root -p
>UPDATE mysql.user SET Password=PASSWORD('password') WHERE user='bacula';
>flush privileges;
>exit

Configure Bacula:

#cd /etc/bacula
#vi bacula-dir.conf
Change the Director password, the Client password, the Storage password, insert the MySQL bacula user password under Catalog dbpassword = "password" and the Console password.

#vi bacula-sd.conf
Change the bacula-dir and bacula-mon password to the ones supplied in the bacula-dir.conf,   and the Archive Device under Device to whatever location on your server you want to backup up on, e.g Archive Device = /backup and later create that directory and grant it the privileges: 
#mkdir /backup
#chown bacula /backup


#vi bacula-fd.conf
Change the bacula-dir and bacula-mon passwords.


#vi bconsole.conf
Change the bacula-dir password


Start Bacula:
#cd /etc/bacula
#./bacula start


If iptables is turned on, it will be blocking the ports 9101, 9102 and 9103 that Bacula needs to communicate with its different components.
You can either turn off iptables #/etc/init.d/iptables stop or create rules to allow the above ports.


You can manage bacula from its console:
#bconsole
 Connecting to Director bacula:9101
1000 OK: bacula-dir Version: 5.2.6 (21 February 2012)
Enter a period to cancel a command.
*


For more information about the Bacula Console commands check the documentation on the website.


Webmin:


Managing bacula from a GUI interface can be done with webmin. Webmin a web-based interface for system administration for *nix.


Installing webmin:


#cat > /etc/yum.repos.d/webmin.repo << EOF
> [Webmin]
> name=Webmin Distribution Neutral
> #baseurl=http://download.webmin.com/download/yum
> mirrorlist=http://download.webmin.com/download/yum/mirrorlist
> enabled=1
> EOF

#rpm --import http://www.webmin.com/jcameron-key.asc
#yum install webmin

After its installed, you can access it from your browser by going to http://youripaddress:10000 and login with your server root user credentials.

Note: if iptables is on, either turn it off or allow port 10000.

You will find Bacula Backup System under System on the left. When you access it for the first time, it will fait to connect to the database, click on module configuration and under Bacula Database Settings chose MySQL and set the MySQL root password and finally Save.

Now you need to understand how the Pools, Volumes, Devices and Storage Daemons work together in order to properly set it up.

Clients Installation:

I will be updating this post later on client installation on different OSs, for now i have successfully installed and backed up: Windows XP, Windows Vista, Windows 7, CentOS, Ubuntu, Solaris, Mac OS X.

Contact me for any further related configuration and questions.







Saturday, February 18, 2012

Installing Teampass 2.1 on Ubuntu 10.10

Teampass is a great open source Collaborative Passwords Manager, it has been developed entirely by Nils Laumaillé based upon his original idea.
Official Website: http://www.teampass.net/


Installation:


Few prerequisites are needed first:
  • PHP
  • Apache
  • MySQL
  • PHP extension mcrypt
I chose Ubuntu 10.10 to install it on, other linux flavors can be used also.


First we need to update our package index, from the command line:
sudo apt-get update
Installing PHP:
sudo apt-get install php5
Installing MySQL (supply a MySQL root password when prompted):
sudo apt-get install mysql-server


Creating the MySQL Teampass database:
mysql -u root -p
>create database teampass;
>grant all privileges on teampass.* to root@'localhost' identified by 'yourmysqlrootpassword';
>exit


To download Teampass follow the instructions here: http://www.teampass.net/download/

Move the downloaded Zip file to /var/www
Unzip it:
unzip nilsteampassnet-TeamPass-*******.zip 
Rename it to teampass:
mv nilsteampassnet-TeamPass-******* teampass


Grant read/write access to some Teampass directories:


cd /var/www
chmod -R 777 teampass


Install PHP extension mcrypt:


sudo apt-get install php5-mcrypt


Restart the Apache server: service apache2 restart


From the Ubuntu web browser go to:


http://localhost/teampass


If everything is properly installed the Teampass installation page should open, scroll down, accept the license agreement and click next.


In the next page provide the absolute path: /var/www/teampass
and the full URL: http://localhost/teampass
and click launch, it should return Elements are OK.
Click next to fill the database information:
Host: localhost
Database name: teampass
Login: root
Password: the mysql root password
and click launch, it should return Connection is successful.


Click next to step 3, keep everything as is and click launch then next to the tables creation page.
On Step 4 click launch and it should return Database has been populated.
Click next for step 5 to create the setting.php file and next to finalize the installation.


Now from any PC's web browser you can go to http://yourserveripaddress/teampass and access the Teampass login page.




MySQL Notes:

  • It is not a recommended practice to use the MySQL root user with the application installation, it is better to create a MySQL user just for the application and grant that user all the privileges on the teampass database.
  • If you are installing from a remote machine, when you reach the installation step in which you connect to the database, it might not let you connect since MySQL prevents remote database connections by default, that's why i performed the installation from the server's browser. It is possible to allow remote database access to perform the installation from a remote machine, but i that would be an extra not needed hassle. After the installation in competed, access to the application is possible from any machine without any need to change anything.