Using the tar.gz file to install OTRS on any Linux plattform

This section is a guide for installing OTRS on any Linux. Please use this way only in case you feel comfortable with it otherwise use the RPM. Before starting the installation have a look at http://otrs.org/ and check if a newer and better version of the tar.gz file is available. If so please download it and use the newer documentation and the newer rpm.

Software requirements?

On all Perl-Platforms! You need:

Install CPAN Modules (if needed):

Create user and install tar.gz:

   shell> useradd -d /opt/OpenTRS/ otrs
   shell> cd /opt/
   shell> tar -xzvf otrs-xxxx-xx.tar.gz
   shell> chown -r /opt/OpenTRS/* otrs

Database setup:

MySQL

Create OTRS database:
shell> mysql -u root -p -e 'create database otrs'

Create the OTRS tables:
shell> cd /opt/OpenTRS/install/database/
shell> mysql -u root -p otrs < OpenTRS-schema.mysql.sql

Insert inital data:
shell> cd /opt/OpenTRS/install/database/
shell> mysql -u root -p otrs < initial_insert.sql

Create an database user:
shell> mysql -u root -p -e 'GRANT ALL PRIVILEGES ON otrs.* TO \
otrs@localhost IDENTIFIED BY "some-pass" WITH GRANT OPTION;'

Reload the grant tables of your mysql-daemon:
shell> mysqladmin -u root -p reload

Change the DB-Settings (host, database, user and password) in $OTRS_HOME/Kernel/Config.pm
   [...]                                                    
   # Database                                               
   # (The database name.)                                   
   $Self->{Database} = 'otrs';                              
                                                            
   # DatabaseUser                                           
   # (The database user.)                                   
   $Self->{DatabaseUser} = 'otrs';                          
                                                            
   # DatabasePw                                             
   # (The password of database user.)                       
   $Self->{DatabasePw} = 'some-pass';                       
   [...]                                                    

PostgreSQL

$HOME_OTRS/install/database/OpenTRS-schema.postgresql.sql

XML (other databases)

$HOME_OTRS/install/database/OpenTRS-schema.xml

The XML description files for torque which generate the SQL for your target database (e.g. MySQL, PostgreSQL, DB2, Oracle, ...)

More Infos: http://jakarta.apache.org/turbine/turbine-2/howto/torque-howto.html

Initial insert file

$HOME_OTRS/install/database/initial_insert.sql contains all needed standard values. At first use the OpenTRS-schema.*.sql and the insert this file.

Webserver

We prefer the Apache webserver. The following changes have to be made in the httpd.conf.

webserver user

Change the webserver user (normaly wwwrun) to the OTRS user (otrs).
  [...]
  User otrs
  [...]

If you can't change the user and group of your webserver (system-wide), because you have other applications running on this server, you can also work with group permissions (more tricky). Use
$HOME/bin/SetPermissions.sh <OTRS_HOME> <OTRS_USER> \ 
<WEBSERVER_USER> [OTRS_GROUP] [WEB_GROUP]
Webserver with otrs user:
shell> SetPermissions.sh /opt/OpenTRS otrs otrs
Webserver with wwwrun user (e.g. SuSE):
shell> SetPermissions.sh /opt/OpenTRS otrs wwwrun
Webserver with apache user (e.g. Redhat):
shell> SetPermissions.sh /opt/OpenTRS otrs apache

Without mod_perl (just CGI)

Add this to the cgi-bin stuff section in httpd.conf

  [...]
  ScriptAlias /otrs/ "/opt/OpenTRS/bin/cgi-bin/"
  [...]

With mod_perl (speed!)

Add this to the mod_perl stuff section in httpd.conf
  Alias /otrs/ "/opt/OpenTRS/bin/cgi-bin/"

  <Location /otrs>
    SetHandler  perl-script
    PerlHandler Apache::Registry
    Options ExecCGI
    PerlSendHeader On
  </Location>
May you want use the mod_perl startup script (on SuSE /usr/include/apache/modules/perl/startup.perl) to have as a simple way to have apache servers establish connections on process startup. Add:
  [...]
  use Apache ();
  use Apache::DBI ();
  Apache::DBI->connect_on_init('DBI:mysql:otrs', 'otrs', 'some-pass');
  # Apache::DBI->connect_on_init($data_source, $username, $auth, \%attr)
  [...]

Restart the webserver

After you've done all this changes you have to restart Apache. The login page can be found at http://your-host/otrs/index.pl but please first use the http://your-host/otrs/installer.pl page to install the database.

Config file ($HOME/Kernel/Config.pm):

Set some Kernel::Config Options (FQDN, SystemID, TicketHook, ...)

First Login:

http://yourhost/otrs/index.pl

Admin-User: root@localhost

password: root

--> goto AdminArea and set some config settings (UserAdd, Queues, ...).

Finished. :-)

First E-Mail:

use the procmailrc of the OpenTRS-User --> /opt/OpenTRS/.procmailrc

--> send emails to the otrs user (e.g. otrs@localhost)

or pipe an email directly into $OTRS_HOME/bin/Postmaster.pl (e. g. 'cat /opt/OpenTRS/doc/test-email-1.box | /opt/OpenTRS/bin/PostMaster.pl').

Remark: For installation questions ask otrs@otrs.org (http://lists.otrs.org/).