Hi!
I've read in the archives of this list that people has had some weird problems
with Apache2+mod_perl2, if version is newer than 1.99_12. After a lot of trial and error
(I'm not an Apache2 or mod_perl2 expert), I've found some config settings that just
make OTRS work with mod_perl without problems (at least under my environment). I
post them here to help others to set it up, as this list archives have helped me a lot
setting up OTRS ;)
My environment is:
- Debian Sarge (unstable), updated almost every week
- Apache2 v2.0.52
- mod_perl2 v1.999.20
- perl v5.8.4
- I've used a virtualhost, as this Apache is also used for other tasks. The configuration is
included via a symlink in /etc/apache2/sites-enabled so it is loaded when Apache2
starts.
- Sessions are stored in FS, because the service is configured in High Availability via
DRBD (seems to work).
Config files:
otrs.conf
---
Perlrequire /usr/share/otrs/otrs-startup.pl
PerlModule Apache::Reload
PerlInitHandler Apache::Reload
NameVirtualHost soporte.valmesa.net
<VirtualHost soporte.valmesa.net>
Alias /otrs-web/ "/usr/share/otrs/var/httpd/htdocs/"
ScriptAlias /otrs/ "/usr/share/otrs/bin/cgi-bin/"
ServerAdmin victor.rodriguez@valmesa.es
DocumentRoot /usr/share/otrs/var/httpd/htdocs/
ServerSignature On
SetHandler perl-script
PerlResponseHandler ModPerl::Registry
PerlOptions +ParseHeaders
PerlSetupEnv On
Options +ExecCGI
</Location>
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
RedirectMatch ^/$ http://soporte.valmesa.net/otrs/Customer.pl
RedirectMatch ^/agentes$ http://soporte.valmesa.net/otrs/index.pl
RedirectMatch ^/agentes/$ http://soporte.valmesa.net/otrs/index.pl
</Directory>
# Valores posibles: debug, info, notice, warn, error, crit, alert, emerg
LogLevel warn
ErrorLog /var/log/apache2/otrs-err.log
CustomLog /var/log/apache2/otrs-acc.log combined
</VirtualHost>
---
End otrs.conf
---
otrs-startup.pl (apache2-startup.pl in OTRS doc's)
Note: I'll put here only the important parts!
---
# TAKE CARE: this one is set to /opt/otrs by default in the Debian package!!
use lib "/usr/share/otrs/";
#Path to lib's Apache2 y Apache:compat (it's a MUST to avoid weird problems!!)
use lib "/usr/lib/perl5/Apache2/";
#use CGI (); CGI->compile(':all');
use CGI (); CGI->compile(':cgi');
use CGI::Carp ();
#use Apache ();
use Apache2;
#This seems to have done the trick to make it work!
use Apache::compat;
use Apache::DBI ();
Apache::DBI->connect_on_init('DBI:mysql:otrs', 'MyOtrsUser', 'MyPass');
use DBI ();
use DBD::mysql ();
---
End otrs-startup.pl
Maybe the problems with mod_perl2 are related to some changes that must be
done to the OTRS code due to the changes introduced by mod_perl2? At least that's
what "use Apache::compat;" seems to say. Anyway, it's a great app ;)
Hope this helps.
Regards!
---
Victor R. Rodriguez
Departamento de Sistemas
Valoraciones del Mediterraneo, S.A.
---