Gossamer Forum
Home : Products : DBMan SQL : Discussion :

domain name setting

Quote Reply
domain name setting
Hi,

I would like to use one DBMan SQL implementations with different virtual domains. I configured Apache in a way that both a.mydomain.com and b.mydomain.com point to the dbman directory. So far, so good. The problem is, that I don't know what to enter in the config fields db_cgi_url, admin_root_url and db_images_url. Can I just use relative paths here?

Jasper

http://www.bookings.org
Quote Reply
Re: [jaspercram] domain name setting In reply to
You should be able to just use a relative path...eg...

/cgi-bin/dbman
Quote Reply
Re: [Paul] domain name setting In reply to
After making the changes, I get the following errors when restarting Apache/mod_perl:
Code:
Starting Logging
Preloading DBMan SQL scripts into mod_perl:
. Use of uninitialized value at /usr/local/web/dbman/cgi-bin/admin//Dbsql/mod_perl.pm line 76.
. Use of uninitialized value at /usr/local/web/dbman/cgi-bin/admin//Dbsql/mod_perl.pm line 76.
. Use of uninitialized value at /usr/local/web/dbman/cgi-bin/admin//Dbsql/mod_perl.pm line 80.
. Use of uninitialized value at /usr/local/web/dbman/cgi-bin/admin//Dbsql/mod_perl.pm line 80.
. Use of uninitialized value at /usr/local/web/dbman/cgi-bin/admin//Dbsql/mod_perl.pm line 80.
. Use of uninitialized value at /usr/local/web/dbman/cgi-bin/admin//Dbsql/mod_perl.pm line 80.
. Use of uninitialized value at /usr/local/web/dbman/cgi-bin/admin//Dbsql/mod_perl.pm line 80.

All scripts compiled and loaded ok!

Is that good or bad news?

Jasper

http://www.bookings.org
Quote Reply
Re: [jaspercram] domain name setting In reply to
What is on those lines?

The error means something is undefined.
Quote Reply
Re: [Paul] domain name setting In reply to
Code:
sub pre_load {
# -------------------------------------------------------------------
# Pre loads all scripts using Apache::RegistryLoader.
#
my $cfg = new Dbsql::Config;
my $url = $cfg->{db_cgi_url};

my ($base_url) = $url =~ m,^https?://[^/]+(.*),;
$base_url =~ s,/$,,;
my $path = $cfg->{admin_root_path};
$path =~ s,/admin/?$,,;

# Preload all our cgi scripts.
require Apache::RegistryLoader;
my $r = Apache::RegistryLoader->new;
opendir (DIR, "$path") or die "Unable to open $path ($!)";
my @scripts = grep { /\.cgi/ } readdir (DIR);
closedir (DIR);
opendir (DIR, "$path/admin") or die "Unable to open admin: $path/admin";
my @admin = grep { /\.cgi/ } readdir (DIR);
closedir (DIR);

# Turn on warnings to check that the scripts are ok.
local $^W = 1;
print STDERR "Preloading DBMan SQL scripts into mod_perl:\n\t";
foreach my $script (@scripts) {
print STDERR ". ";
$r->handler ($base_url . '/' . $script, $path .'/' . $script);
}
foreach my $script (@admin) {
print STDERR ". ";
$r->handler ($base_url . '/admin/' . $script, $path .'/admin/' . $script);
}
print STDERR "\nAll scripts compiled and loaded ok!\n\n";
}

http://www.bookings.org
Quote Reply
Re: [jaspercram] domain name setting In reply to
Ah, it looks like you'll have to change this bit:

my ($base_url) = $url =~ m,^https?://[^/]+(.*),;


Try:

my ($base_url) = $url =~ m,^(/.*),;
Quote Reply
Re: [Paul] domain name setting In reply to
Would that be a fix for my code or an improvement of the DBMan SQL code?

Jasper

http://www.bookings.org
Quote Reply
Re: [jaspercram] domain name setting In reply to
A fix for your code. Because you removed your domain name the regex is failing so it needs to be changed.