|
From: Bill A. <bi...@an...> - 2010-12-09 23:13:17
|
I created a new database for a second Netdisco instance, and can
successfully discover devices and populate the second database tables.
The front end is
where I am having trouble. I think the problem lies with this part of the httpd.conf
file:
{ package HTML::Mason::Commands;
use netdisco qw/:all/;
&netdisco::config('/etc/netdisco/netdisco.conf');
}
I can't figure out how to tell the second package to use a different configuration
file.
Here is what I have so far:
# Apache
Configuration for Netdisco
# This is applied to each virtual server
Alias
/netdisco "/usr/share/netdisco/html/"
<Location /netdisco>
Options +Indexes
</Location>
#
Turn on MASON for .html documents
PerlSetVar site "netdisco"
<LocationMatch
"/netdisco/.*\.html$">
SetHandler
perl-script
PerlHandler netdisco::Mason
</LocationMatch>
# Decline access to mason internals
<LocationMatch
"/netdisco/.*(\.mc|autohandler|dhandler)$">
SetHandler perl-script
PerlInitHandler Apache::Constants::NOT_FOUND
</LocationMatch>
Alias
/netdisco_dese "/usr/share/netdisco/html/"
<Location
/netdisco_dese>
Options +Indexes
</Location>
# Turn on MASON for .html documents
PerlSetVar site
"netdisco_dese"
<LocationMatch "/netdisco_dese/.*\.html$">
SetHandler perl-script
PerlHandler netdisco_dese::Mason
</LocationMatch>
# Decline access to mason internals
<LocationMatch
"/netdisco_dese/.*(\.mc|autohandler|dhandler)$">
SetHandler perl-script
PerlInitHandler Apache::Constants::NOT_FOUND
</LocationMatch>
# MASON
Configuration for netdisco
# This file applied to the global server space.
#
$Id: netdisco_apache.conf,v 1.15 2009/06/02 23:27:02 maxbaker Exp $
#
# 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
netdisco qw/:all/;
&netdisco::config('/etc/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/share/netdisco/html',
data_dir =>
'/var/lib/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
=> 'dbpassword',
);
sub handler {
my
$request = shift;
return
$ah->handle_request($request);
}
}
{ package
netdisco_dese::Mason;
use HTML::Mason;
use
HTML::Mason::ApacheHandler;
use strict;
my
$ah = new HTML::Mason::ApacheHandler(
args_method => 'mod_perl',
comp_root =>
'/usr/share/netdisco/html',
data_dir =>
'/var/lib/netdisco_dese/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_dese',
#!! Change the following lines to match your Database Configuration.
session_data_source =>
'dbi:Pg:dbname=netdisco_dese',
session_user_name => 'netdisco',
session_password
=> 'dbpassword',
);
sub handler {
my
$request = shift;
return
$ah->handle_request($request);
}
}
</Perl>
>
>
> Somewhere on the developer mailing list, someone
was discussing a change to allow multiple
> netdisco front end instances, but I can't find
how to set up multiple front ends.
>
> Has
> anyone done this before?
>
>
>
>
------------------------------------------------------------------------------
> What
happens now with your Lotus Notes apps - do you make another costly
> upgrade, or settle
for being marooned without product support? Time to move
> off Lotus Notes and onto the
cloud with Force.com, apps are easier to build,
> use, and manage than apps on traditional
platforms. Sign up for the Lotus
> Notes Migration Kit to learn more.
http://p.sf.net/sfu/salesforce-d2d
> _______________________________________________
> Netdisco mailing list
> net...@li...
>
https://lists.sourceforge.net/lists/listinfo/netdisco-users
>
|