[Koha-devel] Apache 2.4 env vars

David Cook dcook at prosentient.com.au
Thu Jan 15 01:32:30 CET 2015


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

> -----Original Message-----
> From: koha-devel-bounces at lists.koha-community.org [mailto:koha-devel-
> bounces at lists.koha-community.org] On Behalf Of Mark Tompsett
> Sent: Thursday, 15 January 2015 11:01 AM
> To: Paul A
> Cc: koha-devel at 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 at 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/




More information about the Koha-devel mailing list