X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=rewrite-config.PL;h=9caadf17fb3e73525f214f2bd81a10d798b83346;hb=867ece18fcf85c9684c198a7bf450f2494700264;hp=f1952c2b1bec00ebd6604f3ac2a0d01e0bbed26d;hpb=6835e192f4bc6b028e5918974665337c43c9b603;p=koha.git diff --git a/rewrite-config.PL b/rewrite-config.PL index f1952c2b1b..9caadf17fb 100644 --- a/rewrite-config.PL +++ b/rewrite-config.PL @@ -60,11 +60,21 @@ also need to override WEBSERVER_IP. =cut -$myhost = hostname(); -$mydomain = $myhost; -$mydomain =~ s/^.*?\.//; -# This is set here to rescue systems with broken DNS -$myip = $ENV{'WEBSERVER_IP'} || inet_ntoa(scalar gethostbyname($myhost||'localhost')) || die "Cannot get our own IP address: DNS fault?"; +if ( $myhost = $ENV{WEBSERVER_HOST} || hostname ) { + ( $mydomain = $myhost ) =~ s/.*?\.//; +} else { + $myhost = 'localhost'; + $mydomain = 'localdomain'; +} + +unless ( $myip = $ENV{WEBSERVER_IP} ) { + my $byname = gethostbyname( $myhost ) + or die "Could not get the IP address of $myhost, DNS fault? ($!)"; + $myip = inet_ntoa $byname + or die "can't inet_ntoa ($!)"; +} + + $prefix = $ENV{'INSTALL_BASE'} || "/usr"; # These are our configuration guesses @@ -125,6 +135,8 @@ $prefix = $ENV{'INSTALL_BASE'} || "/usr"; "__PAZPAR2_TOGGLE_XML_PRE__" => '', "__AUTH_INDEX_MODE__" => 'grs1', + "__RUN_DATABASE_TESTS__" => 'no', + "__PATH_TO_ZEBRA__" => "", ); # Override configuration from the environment