Hi, I had problems with rewrite-config.PL with a commercial hosting company where the hostname() gave a wrong answer. I suggest to replace to call to hostname() in rewrite-config.PL with calls to system utilities that a user could use to verify the state of the system. From the code of 3.00.04_fixed, I suggest a new rewrite-config.PL as diff rewrite-config_org.PL rewrite-config.PL 63,65c63,73 < $myhost = hostname(); < $mydomain = $myhost; < $mydomain =~ s/^.*?\.//; ---
# set host and domain using dns utility calls my $myhost = `hostname`; chomp $myhost; my $mydomain= `dnsdomainname`; chomp $mydomain; # use earlier method if this fails if(not $myhost or not $mydomain) { $myhost = hostname(); $mydomain = $myhost; $mydomain =~ s/^.*?\.//; }
Cheers, Thomas Krichel http://openlib.org/home/krichel http://authorclaim.org/profile/pkr1 skype: thomaskrichel
Thomas Krichel <krichel@openlib.org> wrote:
I had problems with rewrite-config.PL with a commercial hosting company where the hostname() gave a wrong answer. I suggest to replace to call to hostname() in rewrite-config.PL with calls to system utilities that a user could use to verify the state of the system. [...]
If hostname() is giving a wrong answer, the system has some problems and there is no guarantee that the system utilities will give a correct answer either. Also, hostname will try the system utilities in some situations already - see man Sys::Hostname: Attempts several methods of getting the system hostname and then caches the result. It tries the first available of the C library's gethost- name(), `$Config{aphostname}`, uname(2), "syscall(SYS_gethostname)", `hostname`, `uname -n`, and the file /com/host. If all that fails it "croak"s. It might be worth checking which of those is giving your wrong answer, to see if there is a misconfiguration by the hosting company which might come back to haunt you later. On awkward systems like that, it would be safer if the operator sets the WEBSERVER_HOST and WEBSERVER_IP environment variables before the installation. Hope that explains, -- MJ Ray (slef) Webmaster and LMS developer at | software www.software.coop http://mjr.towers.org.uk | .... co IMO only: see http://mjr.towers.org.uk/email.html | .... op
participants (2)
-
MJ Ray -
Thomas Krichel