Could someone please tell me where Koha 3.18 should find $ENV{'SERVER_NAME'} and $ENV{'SERVER_PORT'} -- these are not included in the %ENV by Apache 2.4 -- required by C4/Auth.pm at line 442? DOMAIN and OPACPORT are defined in /etc/koha/koha-sites.conf and properly included in the Apache2 setup. 3.08 is coded slightly differently and doesn't give rise to a warning. The missing info does not appear to be at all fatal (just throws a "Use of uninitialized value" and gives $opac_base_url as ':') but I'm trying to get everything "squeaky clean" upstream of ZOOM Thanks -- Paul
Greetings, 1) Why not just set the OPACBaseURL system preference in the first place?! If you do (1 ), then you don't have to do (2 ), but if you are crazy, paranoid go ahead: 2) /etc/apache2/sites-enabled/koha.conf (or whatever your instance name is) a) Look for KOHA_CONF and create the appropriate entries for SERVER_NAME and SERVER_PORT For example (yours may differ): SetEnv SERVER_NAME library.myDNSname.org SetEnv SERVER_PORT 80 # because this should match the block it is in. b) Do step (a ) TWICE (because OPAC and Staff are both in the same configuration file). GPML, Mark Tompsett
-----Original Message----- From: koha-devel-bounces@lists.koha-community.org [mailto:koha-devel- bounces@lists.koha-community.org] On Behalf Of Mark Tompsett Sent: Thursday, 15 January 2015 11:01 AM To: Paul A Cc: koha-devel@lists.koha-community.org Subject: Re: [Koha-devel] Apache 2.4 env vars
Greetings,
1) Why not just set the OPACBaseURL system preference in the first place?!
If you do (1 ), then you don't have to do (2 ), but if you are crazy,
I agree about setting OpacBaseURL. Just set that. C4::Auth should just be using SERVER_NAME and SERVER_PORT as a fall-back. That said, Apache 2.4 really should be automatically setting the SERVER_NAME and SERVER_PORT environmental variables. Paul, how are you accessing this Koha instance? Via a named host or via IP address? I'm guessing that you're just using an IP address... By default, Apache will have the UseCanonicalName set to OFF. It appears that this means that it will populate SERVER_NAME and SERVER_PORT based on what it gets from your client request, rather than the ServerName directive in the Apache conf. Now, if you're using a named host, that won't matter since it'll match the ServerName anyway before setting the environmental variables (I imagine). However, if you're access it by IP address... I could see it not setting the SERVER_NAME variable. I imagine that SERVER_PORT is still being set though. I wouldn't do "SetENV SERVER_NAME" or "SetEnv SERVER_PORT" though. The best case is that it won't actually do anything. The worst case is that it will possibly confuse Apache. I might take a moment to test my theory about the named host vs ip address... David Cook Systems Librarian Prosentient Systems 72/330 Wattle St, Ultimo, NSW 2007 paranoid go
ahead: 2) /etc/apache2/sites-enabled/koha.conf (or whatever your instance name is) a) Look for KOHA_CONF and create the appropriate entries for SERVER_NAME and SERVER_PORT For example (yours may differ): SetEnv SERVER_NAME library.myDNSname.org SetEnv SERVER_PORT 80 # because this should match the block it is in. b) Do step (a ) TWICE (because OPAC and Staff are both in the same configuration file).
GPML, Mark Tompsett
_______________________________________________ Koha-devel mailing list Koha-devel@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel website : http://www.koha-community.org/ git : http://git.koha- community.org/ bugs : http://bugs.koha-community.org/
At 11:32 AM 1/15/2015 +1100, David Cook wrote:
I agree about setting OpacBaseURL. Just set that. C4::Auth should just be using SERVER_NAME and SERVER_PORT as a fall-back.
That said, Apache 2.4 really should be automatically setting the SERVER_NAME and SERVER_PORT environmental variables.
Paul, how are you accessing this Koha instance? Via a named host or via IP address? I'm guessing that you're just using an IP address...
David -- thanks. The staff-admin is IP-based, but the OPAC is part of about a dozen name-based VirtualHosts. I could probably IP-base them internally, but it makes firewall management a bit more complex.
By default, Apache will have the UseCanonicalName set to OFF. It appears that this means that it will populate SERVER_NAME and SERVER_PORT based on what it gets from your client request, rather than the ServerName directive in the Apache conf. Now, if you're using a named host, that won't matter since it'll match the ServerName anyway before setting the environmental variables (I imagine).
That seems about right... :) and as I said a few minutes ago in my reply to Mark I didn't want to get too deep into re-inventing the wheel. Note that for Apache ServerName /= SERVER_NAME. Best -- Paul
However, if you're access it by IP address... I could see it not setting the SERVER_NAME variable. I imagine that SERVER_PORT is still being set though.
I wouldn't do "SetENV SERVER_NAME" or "SetEnv SERVER_PORT" though. The best case is that it won't actually do anything. The worst case is that it will possibly confuse Apache.
I might take a moment to test my theory about the named host vs ip address...
David Cook Systems Librarian Prosentient Systems 72/330 Wattle St, Ultimo, NSW 2007
-----Original Message----- From: koha-devel-bounces@lists.koha-community.org [mailto:koha-devel- bounces@lists.koha-community.org] On Behalf Of Mark Tompsett Sent: Thursday, 15 January 2015 11:01 AM To: Paul A Cc: koha-devel@lists.koha-community.org Subject: Re: [Koha-devel] Apache 2.4 env vars
Greetings,
1) Why not just set the OPACBaseURL system preference in the first place?!
If you do (1 ), then you don't have to do (2 ), but if you are crazy, paranoid go ahead: 2) /etc/apache2/sites-enabled/koha.conf (or whatever your instance name is) a) Look for KOHA_CONF and create the appropriate entries for SERVER_NAME and SERVER_PORT For example (yours may differ): SetEnv SERVER_NAME library.myDNSname.org SetEnv SERVER_PORT 80 # because this should match the block it is in. b) Do step (a ) TWICE (because OPAC and Staff are both in the same configuration file).
GPML, Mark Tompsett
_______________________________________________ Koha-devel mailing list Koha-devel@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel website : http://www.koha-community.org/ git : http://git.koha- community.org/ bugs : http://bugs.koha-community.org/
--- Maritime heritage and history, preservation and conservation, research and education through the written word and the arts. <http://NavalMarineArchive.com> and <http://UltraMarine.ca>
Paul: Yes, I do believe that I said that Apache ServerName != SERVER_NAME (unless UseCanonicalName is turned on it seems) :p. So, I've just gone and run up a new install Koha (via the packages) on a virtualized Ubuntu 14.04, which uses Apache 2.4. I just dumped out the SERVER_NAME and SERVER_PORT environmental variables, and... they had the IP address and the port number 80 in them respectively. I got the exact same result on OpenSuse using Apache 2.2. So if those environmental variables are empty for you... something is probably wrong with your Apache configuration. David Cook Systems Librarian Prosentient Systems 72/330 Wattle St, Ultimo, NSW 2007
-----Original Message----- From: Paul A [mailto:paul.a@navalmarinearchive.com] Sent: Thursday, 15 January 2015 12:01 PM To: koha-devel@lists.koha-community.org Cc: David Cook; 'Mark Tompsett' Subject: RE: [Koha-devel] Apache 2.4 env vars
At 11:32 AM 1/15/2015 +1100, David Cook wrote:
I agree about setting OpacBaseURL. Just set that. C4::Auth should just be using SERVER_NAME and SERVER_PORT as a fall-back.
That said, Apache 2.4 really should be automatically setting the SERVER_NAME and SERVER_PORT environmental variables.
Paul, how are you accessing this Koha instance? Via a named host or via IP address? I'm guessing that you're just using an IP address...
David -- thanks. The staff-admin is IP-based, but the OPAC is part of about a dozen name-based VirtualHosts. I could probably IP-base them internally, but it makes firewall management a bit more complex.
By default, Apache will have the UseCanonicalName set to OFF. It appears that this means that it will populate SERVER_NAME and SERVER_PORT based on what it gets from your client request, rather than the ServerName directive in the Apache conf. Now, if you're using a named host, that won't matter since it'll match the ServerName anyway before setting the environmental variables (I imagine).
That seems about right... :) and as I said a few minutes ago in my reply to Mark I didn't want to get too deep into re-inventing the wheel. Note that for Apache ServerName /= SERVER_NAME.
Best -- Paul
However, if you're access it by IP address... I could see it not setting the SERVER_NAME variable. I imagine that SERVER_PORT is still
being set though.
I wouldn't do "SetENV SERVER_NAME" or "SetEnv SERVER_PORT" though.
best case is that it won't actually do anything. The worst case is that it will possibly confuse Apache.
I might take a moment to test my theory about the named host vs ip address...
David Cook Systems Librarian Prosentient Systems 72/330 Wattle St, Ultimo, NSW 2007
-----Original Message----- From: koha-devel-bounces@lists.koha-community.org [mailto:koha-devel- bounces@lists.koha-community.org] On Behalf Of Mark Tompsett Sent: Thursday, 15 January 2015 11:01 AM To: Paul A Cc: koha-devel@lists.koha-community.org Subject: Re: [Koha-devel] Apache 2.4 env vars
Greetings,
1) Why not just set the OPACBaseURL system preference in the first
The place?!
If you do (1 ), then you don't have to do (2 ), but if you are crazy,
paranoid go
ahead: 2) /etc/apache2/sites-enabled/koha.conf (or whatever your instance name is) a) Look for KOHA_CONF and create the appropriate entries for SERVER_NAME and SERVER_PORT For example (yours may differ): SetEnv SERVER_NAME library.myDNSname.org SetEnv SERVER_PORT 80 # because this should match the block it is in. b) Do step (a ) TWICE (because OPAC and Staff are both in the same configuration file).
GPML, Mark Tompsett
_______________________________________________ Koha-devel mailing list Koha-devel@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel website : http://www.koha-community.org/ git : http://git.koha- community.org/ bugs : http://bugs.koha-community.org/
--- Maritime heritage and history, preservation and conservation, research and education through the written word and the arts. <http://NavalMarineArchive.com> and <http://UltraMarine.ca>
At 07:01 PM 1/14/2015 -0500, Mark Tompsett wrote:
Greetings,
1) Why not just set the OPACBaseURL system preference in the first place?!
Thanks Mark -- the reason that I was asking was that (at this point) I'm only testing, and didn't want to hardcode a LAN URL (1) Koha seemed to have the capability to get it from the [Apache] %ENV, so I was *trying* that route. The Apache documentation for 2.4 suggests at <http://httpd.apache.org/docs/current/mod/core.html#servername> that ServerName serves this purpose and that SERVER_NAME is associated with UseCanonicalName, and at <http://httpd.apache.org/docs/current/mod/mod_rewrite.html> suggests its use with mod-rewrite. So rather than re-invent the wheel, I thought I'd ask. Again thanks and best regards, Paul (1) We don't use the syspref on our production servers either. ISTR that rather than our staff and users on our premises having direct access on the LAN, we got the latency effect of going through public routing and back into our building again. I don't think it makes any difference to www users.
If you do (1 ), then you don't have to do (2 ), but if you are crazy, paranoid go ahead: 2) /etc/apache2/sites-enabled/koha.conf (or whatever your instance name is) a) Look for KOHA_CONF and create the appropriate entries for SERVER_NAME and SERVER_PORT For example (yours may differ): SetEnv SERVER_NAME library.myDNSname.org SetEnv SERVER_PORT 80 # because this should match the block it is in. b) Do step (a ) TWICE (because OPAC and Staff are both in the same configuration file).
GPML, Mark Tompsett
--- Maritime heritage and history, preservation and conservation, research and education through the written word and the arts. <http://NavalMarineArchive.com> and <http://UltraMarine.ca>
participants (3)
-
David Cook -
Mark Tompsett -
Paul A