If you want to install OTRS from source, first download the source archive as .tar.gz, .tar.bz2, or .zip file from http://www.otrs.com/try/
Unpack the archive (for example, using tar) into the
directory /opt
, and rename the directory from
otrs-x.x.x to otrs (see Script below).
linux:/opt# tar xf /tmp/otrs-x.x.x.tar.gz linux:/opt# mv otrs-x.x.x otrs linux:/opt# ls otrs linux:/opt#
Skript: Erste Schritte bei der Installation von OTRS.
OTRS should NOT be run with root rights. Next you should add a new user for
OTRS. The home directory of this new user should be
/opt/otrs
. If your web server is not running with the
same user rights as the new 'otrs' user, which is the case on most systems,
you will need to add the new 'otrs' user to the group of the web server user
(see Script below).
linux:/opt# useradd -r -d /opt/otrs/ -c 'OTRS user' otrs linux:/opt# usermod -G nogroup otrs linux:/opt#
Skript: Anlegen eines neuen Nutzers 'otrs' und Hinzufügung zu desselben zu einer Gruppe.
Im nächsten Schritt werden einige Demo-Konfigurationsdateien innerhalb der
entpackten Quelldateien bzw. innerhalb des Homeverzeichnisses des
OTRS-Benutzers kopiert. Die Dateien befinden sich in den Verzeichnissen
/opt/otrs/Kernel
bzw. /opt/otrs/Kernel/Config
und haben die Endung
.dist.
linux:/opt# cd otrs/Kernel/ linux:/opt/otrs/Kernel# cp Config.pm.dist Config.pm linux:/opt/otrs/Kernel# cd Config linux:/opt/otrs/Kernel/Config# cp GenericAgent.pm.dist GenericAgent.pm
Skript: Kopieren von Beispieldateien.
Zum Abschluss der Vorbereitungen werden noch die richtigen Zugriffsrechte
für die Dateien des Ticket Systems gesetzt. Dazu kann das Skript
SetPermissions.sh verwendet werden, das sich im
Verzeichnis bin
innerhalb des Homeverzeichnisses des
OTRS-Benutzers befindet. Das Skript kann mit folgenden Parametern aufgerufen
werden:
otrs.SetPermissions.pl
{
Homedirectory des OTRS Benutzers
} { OTRS Benutzer
} { Webserver Benutzer
} [ Gruppe des OTRS
Benutzers
] [
Gruppe des Webserver Benutzers
]
Läuft Ihr Webserver mit den Benutzerrechten des Benutzers 'otrs', dann lautet das Kommando alsootrs.SetPermissions.pl /opt/otrs --otrs-user=otrs --web-user=otrs. Unter SUSE Linux wird der Webserver mit dem Benutzer wwwrun betrieben. Auf Debian-basierten Systemen ist dies www-data. Geben Sie hier das Komando otrs.SetPermissions.pl /opt/otrs --otrs-user=otrs --web-user=wwwrun --otrs-group=nogroup --web-group=www ein, um die korrekten Zugriffsrechte zu setzen.
OTRS requires some additional Perl modules, as described in Table 3-1. If you install OTRS from source, you will need to install these modules manually. This can be done either with the package manager of your Linux distribution (yast, apt-get) or, as described in this section, through the Perl shell and CPAN. If you're using ActiveState Perl, for instance on Windows, you could use PPM, the built-in Perl Package Manager. We recommend using your package manager if possible.
You can verify which modules you need to install with
otrs.CheckModules.pl. This script is located in the
bin
directory, in the home directory of the 'otrs' user
(see Script below). Please note that some modules are optional.
linux:~# cd /opt/otrs/bin/ linux:/opt/otrs/bin# ./otrs.CheckModules.pl o CGI..............................ok (v3.60) o Crypt::PasswdMD5.................ok (v1.3) o Crypt::SSLeay....................Not installed! (Optional - Required for Generic Interface SOAP SSL connections.) o CSS::Minifier....................ok (v0.01) o Date::Format.....................ok (v2.22) o Date::Pcalc......................ok (v1.2) ...
Skript: Überprüfung benötigter Module.
You should strive to install the missing modules from your Linux distribution's package management system. By doing so, the packages will be automatically updated when new versions are available or when security issues are found. Please refer to your distribution's documentation on how to install additional packages. If the (correct version of) the module is not available from the package repositories, you can also install from CPAN, the Comprehensive Perl Archive Network.
Um eines der oben aufgeführten Module mit Hilfe von CPAN zu installieren, geben Sie als root das Kommando perl -e shell -MCPAN ein. Perl wird im interaktiven Modus gestartet und das CPAN Modul wird geladen. Ist CPAN bereits ordentlich konfiguriert, können Sie die für OTRS benötigten Module mit Hilfe des Kommandos install gefolgt vom Modulnamen einrichten. CPAN weist darauf hin, wenn Abhängigkeiten zwischen einzelnen Modulen nicht erfüllt sind und schlägt automatisch die zusätzlich benötigten Module für die Installation vor.
Führen Sie weiterhin die beiden Befehle perl -cw
bin/cgi-bin/index.pl perl -cw
bin/cgi-bin/customer.pl und perl -cw
bin/PostMaster.pl aus, nach dem Sie in das Verzeichnis
/opt/otrs
gewechselt sind. Wird bei beiden Befehlen die
Meldung "syntax OK" angezeigt, verfügt Ihre Perl-Installation über alle von
OTRS benötigten Module und Sie können im nächsten Schritt mit der
Einrichtung des Webservers beginnen.
linux:~# cd /opt/otrs linux:/opt/otrs# perl -cw bin/cgi-bin/index.pl cgi-bin/installer.pl syntax OK linux:/opt/otrs# perl -cw bin/cgi-bin/customer.pl cgi-bin/customer.pl syntax OK linux:/opt/otrs# perl -cw bin/otrs.PostMaster.pl bin/otrs.PostMaster.pl syntax OK linux:/opt/otrs#
Skript: Crontab-Datei.
First of all, you should install the Apache2 web server and mod_perl; you'd typically do this from your systems package manager. Below you'll find the commands needed to set up Apache on the most popular Linux distributions.
# rhel / centos: linux:# yum install httpd mod_perl # suse: linux:# zypper install apache2-mod_perl # debian/ubuntu: linux:# apt-get install apache2 libapache-mod-perl2
To access the web interface of OTRS via a short URL, Alias and ScriptAlias
entries are needed. Most Apache installations
have a conf.d
directory included. On Linux systems you
can usually find this directory under /etc/apache
or
/etc/apache2
. Log in as root, change to the
conf.d
directory and copy the appropriate template in
/opt/otrs/scripts/apache2-httpd.include.conf
to a file
called otrs.conf
in the Apache configuration directory.
Starten Sie Ihren Webserver neu, um die neue Konfiguration zu laden. Auf den meisten Systemen lässt sich der Webserver über den Befehl /etc/init.d/apache2 restart neu starten (siehe skript unten).
linux:/etc/apache2/conf.d# /etc/init.d/apache2 restart Forcing reload of web server: Apache2. linux:/etc/apache2/conf.d#
Skript: Neustart des Webservers.
Das war bereits die grundlegende Konfiguration des Webservers für OTRS.
The recommended way to configure the database is to run the Web Installer. If you can't use this for some
reason, you can also configure the database manually, as described in this
chapter. If you can't use the web installer to setup the OTRS database, you
have to set it up manually. Scripts with the SQL statements to create and
configure the database are located in scripts/database
,
in the home directory of the 'otrs' user (see Script below).
linux:~# cd /opt/otrs/scripts/database/ linux:/opt/otrs/scripts/database# ls otrs-initial_insert.db2.sql otrs-schema.mysql.sql otrs-schema.oracle.sql otrs-initial_insert.mssql.sql otrs-schema-post.db2.sql otrs-initial_insert.mysql.sql otrs-schema.postgresql.sql otrs-initial_insert.oracle.sql otrs-initial_insert.postgresql.sql otrs-schema-post.mssql.sql otrs-initial_insert.xml otrs-schema-post.mysql.sql otrs-schema.db2.sql otrs-schema-post.oracle.sql otrs-schema-post.postgresql.sql otrs-schema.mssql.sql otrs-schema.xml linux:/opt/otrs/scripts/database#
Skript: Für die Datenbankerstellung benötigte Dateien.
Für die verschiedenen Datenbanktypen sind mehrere .sql-Dateien vorhanden, die nacheinander abgearbeitet werden müssen.
Die OTRS-Datenbank manuell Schritt für Schritt anlegen
Anlegen der Datenbank für OTRS: Legen Sie mit Hilfe Ihres Datenbankinterfaces bzw. Ihrer Datenbankoberfläche die Datenbank an, die später von OTRS verwendet werden soll.
Erstellen der Tabellen: Mit Hilfe der otrs-schema.Datenbanktyp.sql-Dateien
(z. B. otrs-schema.oracle.sql
,
otrs-schema.postgresql.sql
, usw.) können Sie die
Tabellen innerhalb der OTRS Datenbank erzeugen.
Inserting the initial system data: OTRS needs some initial system data to
work properly (e.g. the different ticket states, ticket and notification
types). Depending on the type of database that you are using, you will need
to use one of the following files:
otrs-initial_insert.mysql.sql
,
otrs-initial_insert.oracle.sql
,
otrs-initial_insert.postgresql.sql
or
otrs-initial_insert.mssql.sql
.
Erzeugen von "foreign keys" auf andere Tabellen: Abschließend müssen noch
die "foreign keys" erstellt werden, über die die verschiedenen Tabellen in
der OTRS Datenbank voneinander abhängen. Dies kann mit Hilfe der
otrs-schema-post.Datenbanktyp.sql-Dateien erreicht werden
(z. B. otrs-schema-oracle.post.sql
,
otrs-schema-post.postgresql.sql
, usw.).
Nachdem Sie die Datenbank angelegt haben, sollten Sie die Zugriffsrechte dafür setzen und z. B. sicherstellen, dass nur ein bestimmter Benutzer ohne Datenbank-Administrationsrechte Zugriff auf die OTRS Datenbank hat. Je nachdem, welche Datenbank Sie einsetzen, unterscheiden sich hier die Vorgehensweisen, es sollte jedoch möglich sein dies mit Hilfe Ihres Datenbankinterfaces bzw. Ihrer Datenbankoberfläche zu erledigen.
Wurden die nötigen Einstellungen für die Datenbank vorgenommen, muss nun
noch dem Ticket-System mitgeteilt werden, welche Datenbank es verwenden
soll. Öffnen Sie die Datei Kernel/Config.pm
innerhalb
des Homeverzeichnisses des OTRS Benutzers und passen Sie die dafür
vorgesehenen Parameter an.
# DatabaseHost # (The database host.) $Self->{'DatabaseHost'} = 'localhost'; # Database # (The database name.) $Self->{Database} = 'otrs'; # DatabaseUser # (The database user.) $Self->{DatabaseUser} = 'otrs'; # DatabasePw # (The password of database user.) $Self->{DatabasePw} = 'some-pass';
Skript: Anzupassende Einstellungen.
Damit OTRS voll funktioniert, werden einige cron-Jobs benötigt. Die cron-Jobs sollten mit denselben Benutzerrechten ausgeführt werden, die auch für die restlichen OTRS-Skripte vergeben wurden, d.h. die cron-Jobs sollten in die crontab des Benutzers 'otrs' eingetragen werden.
Alle Skripte für die verschiedenen cron-Jobs befinden sich im Verzeichnis
var/cron
innerhalb des Homeverzeichnisses des Benutzers
'otrs'.
linux:~# cd /opt/otrs/var/cron linux:/opt/otrs/var/cron# ls aaa_base.dist generic_agent.dist rebuild_ticket_index.dist cache.dist pending_jobs.dist session.dist fetchmail.dist postmaster.dist unlock.dist generic_agent-database.dist postmaster_mailbox.dist linux:/opt/otrs/var/cron#
Skript: Für die Erstellung der Cronjobs benötigte Dateien.
Alle Skripte tragen die Endung .dist und sollten zunächst so umkopiert werden, dass keine Endung mehr vorhanden ist.
linux:/opt/otrs/var/cron# for foo in *.dist; do cp $foo `basename $foo .dist`; done linux:/opt/otrs/var/cron# ls aaa_base generic_agent-database.dist rebuild_ticket_index aaa_base.dist generic_agent.dist rebuild_ticket_index.dist cache pending_jobs session cache.dist pending_jobs.dist session.dist fetchmail postmaster unlock fetchmail.dist postmaster.dist unlock.dist generic_agent postmaster_mailbox generic_agent-database postmaster_mailbox.dist linux:/opt/otrs/var/cron#
Skript: Kopieren und Umbenennen der für die Erstellung der Cronjobs benötigten Dateien.
Die folgende Tabelle gibt eine kurze Übersicht über die Aufgabe der verschiedenen Skripte.
Tabelle 2.1. Die verschiedenen Skripte für die cron-Jobs von OTRS.
Skript | Funktion |
---|---|
aaa_base | Über dieses Skript werden die grundlegenden Einstellungen für die crontab des Benutzers 'otrs' festgelegt. |
cache | Löscht abgelaufene Cache-Einträge von der Festplatte. Leert den Cache von CSS- und JavaScript-Dateien. |
fetchmail | Falls Nachrichten mit Hilfe von fetchmail in das System eingespeist werden sollen, kann dieses Skript verwendet werden. |
generic_agent | Mit Hilfe dieses Skripts werden die Jobs des GenericAgents ausgeführt, die über eigene Konfigurationsdateien festgelegt wurden. |
generic_agent-database | Mit Hilfe dieses Skripts werden die Jobs des GenericAgents ausgeführt, die über dem Administrations-Bereich innerhalb von "GenericAgent" angelegt wurden. |
pending_jobs | Mit Hilfe dieses Skripts wird das System auf "wartende" (pending) Tickets überprüft. |
postmaster | Mit Hilfe dieses Skripts wird die Nachrichten-Warteschlange von OTRS überprüft und noch nicht verarbeitete Nachrichten werden im System gespeichert bzw. zugestellt. |
postmaster_mailbox | Mit Hilfe dieses Skripts werden die verschiedenen pop3-Konten abgefragt, die im Administrations-Bereich innerhalb von "PostMaster POP3 Account" eingerichtet wurden. |
rebuild_ticket_index | Mit Hilfe dieses Skripts wird der Ticket-Index für die Queue-Ansicht neu erzeugt, wodurch die Anzeige beschleunigt wird. |
session | Über dieses Skript werden alte und nicht mehr gültige Session-IDs entfernt. |
unlock | Mit Hilfe dieses Skripts wird die Freigabe von Tickets innerhalb des Systems ermöglicht. |
To setup all cron jobs, the script bin/Cron.sh
located
in the home directory of the 'otrs' user can be used. When this script is
executed, it needs a parameter to specify whether you want to install,
remove, or reinstall the cron jobs. The following parameters can be used:
Cron.sh
{
start
} {
stop
} {
restart
} [
OTRS-Benutzer
]
Da die cron-Jobs für den Benutzer 'otrs' angelegt werden sollen, muss das Skript von diesem Benutzer ausgeführt werden. Sind Sie z. B. als Benutzer root am System angemeldet, können Sie mit Hilfe des Kommandos su otrs zum OTRS-Benutzer wechseln. Nehmen Sie also die Installation wie folgt vor.
Bitte beachten Sie, dass durch die Verwendung von
Cron.sh
evtl. andere Cron-Jobs des OTRS-Benutzers
überschrieben bzw. gelöscht werden. Um weitere, nicht von OTRS benötigte
Cron-Jobs für den OTRS-Benutzer zu installieren, erweitern Sie bitte
Cron.sh
dementsprechend.
linux:/opt/otrs/var/cron# cd /opt/otrs/bin/ linux:/opt/otrs/bin# su otrs linux:~/bin$ ./Cron.sh start /opt/otrs/bin Cron.sh - start/stop OTRS cronjobs Copyright (C) 2001-2009 OTRS AG, http://otrs.org/ (using /opt/otrs) done linux:~/bin$ exit exit linux:/opt/otrs/bin#
Skript: Installation der Cronjobs.
Mit Hilfe des Kommandos crontab -l -u otrs, das Sie als root ausführen können, wird die crontab-Datei des Benutzers 'otrs' angezeigt und Sie können überprüfen, ob alle Einträge vorhanden sind.
linux:/opt/otrs/bin# crontab -l -u otrs # -- # cron/aaa_base - base crontab package # Copyright (C) 2001-2014 OTRS AG, http://otrs.com/ # -- # This software comes with ABSOLUTELY NO WARRANTY. # -- # Who gets the cron emails? MAILTO="root@localhost" # -- # cron/cache - delete expired cache # Copyright (C) 2001-2014 OTRS AG, http://otrs.com/ # This software comes with ABSOLUTELY NO WARRANTY. # -- # delete expired cache weekly (Sunday mornings) 20 0 * * 0 $HOME/bin/otrs.CacheDelete.pl --expired >> /dev/null 30 0 * * 0 $HOME/bin/otrs.LoaderCache.pl -o delete >> /dev/null # -- # cron/fetchmail - fetchmail cron of the OTRS # Copyright (C) 2001-2014 OTRS AG, http://otrs.com/ # -- # This software comes with ABSOLUTELY NO WARRANTY. # -- # fetch every 5 minutes emails via fetchmail #*/5 * * * * /usr/bin/fetchmail -a >> /dev/null # -- # cron/generic_agent - otrs.GenericAgent.pl cron of the OTRS # Copyright (C) 2001-2014 OTRS AG, http://otrs.com/ # -- # -- # This software comes with ABSOLUTELY NO WARRANTY. # -- # start generic agent every 20 minutes */20 * * * * $HOME/bin/GenericAgent.pl >> /dev/null # example to execute GenericAgent.pl on 23:00 with # Kernel::Config::GenericAgentMove job file #0 23 * * * $HOME/bin/otrs.GenericAgent.pl -c "Kernel::Config::GenericAgentMove" >> /dev/null # -- # cron/generic_agent - GenericAgent.pl cron of the OTRS # Copyright (C) 2001-2014 OTRS AG, http://otrs.com/ # -- # This software comes with ABSOLUTELY NO WARRANTY. # -- # start generic agent every 10 minutes */10 * * * * $HOME/bin/otrs.GenericAgent.pl -c db >> /dev/null # -- # cron/pending_jobs - pending_jobs cron of the OTRS # Copyright (C) 2001-2014 OTRS AG, http://otrs.com/ # -- # This software comes with ABSOLUTELY NO WARRANTY. # -- # check every 120 min the pending jobs 45 */2 * * * $HOME/bin/otrs.PendingJobs.pl >> /dev/null # -- # cron/postmaster - postmaster cron of the OTRS # Copyright (C) 2001-2014 OTRS AG, http://otrs.com/ # -- # This software comes with ABSOLUTELY NO WARRANTY. # -- # check daily the spool directory of OTRS 10 0 * * * $HOME/bin/otrs.ReprocessMails.pl >> /dev/null # -- # cron/postmaster_mailbox - postmaster_mailbox cron of the OTRS # Copyright (C) 2001-2014 OTRS AG, http://otrs.com/ # -- # This software comes with ABSOLUTELY NO WARRANTY. # -- # fetch emails every 10 minutes */10 * * * * $HOME/bin/otrs.PostMasterMailbox.pl >> /dev/null # -- # cron/rebuild_ticket_index - rebuild ticket index for OTRS # Copyright (C) 2001-2014 OTRS AG, http://otrs.com/ # -- # This software comes with ABSOLUTELY NO WARRANTY. # -- # just every day 01 01 * * * $HOME/bin/otrs.RebuildTicketIndex.pl >> /dev/null # -- # cron/session - delete old session ids of the OTRS # Copyright (C) 2001-2014 OTRS AG, http://otrs.com/ # -- # This software comes with ABSOLUTELY NO WARRANTY. # -- # delete every 120 minutes old/idle session ids 55 */2 * * * $HOME/bin/otrs.DeleteSessionIDs.pl --expired >> /dev/null # -- # cron/unlock - unlock old locked ticket of the OTRS # Copyright (C) 2001-2014 OTRS AG, http://otrs.com/ # -- # This software comes with ABSOLUTELY NO WARRANTY. # -- # unlock every hour old locked tickets 35 * * * * $HOME/bin/otrs.UnlockTickets.pl --timeout >> /dev/null linux:/opt/otrs/bin#
Skript: Crontab-Datei.
OTRS comes with a scheduler service that is used to perform asynchronous tasks.
The OTRS RPMs will set up the Scheduler Service automatically. If you
install from source, you can install the service by copying the
scripts/otrs-scheduler-linux
file to
/etc/init.d
and giving it the appropriate permissions.
This will make sure the scheduler service starts when the system starts up.