---- Reported by Andrew.moore@liblime.com 2008-05-21 12:40:29 ---- The OPACBaseURL system preference should be replaced or automatically populated with the value of the $ENV{'SERVER_NAME'} environment variable. SERVER_NAME is supposed to be populated with "The server's hostname, DNS alias, or IP address as it would appear in self-referencing URLs" by apache. This eliminates one configuration step after installation. ---- Additional Comments From rch@liblime.com 2008-05-21 14:55:34 ---- If I have a ServerName and a ServerAlias in my VirtualHost directive, will $ENV{'SERVER_NAME'} be the url I hit the page with? or will it be ServerName ? ---- Additional Comments From Sebastien.Hinderer@snv.jussieu.fr 2009-07-28 15:19:39 ---- Why removing this system preference ? With the environment variable, it is not possible to set-up koha on a system where it can't have a virtual host dedicated to it. Concretely, this means that KOha can't be installed by a non root user on a system where he only has access to addresses such as http://host.domain.net/home/koha/ To me, the system preference is strictly more powerful than the environemnt variable. ---- Additional Comments From gmcharlt@gmail.com 2009-08-13 01:53:19 ---- Per the comment in the commit for http://bugs.koha.org/cgi-bin/bugzilla3/show_bug.cgi?id=3525 [1], there is another case where limited use of the OPACBaseURL syspref is needed after all: when the staff interface needs to link to the OPAC. [1] http://git.koha.org/cgi-bin/gitweb.cgi?p=Koha;a=commit;h=baa0b0814919f4cb117c2ea9fcd0d726c0191bad --- Bug imported by chris@bigballofwax.co.nz 2010-05-21 00:47 UTC --- This bug was previously known as _bug_ 2152 at http://bugs.koha.org/cgi-bin/bugzilla3/show_bug.cgi?id=2152 Actual time not defined. Setting to 0.0 The original reporter of this bug does not have an account here. Reassigning to the person who moved it here: chris@bigballofwax.co.nz. Previous reporter was Andrew.moore@liblime.com.
After some experimenting on proxied and non-proxied connections, it appears that $ENV{'SERVER_NAME'} is the domain name of the URL that a user hits the page with, and NOT the ServerName provided in the Apache configuration. This means that the OPACBaseURL set in Auth.pm during the "get_template_and_user" call will depend on the URL that a user provided to get to that page. Except...when the Koha server is sitting behind a proxy server. In that case, the $ENV{'SERVER_NAME'} appears to come from the proxy server (I'm not certain what name is used...but it looks like some kind of local identifier), while $ENV{'HTTP_X_FORWARDED_HOST'} will contain the domain of the URL provided by the user. I'm opening bug 11575 to investigate further into this.