Home > How To > Installation OTRS 3.1 on CentOS 6.2 Running PostGreSQL 9.1

Installation OTRS 3.1 on CentOS 6.2 Running PostGreSQL 9.1

I was working on getting and Ops tools for our IT Department,

I had heard a lot about OTRS, so though to try it out. I have installed OTRS in CentOS 6.2 Running PostGreSQL 9.1

Below are the steps to get it up and running.

Lets Start then.

System Information:

[ahmed@localhost ~]$ uname -a
Linux localhost.localdomain 2.6.32-220.7.1.el6.x86_64 #1 SMP Wed Mar 7 00:52:02 GMT 2012 x86_64 x86_64 x86_64 GNU/Linux
[ahmed@localhost ~]$ cat /etc/redhat-release
CentOS release 6.2 (Final)

Lets start by updating system (Optional)

[ahmed@localhost Downloads]$ sudo yum update
[ahmed@localhost Downloads]$ sudo yum update yum

Installing httpd

[ahmed@localhost Downloads]$ sudo yum install httpd

(Below command Optional – if already exsists)

[ahmed@localhost Downloads]$ sudo yum update httpd

Now lets Install PostgreSQL – Downloaded this from the below link.
http://www.enterprisedb.com/products-services-training/pgdownload

[ahmed@localhost Downloads]$ ls
OpenNMS-1.2.0.opm         postgresql-9.1.3-1-linux-x64.run
otrs-3.1.3-03.noarch.rpm  xampp-linux-1.7.7.tar.gz
[ahmed@localhost Downloads]$ sudo ./postgresql-9.1.3-1-linux-x64.run

Lets Download and check dependencies for OTRS.
Download link below:
http://ftp.otrs.org/pub/otrs/RPMS/fedora/4/otrs-3.1.3-03.noarch.rpm

[ahmed@localhost Downloads]$ wget http://ftp.otrs.org/pub/otrs/RPMS/fedora/4/otrs-3.1.3-03.noarch.rpm
[ahmed@localhost Downloads]$ rpm -qpR otrs-3.1.3-03.noarch.rpm
perl
perl(DBI)
perl(URI)
mod_perl
httpd
procmail
perl(Date::Format)
perl(LWP::UserAgent)
perl(Net::DNS)
perl(IO::Socket::SSL)
perl(XML::Parser)
/bin/sh
/bin/sh
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(PayloadIsBzip2) <= 3.0.5-1


Now lets install all Dependencies.

[ahmed@localhost Downloads]$ sudo yum install perl “perl(DBI)” “perl(URI)” mod_perl procmail “perl(Date::Format)” “perl(LWP::UserAgent)” “perl(Net::DNS)” “perl(IO::Socket::SSL)” “perl(XML::Parser)”


Running Transaction
  Installing : 1:perl-ExtUtils-ParseXS-2.2003.0-119.el6_1.1.x86_64          1/8
  Installing : 4:perl-devel-5.10.1-119.el6_1.1.x86_64                       2/8
  Installing : perl-Test-Harness-3.17-119.el6_1.1.x86_64                    3/8
  Installing : perl-ExtUtils-MakeMaker-6.55-119.el6_1.1.x86_64              4/8
  Installing : perl-BSD-Resource-1.29.03-3.el6.x86_64                       5/8
  Installing : mod_perl-2.0.4-10.el6.x86_64                                 6/8
  Installing : perl-URI-1.40-2.el6.noarch                                   7/8
  Installing : perl-DBI-1.609-4.el6.x86_64                                  8/8

Installed:
  mod_perl.x86_64 0:2.0.4-10.el6          perl-DBI.x86_64 0:1.609-4.el6        
  perl-URI.noarch 0:1.40-2.el6          

Dependency Installed:
  perl-BSD-Resource.x86_64 0:1.29.03-3.el6                                     
  perl-ExtUtils-MakeMaker.x86_64 0:6.55-119.el6_1.1                            
  perl-ExtUtils-ParseXS.x86_64 1:2.2003.0-119.el6_1.1                          
  perl-Test-Harness.x86_64 0:3.17-119.el6_1.1                                  
  perl-devel.x86_64 4:5.10.1-119.el6_1.1                                       

Complete!

Now Install OTRS without Dependencies as we need to install it on PostgreSQL.

[ahmed@localhost Downloads]$ sudo rpm –nodeps -Uvh otrs-3.1.3-03.noarch.rpm
Preparing…                ########################################### [100%]
Check OTRS user … otrs added.
   1:otrs                   ########################################### [100%]
Next steps:
[httpd services]
 Restart httpd ‘service httpd restart’
[install the OTRS database]
 Make sure your database server is running.
 Use a web browser and open this link:
 http://localhost/otrs/installer.pl
[OTRS services]
 Start OTRS ‘service otrs start’ (service otrs {start|stop|status|restart).
((enjoy))
 Your OTRS Team

Now Check Again Dependencies if any are missing, you can install it using the below command.

[ahmed@localhost Downloads]$ cd /opt/otrs/bin
[ahmed@localhost bin]$ ./otrs.CheckModules.pl
   o CGI…………………………ok (v3.59)
   o Crypt::PasswdMD5……………..ok (v1.3)
   o CSS::Minifier………………..ok (v0.01)
   o Date::Format…………………ok (v2.22)
   o Date::Pcalc………………….ok (v1.2)
   o DBI…………………………ok (v1.609)
…………..


[ahmed@localhost bin]$ sudo yum install “perl(DBD::Pg)” “perl(Digest::SHA)” “perl(GD)” “perl(Text::CSV_XS)” “perl(PDF::API2)” “perl(Net::LDAP)” “perl(Mail::IMAPClient)” “perl(JSON::XS)” “perl(GD::Text::Align)” “perl(GD::Graph::lines)” “perl(GD::Graph)” “perl(GD::Text)” “perl(Encode::HanExtra)”

(Optional – Just an FYI) Missing Modules can be searched using this command.

[ahmed@localhost bin]$ yum –noplugins –showduplicates –enablerepo \* –disablerepo c6-media,\*debug\*,\*-source list \*pdf\*
[ahmed@localhost bin]$ yum –noplugins –showduplicates –enablerepo \* –disablerepo c6-media,\*debug\*,\*-source list \*json\*

Now create a user ‘otrs’ and update information as below.

[ahmed@localhost bin]$ ./psql -U postgres
Password for user postgres:
psql.bin (9.1.3)
Type “help” for help.

postgres=# create role otrs password ‘hot’ nosuperuser;
CREATE ROLE
postgres=# create database otrs owner otrs;
CREATE DATABASE
postgres=# alter role otrs with login;
ALTER ROLE
postgres=#\q

[ahmed@localhost database]$ cd /opt/otrs/scripts/database
[ahmed@localhost database]$ ./opt/postgresql/bin/psql -U otrs otrs -f otrs-schema.postgresql.sql
[ahmed@localhost database]$ ./opt/postgresql/bin/psql -U otrs otrs -f otrs-initial_insert.postgresql.sql
[ahmed@localhost database]$ ./opt/postgresql/bin/psql -U otrs otrs -f otrs-schema-post.postgresql.sql

# Add user otrs
[ahmed@localhost database]$ useradd -d /opt/otrs/ -c ‘OTRS user’ otrs

# Add otrs user to apache-group[ahmed@localhost database]$ usermod -G apache otrs

# Change to otrs directory ( /opt/otrs/ )[ahmed@localhost database]$ cd /opt/otrs/



Run the permission script.

[ahmed@localhost database]$ sudo /opt/otrs/bin/otrs.SetPermissions.pl /opt/otrs –otrs-user=otrs –web-user=apache –otrs-group=apache –web-group=apache
bin/otrs.SetPermissions.pl <1.4> – set OTRS file permissions
Copyright (C) 2001-2010 OTRS AG, http://otrs.org/
Setting permissions on /opt/otrs
Setting permissions on /opt/otrs/var
Setting permissions on /opt/otrs/bin/*
Setting permissions on /opt/otrs/scripts/*.pl
Setting permissions on /opt/otrs/scripts/tools/*.pl
Setting permissions on Kernel/Config.pm
Setting owner rw and group ro permissions on /opt/otrs/
Setting owner rw and group ro permissions on /opt/otrs/.procmailrc
Setting owner rw and group ro permissions on /opt/otrs/.fetchmailrc

MAKE SURE SELINUX is disabled.

[ahmed@localhost ~]$ vim /etc/sysconfig/selinux
[ahmed@localhost ~]$
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing – SELinux security policy is enforced.
#     permissive – SELinux prints warnings instead of enforcing.
#     disabled – No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
#     targeted – Targeted processes are protected,
#     mls – Multi Level Security protection.
SELINUXTYPE=targeted


Modify the default parameters, since mysql is the default database
open the file /opt/otrs/Kernel/Config.pm and
comment the line

    $Self->{DatabaseDSN}= “DBI:mysql:database=$Self->{Database};host=$Self->{DatabaseHost};”;

to disable mysql, and uncomment the line

    $Self->{DatabaseDSN} = “DBI:Pg:dbname=$Self->{Database};”;

and don’t forget to set the dbuser and password to one you created some steps ago

 Now Lets start httpd

[ahmed@localhost Downloads]$ sudo /etc/init.d/httpd start
Starting httpd:                                                        [  OK  ]

PostgreSQL and OTRS.
[ahmed@localhost Downloads]$ sudo /etc/init.d/postgresql-9.1 start
[ahmed@localhost Downloads]$ sudo /etc/init.d/otrs start
Advertisements
Categories: How To
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: