Permalink
Browse files

More work to be able to run OPAR under mod_perl: Add a basic startup …

…script that preloads a lot of modules and add a sample mod_perl configuration.
  • Loading branch information...
1 parent bf6166c commit 6faf6941394308ecb08fb8d55a0457b5b816ee5c @reneeb committed Feb 21, 2011
Showing with 113 additions and 0 deletions.
  1. +59 −0 opar/apache2-perl-startup.pl
  2. +54 −0 vhost_opar_mod_perl.conf
@@ -0,0 +1,59 @@
+#!/usr/bin/perl -w
+
+use strict;
+use warnings;
+
+# make sure we are in a sane environment.
+$ENV{MOD_PERL} =~ /mod_perl/ or die "MOD_PERL not used!";
+
+# switch to unload_package_xs, the PP version is broken in Perl 5.10.1.
+# see http://rt.perl.org/rt3//Public/Bug/Display.html?id=72866
+BEGIN {
+ $ModPerl::Util::DEFAULT_UNLOAD_METHOD = 'unload_package_xs';
+}
+use ModPerl::Util;
+
+# set otrs lib path!
+use lib "/var/www/perl-services/opar/lib/";
+
+# pull in things we will use in most requests so it is read and compiled
+# exactly once
+
+#use CGI (); CGI->compile(':all');
+use CGI ();
+CGI->compile(':cgi');
+use CGI::Carp ();
+
+#use Apache::DBI ();
+#Apache::DBI->connect_on_init('DBI:mysql:otrs', 'otrs', 'some-pass');
+use DBI ();
+
+# enable this if you use mysql
+#use DBD::mysql ();
+#use Kernel::System::DB::mysql;
+
+# enable this if you use postgresql
+#use DBD::Pg ();
+#use Kernel::System::DB::postgresql;
+
+# enable this if you use oracle
+#use DBD::Oracle ();
+#use Kernel::System::DB::oracle;
+
+# core modules
+use Moose;
+use DBIx::Class;
+
+use OTRS::OPR::DAO::User;
+use OTRS::OPR::DAO::Package;
+
+use OTRS::OPR::DB::Schema;
+
+use OTRS::OPR::Web::App;
+use OTRS::OPR::Web::App::Prerun;
+use OTRS::OPR::Web::App::Login;
+use OTRS::OPR::Web::Author;
+use OTRS::OPR::Web::Guest;
+
+
+1;
View
@@ -0,0 +1,54 @@
+<VirtualHost *>
+ ServerAdmin webmaster@localhost
+ ServerName opar.perl-services.de
+
+ DocumentRoot /var/www/perl-services/opar/html/
+
+# agent, admin and customer frontend
+ScriptAlias /bin/ "/var/www/perl-services/opar/opar/"
+
+# if mod_perl is used
+<IfModule mod_perl.c>
+
+ # load all otrs modules
+ PerlRequire /var/www/perl-services/opar/opar/apache2-perl-startup.pl
+
+ # Apache::Reload - Reload Perl Modules when Changed on Disk
+ PerlModule Apache2::Reload
+ PerlInitHandler Apache2::Reload
+ PerlModule Apache2::RequestRec
+
+ PerlSetEnv PERL5LIB /var/www/perl-services/opar/lib/
+
+ # set mod_perl2 options
+ <Location /bin>
+ ErrorDocument 403 /bin/index.cgi
+ SetHandler perl-script
+ PerlResponseHandler ModPerl::Registry
+ Options +ExecCGI
+ PerlOptions +ParseHeaders
+
+ PerlOptions +SetupEnv
+ Order allow,deny
+ Allow from all
+ </Location>
+
+</IfModule>
+
+# directory settings
+<Directory "/var/www/perl-services/opar/opar/">
+ AllowOverride None
+ Options +ExecCGI -Includes
+ Order allow,deny
+ Allow from all
+</Directory>
+
+ ErrorLog /var/log/apache2/error.log
+
+ # Possible values include: debug, info, notice, warn, error, crit,
+ # alert, emerg.
+ LogLevel warn
+
+ CustomLog /var/log/apache2/access.log combined
+ ServerSignature Off
+</VirtualHost>

0 comments on commit 6faf694

Please sign in to comment.