Welcome to Machine Unix

Search Below

Configuring OTRS 3.0.4 on OpenIndiana B148

OpenIndiana is the resurrection of OpenSolaris 2009.06. After it was decided that OpenSolaris was going to be left out in the cold, a project called Illumos created to maintain OpenSolaris source code.  To be more opensource than what OpenSolaris was, the closed binaries were left out and only the opensource code is maintained by the community. The first release of OpenIndiana carried build 147 source code and more recently, OI_148 is released. There are many interesting features with OpenIndiana B148. Along with the dedpulication features, many backports from Illumos, postgres packages and bug fixes are added.

So I could not resist the charm of these new developments and I decided to give OpenIndiana spin. Not only I wanted to download and play with it but I kind of wanted to build some useful software on it to see how it holds up. One of the first opensource projects came to my mind was OTRS which I had the chance to install on a Solaris 10 system previously with some challenges, but I did get it to work and used on production. OTRS is an opensource helpdesk and support management system which becomes very useful to keep track of typical professional services requests or problems they may report. The 3.0.4 version which is not the one that I installed previously looks rather beautiful, I mean this release is shiny, very shiny. I simply loved it. So below is the complete rundown on building OTRS on OpenIndiana B148.

Preparation 1- The Zone

The idea is to bring this application into a zone. So we start with a zone configuration. I had an existing zone that I am going to be using as a template, but the set of commands can be easily done with zonecfg.

Export the existing zone configuration into a file and edit it:

# sudo zonecfg -z otrs-zone export >> zone.config

# cat zone.config

create -b

set zonepath=/zones/zone-otrs

set brand=ipkg

set autoboot=true

set ip-type=shared

add net

set address=192.168.1.181

set physical=e1000g0

set defrouter=192.168.1.254

end

Use the zone config file to install your new zone:

# sudo zonecfg -z zone-otrs -f zone.config

# sudo zoneadm -z zone-otrs install

A ZFS file system has been created for this zone.

Publisher: Using openindiana.org (http://pkg.openindiana.org/dev/ ).

Publisher: Using opensolaris.org (http://pkg.openindiana.org/legacy/).

Image: Preparing at /zones/zone-otrs/root.

Refreshing catalog 2/2 opensolaris.org

….

You can create a sysidcfg file to avoid further settings after the zone is booted.

# cat sysidcfg

system_locale=C

timezone=US/Central

terminal=xterms

security_policy=NONE

root_password=MNY4FaPMbBnRs

timeserver=localhost

name_service=DNS {domain_name=<your_domain_name> name_server=<your_name_server_ip}

network_interface=primary {hostname=zone-otrs default_route=192.168.1.254 ip_address=192.168.1.181 netmask=255.255.255.0 protocol_ipv6=no}

nfs4_domain=dynamic

# cp sysidcfg /zones/zone-otrs/root/etc/sysidcfg

Now, boot the zone and from another terminal watch what is hapenning during boot time:

Terminal 1

# sudo zoneadm -z zone-otrs boot

Terminal 2 (with output)

deniz@openindiana47:~$ sudo zlogin -C zone-otrs

[Connected to zone ‘zone-otrs’ console]

[NOTICE: Zone booting up]

SunOS Release 5.11 Version oi_148 64-bit

Copyright (c) 1983, 2010, Oracle and/or its affiliates. All rights reserved.

Loading smf(5) service descriptions: 98/98

Hostname: zone-otrs

Loading smf(5) service descriptions: 3/3

Creating new rsa public/private host key pair

Creating new dsa public/private host key pair

Configuring network interface addresses: e1000g0.

zone-otrs console login:

Great, the zone is now set up.

Preparation 2 – Installing Required Packages After zoneboot

This step is very imperative and you do not want to miss anything here. When this zone is built, it is just barebones. There are no databases, application servers and web servers installed. The following is the steps to install some of the required packages such as Sun compilers ( will be used during otrs perl module installation), apache2 server, the database server, perl packages ( at least perl 5.8.8 is required for otrs), GD libraries, and wget. Prepare yourself a pot of coffee before going further, you are warned!

# pkg install ss-dev

# pkg install pkg:/web/server/apache-22@2.2.16-0.148

# pkg install  pkg:/web/server/apache-22/module/apache-fcgid@2.3.4-0.148

# pkg install  pkg:/runtime/perl-510@5.10.0-0.148

# pkg install pkg:/runtime/perl-510/extra@5.10.0-0.148

# pkg install pkg:/database/mysql-51/library@5.1.37-0.148

# pkg install pkg:/database/mysql-51/tests@5.1.37-0.148

# pkg install pkg:/database/mysql-51@5.1.37-0.148

# pkg install pkg:/database/mysql-50@5.0.91-0.148 -> ( I had to install this package because mysql-51 does not come with mysql_config program which will be used later on with DBD::mysql perl module, otherwise CPAN will complain about it. In our path, we’ll use 5.0 path but we can remove it after installing the perl module)

# pkg install pkg:/library/gd@2.0.35-0.148

# pkg install wget

After these packages are installed set your perl binary and your path:

# rm /usr/bin/perl

# ln -s /usr/perl5/5.10.0/bin/perl /usr/bin/perl

# cat /root/.profile | grep PATH

PATH=/usr/mysql/5.0/bin:/opt/SunStudioExpress/bin:/usr/sfw/bin:usr/sbin:

/usr/bin:/usr/openwin/bin:/usr/dt/bin:/usr/ccs/bin:$PATH

Preparation 3 – Sanity Checks

Make sure everything is configured properly at this point and enable services:

# perl -v

This is perl, v5.10.0 built for i86pc-solaris-64int

Copyright 1987-2007, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the

GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on

this system using “man perl” or “perldoc perl”.  If you have access to the

Internet, point your browser at http://www.perl.org/, the Perl Home Page.

# svcs -a | grep mysql

disabled       22:14:28 svc:/application/database/mysql:version_51

disabled       22:30:45 svc:/application/database/mysql:version_50

# svcs -a | grep apache

disabled       21:51:33 svc:/network/http:apache22

# svcadm enable http

# svcadm enable svc:/application/database/mysql:version_51

# svcs -a | grep apache2

online         22:35:43 svc:/network/http:apache22

# svcs -a | grep mysql

disabled       22:30:45 svc:/application/database/mysql:version_50

online         22:36:15 svc:/application/database/mysql:version_51

# which mysql

/usr/mysql/5.0/bin/mysql ( will be used for mysql_config )

# /usr/mysql/5.1/bin/mysql -u root

Welcome to the MySQL monitor.  Commands end with ; or g.

Your MySQL connection id is 1

Server version: 5.1.37 Source distribution

Type ‘help;’ or ‘h’ for help. Type ‘c’ to clear the current input statement.

mysql> exit

Preparation 4 – OTRS Configuration

At this point, we are ready to download and install otrs. One thing I have to mention is that some of the Perl Modules had to be installed manually. CPAN mostly worked with the couple of exceptions. I am including necessary steps from the OTRS manual to install it, which is pretty clear

# mkdir /root/Downloads/PERLMODULES

# cd /root/Download/

# wget http://ftp.otrs.org/pub/otrs/otrs-3.0.4.tar.gz

# gunzip -c otrs* | tar xf –

# mv otrs.3.0.4 /opt/otrs

At this point, follow the instructions on building from source from the OTRS Manual. I am going to comment on some OpenIndiana specific instructions:

When adding the otrs user, the following is the right format:

# useradd -d /opt/otrs -c “OTRS User” otrs

Following on the documentation, the command to run to set the permissions can be done in the following way:

# ./otrs.SetPermissions.pl /opt/otrs –otrs-user=otrs –web-user=webservd –otrs-group=nogroup –web-group=webservd

In the above line, webservd is the apache2 user and group name.

Add the following two lines in /opt/otrs/Kernel/Config.pm:

$Self->{‘LogModule::LogFile’} = ‘/tmp/otrs.log’;

$Self->{‘LogModule’} = ‘Kernel::System::Log::File’;

Preparation 5 – CPAN and the manual Perl Modules

After you installed your perl and configured otrs, you will have to use CPAN for the most of the required modules. Configure CPAN automatically when you get to the shell and update your CPAN:

# perl -MCPAN -e shell

<– auto configuration starts here –>

Terminal does not support AddHistory.

cpan shell — CPAN exploration and modules installation (v1.oldversion)

Enter ‘h’ for help.

cpan[1]> install CPAN

——-

cpan[2]> reload cpan

——

Modules Installed Manually

# gunzip -c DBD-mysql-4.018.tar.gz | tar xf –

# cd DBD-mysql-4.018

# perl Makefile.PL

# make

# make test

# make install

# gunzip -c GD-2.45.tar.gz | tar xf –

# perl Makefile.PL

Edit the makefile generated with the following:

comment out CCFLAGS and OPTIMIZE lines

# make

# make install

Following is the module list generated by the otrs.checkModules script for me:

/opt/otrs/bin# ./otrs.CheckModules.pl

o CGI……………………….ok (v3.50)

o Crypt::PasswdMD5……………ok (v1.3)

o CSS::Minifier………………ok (v0.01)

o Date::Format……………….ok (v2.24)

o Date::Pcalc………………..ok (v1.2)

o DBI……………………….ok (v1.615)

o DBD::mysql…………………ok (v4.018)

o Digest::MD5………………..ok (v2.36_01)

o Digest::SHA::PurePerl……….ok (v5.48)

o Encode::HanExtra……………Not installed! (Optional – Required to handle mails with several Chinese character sets.)

o GD………………………..ok (v2.45)

o GD::Text………………..ok (v0.86)

o GD::Graph……………….ok (v1.44)

o GD::Graph::lines…………ok (v1.15)

o GD::Text::Align………….ok (v1.18)

o IO::Scalar…………………ok (v2.110)

o IO::Wrap…………………..ok (v2.110)

o JavaScript::Minifier………..ok (v1.05)

o JSON………………………ok (v2.27)

o JSON::PP………………..ok (v2.27008)

o JSON::XS………………..ok (v2.3)

o LWP::UserAgent……………..ok (v5.835)

o Mail::Internet……………..ok (v2.07)

o Mail::POP3Client……………ok (v2.18 )

o IO::Socket::SSL………….ok (v1.37)

o MIME::Base64……………….ok (v3.07_01)

o MIME::Tools………………..ok (v5.428)

o ModPerl::Util………………ok (v2.000004)

o Apache::DBI……………..ok (v1.09)

o Apache2::Reload………….ok (v0.11)

o Net::DNS…………………..ok (v0.66)

o Net::POP3………………….ok (v2.29)

o Net::IMAP::Simple…………..ok (v1.2017)

o Net::IMAP::Simple::SSL……ok (v1.3)

o Net::SMTP………………….ok (v2.31)

o Authen::SASL…………….ok (v2.15)

o Net::SMTP::SSL…………..ok (v1.01)

o Net::SMTP::TLS…………..ok (v0.12)

o Net::LDAP………………….Not installed! (Optional – Required for directory authentication.)

o PDF::API2………………….ok (v0.73)

o Compress::Zlib…………..ok (v2.008)

o SOAP::Lite…………………Not installed! (Optional – Required for the SOAP interface.)

o Text::CSV………………….ok (v1.20)

o Text::CSV_PP…………….ok (v1.28)

o Text::CSV_XS…………….ok (v0.79)

o XML::Parser………………..ok (v2.40)

Now that you are completely ready, fire up your browser and point it to http://localhost/otrs/installer.pl for configuring your database.