# --
# README.webserver - webserver description of OTRS
# Copyright (C) 2001-2008 OTRS AG, http://otrs.org/
# --
# $Id: README.webserver,v 1.17 2008/04/29 11:40:58 tr Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (GPL). If you
# did not receive this file, see http://www.gnu.org/licenses/gpl-2.0.txt.
# --

Which webserver is needed?
==========================
I prefer the apache webserver (http://httpd.apache.org).

Configuration:
==============
"After" this steps, you will get the login page at
http://your-host/otrs/index.pl or http://your-host/otrs/installer.pl.

SuSE Linux:
===========
a) Install the RPM-Package (http://otrs.org/ - "rpm -i otrs-xxx.rpm").

b) The manual way:
  Use the "$OTRS_HOME/scripts/suse-httpd.include.conf" include config file.

  Add it to /etc/sysconfig/apache with HTTPD_CONF_INCLUDE_FILES
  [...]
  HTTPD_CONF_INCLUDE_FILES=/usr/local/otrs/scripts/suse-httpd.include.conf
  [...]

  Start SuSEconfig and restart the webserver (rcapache restart).


Or edit the httpd.conf directly:
================================
a)
 *) Change the webserver user (normaly www) to the OTRS user (otrs).

  [...]
  User www
  [...]
  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]"
    e. g.
     Webserver with otrs user: "SetPermissions.sh /usr/local/otrs otrs otrs"
     Webserver with www user (e. g. SuSE): "SetPermissions.sh /usr/local/otrs otrs www"
     Webserver with apache user (e. g. Redhat): "SetPermissions.sh /usr/local/otrs otrs apache"

b)
 *)
  Without mod_perl (just CGI):
  ============================
  Add this to the cgi-bin stuff section in httpd.conf
  [...]
  Alias /otrs-web/ "/usr/local/otrs/var/httpd/htdocs/"
  ScriptAlias /otrs/ "/usr/local/otrs/bin/cgi-bin/"
  [...]

 *)
  With mod_perl 1 (speed!):
  =======================
  Add this to the mod_perl stuff section in httpd.conf
  [...]
    # agent, admin and customer frontend (mod_alias required!)
    ScriptAlias /otrs/ "/usr/local/otrs/bin/cgi-bin/"
    Alias /otrs-web/ "/usr/local/otrs/var/httpd/htdocs/"

    # load all otrs modules (speed improvement!)
#   Perlrequire /usr/local/otrs/scripts/apache-perl-startup.pl

    # Apache::StatINC - Reload %INC files when updated on disk
    # (just use it for testing, setup, ... not for high productiv systems)
#   PerlInitHandler Apache::StatINC

    <Location /otrs>
        ErrorDocument 403 /otrs/index.pl
        SetHandler  perl-script
        PerlHandler Apache::Registry
        Options ExecCGI
        PerlSendHeader On
        PerlSetupEnv On
    </Location>
  [...]

 *)
  With mod_perl 2 (speed!):
  =======================
  Add this to the mod_perl stuff section in httpd.conf
  [...]
    # agent, admin and customer frontend
    ScriptAlias /otrs/ "/usr/local/otrs/bin/cgi-bin/"
    Alias /otrs-web/ "/usr/local/otrs/var/httpd/htdocs/"

    # load all otrs modules
    Perlrequire /usr/local/otrs/scripts/apache2-perl-startup.pl

    # Apache::Reload - Reload Perl Modules when Changed on Disk
    PerlModule Apache2::Reload
    PerlInitHandler Apache2::Reload
    PerlModule Apache2::RequestRec

    # set mod_perl2 options
    <Location /otrs>
#        ErrorDocument 403 /otrs/customer.pl
        ErrorDocument 403 /otrs/index.pl
        SetHandler  perl-script
        PerlResponseHandler ModPerl::Registry
        Options +ExecCGI
        PerlOptions +ParseHeaders
        PerlOptions +SetupEnv
        Order allow,deny
        Allow from all
    </Location>
  [...]

  Edit the scripts/apache-perl-startup.pl / scripts/apache2-perl-startup.pl script:

   - Establish datababase connections on process startup (httpd).

     [...]
     use Apache::DBI ();
     Apache::DBI->connect_on_init('DBI:mysql:otrs', 'otrs', 'some-pass');
     # Apache::DBI->connect_on_init($data_source, $username, $auth, \%attr)
     [...]

   - Change the otrs lib dir (if needed)!

     [...]
     # --
     # set otrs lib path!
     # --
     use lib "/path/to/otrs/";
     use lib "/path/to/otrs/Kernel/cpan-lib";
     [...]

  Nice! You will love mod_perl! ,-)

c)
  Restart the webserver
  =====================

d)
  Web-Installer
  =============
   http://yourhost/otrs/installer.pl

  First login
  ===========
   http://yourhost/otrs/index.pl
   User: root@localhost
   PW: root

EOF
