Installation on Debian 6 with Postgres

From OtterHub - OTRS Community Wiki
Jump to: navigation, search

Here is the procedure for installing OTRS 3 on Debian 6 with Postgres, It worked for me but I have not tested it from the start again, so please consider this a draft and provide feedback if you can.

Install Packages

 aptitude install libapache2-mod-perl2 libdbd-pg-perl libnet-dns-perl libnet-ldap-perl libio-socket-ssl-perl 
 libpdf-api2-perl libsoap-lite-perl libgd-text-perl libgd-graph-perl libapache-dbi-perl postgresql

Create system accounts

 useradd -r -d /opt/otrs/ -c 'OTRS user' otrs
 usermod -g www-data otrs

Install Files

find the latest version and download it [1]

 cd /opt
 tar xf otrs-3.0.5.tar.gz
 mv otrs-3.0.5 otrs && cd otrs
 cp Kernel/ Kernel/
 cp Kernel/Config/ Kernel/Config/
 bin/ --otrs-user=otrs --otrs-group=otrs --web-user=www-data --web-group=www-data /opt/otrs
 ln -s /opt/otrs/scripts/apache2-httpd.include.conf /etc/apache2/conf.d/otrs.conf 
 service apache2 restart

Install Database

 su postgres

On the psql command line

 create user otrs password 'otrs' nosuperuser;
 create database otrs owner otrs;

Back in bash

Allow access to the db

 nano /etc/postgresql/8.4/main/pg_hba.conf

put the following at the top of the file

 local   otrs    otrs    password
 host    otrs    otrs    password

 psql -U otrs -W -f scripts/database/otrs-schema.postgresql.sql otrs
 psql -U otrs -W -f scripts/database/otrs-initial_insert.postgresql.sql otrs
 psql -U otrs -W -f scripts/database/otrs-schema-post.postgresql.sql otrs
 exit (to stop being postgres)
 service postgresql restart

Configure OTRS for the DB

 nano Kernel/

put in your password

 # DatabasePw
 # (The password of database user. You also can use bin/
 # for crypted passwords.)
 $Self->{DatabasePw} = 'otrs';

comment out MySQL DSN

     # DatabaseDSN
     # (The database DSN for MySQL ==> more: "man DBD::mysql")
 #    $Self->{DatabaseDSN} = "DBI:mysql:database=$Self->{Database};host=$Self->{DatabaseHost};";

uncomment PG DSN, choosing local or tcpip (in this case local)

     # (The database DSN for PostgreSQL ==> more: "man DBD::Pg")
     # if you want to use a local socket connection
     $Self->{DatabaseDSN} = "DBI:Pg:dbname=$Self->{Database};";
     # if you want to use a tcpip connection
 #    $Self->{DatabaseDSN} = "DBI:Pg:dbname=$Self->{Database};host=$Self->{DatabaseHost};";
 nano scripts/

uncomment this bit

 # enable this if you use postgresql
 use DBD::Pg ();
 use Kernel::System::DB::postgresql;

Install Cron jobs

 cd var/cron/ ; for foo in *.dist; do cp $foo `basename $foo .dist`; done ; cd ../..
 bin/ start otrs

Start the real setup

Open a browser and go to http://localhost/otrs/

Log in with root@localhost, password root