How To Install RatticDB on CentOS 6.
5
This is an installation transcript for RatticDB on Centos 6.5 (minimal), including the setup of an encrypted loopback device for the MySQL
database.
Prerequisite: fresh CentOS 6.5 installation based on CentOS-6.5-x86_64-[Link].
Basic install and setup
Prepare system
# login as root
ssh-keygen
... manual input as required
vi /etc/hosts
... enter server address and name
Expand
source
yum update
yum groupinstall "MySQL Database server"
yum groupinstall development
yum groupinstall "Web Server"
yum install openldap-devel bzip2-devel sqlite-devel libxml2-devel libxslt-devel
wget openssl-devel
yum install tk-devel ncurses-devel readline-devel mysql-devel ntp
yum install httpd-devel python-devel
cd /tmp
wget
[Link]
rpm -ivh [Link]
yum install python-pip
chkconfig ntpd on
service ntpd start
chkconfig mysqld off
Set up an encrypted device for MySQL
Set up LUKS device
cd /
head -c 5G /dev/zero > luksfile
losetup /dev/loop0 luksfile
cryptsetup luksFormat /dev/loop0
... enter a new LUKS password
mkdir /mnt/luksfile
cryptsetup luksOpen /dev/loop0 luksfile
... enter LUKS password
mke2fs -j /dev/mapper/luksfile
mount /dev/mapper/luksfile /mnt/luksfile
Set up MySQL for RatticDB
Expand
source
Set up MySQL
mv /var/lib/mysql /mnt/luksfile/
ln -s /mnt/luksfile/mysql /var/lib/mysql
chcon -R system_u:object_r:var_lib_t:s0 /mnt/luksfile
chcon -R -u system_u -r object_r -t mysqld_db_t /mnt/luksfile/mysql
Expand
source
vi /etc/[Link]
[mysqld]
datadir=/mnt/luksfile/mysql
socket=/mnt/luksfile/mysql/[Link]
service mysqld start
/usr/bin/mysql_secure_installation
Reboot to test the basic setup
Startup test
reboot
Expand
source
# login as root
losetup /dev/loop0 /luksfile
cryptsetup luksOpen /dev/loop0 luksfile
...enter LUKS password
mount /dev/mapper/luksfile /mnt/luksfile
service mysqld start
Prepare RatticDB database
MySQL setup for RatticDB
Expand
create database rattic;
source
create user rattic@localhost identified by '***rattic-db-password***';
grant all on rattic.* to rattic;
Install RatticDB
Install RatticDB
useradd -c "RatticWeb" -m rattic
Expand
source
cd /tmp
wget --no-check-certificate
[Link]
tar -xzf [Link]
cd RatticWeb-1.1.0
pip install -r [Link]
mkdir /opt/apps
cd /tmp
mv RatticWeb-1.1.0 /opt/apps/RatticWeb
mkdir /opt/apps/RatticWeb/static
chown -R rattic /opt/apps/RatticWeb
chcon -Rv --type=httpd_sys_content_t /opt/apps/RatticWeb
Configure RatticDB
Configuer RatticDB
su - rattic
cd /opt/apps/RatticWeb/conf
vi [Link]
[ratticweb]
debug = False
secretkey = ***rattic-secret-key***
hostname = ***IP name of local host***
[filepaths]
static = /opt/apps/RatticWeb/static
[database]
engine = [Link]
name = rattic
user = rattic
password = ***rattic-db-password***
host = localhost
port = 3306
cd /opt/apps/RatticWeb/
./[Link] syncdb --noinput
./[Link] migrate --all
./[Link] collectstatic -c --noinput
./[Link] demosetup
exit # back to root
Prepare web server
Expand
source
Prepare apache httpd
cd /etc/httpd/conf.d
vi [Link]
Expand
source
NameVirtualHost *:80
<VirtualHost *:80>
ServerName ***IP name of local host***
ServerAlias ***first part of IP name***
Redirect permanent / [Link] name of local host***/
</VirtualHost>
Alias /[Link] /opt/apps/RatticWeb/static/[Link]
Alias /[Link] /opt/apps/RatticWeb/static/[Link]
AliasMatch ^/([^/]*\.css) /opt/apps/RatticWeb/static/styles/$1
Alias /media/ /opt/apps/RatticWeb/media/
Alias /static/ /opt/apps/RatticWeb/static/
<Directory /opt/apps/RatticWeb/static>
Order deny,allow
Allow from all
</Directory>
<Directory /opt/apps/RatticWeb/media>
Order deny,allow
Allow from all
</Directory>
WSGIScriptAlias / /opt/apps/RatticWeb/ratticweb/[Link]
WSGIPassAuthorization On
WSGIDaemonProcess rattic processes=2 threads=25 home=/opt/apps/RatticWeb/
python-path=/opt/apps/RatticWeb display-name=%{GROUP}
WSGIProcessGroup rattic
<Directory /opt/apps/RatticWeb/ratticweb>
<Files [Link]>
Order deny,allow
Allow from all
</Files>
</Directory>
service httpd restart
Modify firewall
Prepare iptables
vi /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT
service iptables restart
Test Web access
[Link] name of local host***
Expand
source
Questions and feedback
Feedback has been disabled here.
For questions and comments please contact Thomas Gutzmann (thomas@[Link]).