-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnetdisco_apache.conf
56 lines (50 loc) · 1.7 KB
/
netdisco_apache.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# MASON Configuration for netdisco
# This file applied to the global server space.
# $Id$
#
# Apache 1.x Users -- Comment out these four lines
#
LoadModule perl_module libexec/apache2/mod_perl.so
LoadModule apreq_module libexec/apache2/mod_apreq2.so
PerlModule Apache2::compat
PerlModule Apache2::Request
# Pool Database Connections
PerlModule Apache::DBI
<Directory /usr/local/netdisco/html>
order allow,deny
allow from all
</Directory>
<Perl>
# Preload the netdisco module into global server space.
# and parse the config file only once.
{ package HTML::Mason::Commands;
use lib '/usr/local/netdisco';
use netdisco qw/:all/;
&netdisco::config('/usr/local/netdisco/netdisco.conf');
}
# Setup Mason and Session Handler
{ package netdisco::Mason;
use HTML::Mason;
use HTML::Mason::ApacheHandler;
use strict;
my $ah = new HTML::Mason::ApacheHandler(
args_method => 'mod_perl',
comp_root => '/usr/local/netdisco/html',
data_dir => '/usr/local/netdisco/mason',
request_class => 'MasonX::Request::WithApacheSession',
session_class => 'Apache::Session::Postgres',
session_commit => 1,
session_use_cookie => 1,
session_cookie_expires => '+1y',
session_cookie_name => 'netdisco',
#!! Change the following lines to match your Database Configuration.
session_data_source => 'dbi:Pg:dbname=netdisco',
session_user_name => 'netdisco',
session_password => 'PASSWORDHERE',
);
sub handler {
my $request = shift;
return $ah->handle_request($request);
}
}
</Perl>