[Koha-devel] Apache 2.4 env vars

Paul A paul.a at navalmarinearchive.com
Thu Jan 15 02:01:22 CET 2015


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 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/

---
Maritime heritage and history, preservation and conservation,
research and education through the written word and the arts.
<http://NavalMarineArchive.com> and <http://UltraMarine.ca>



More information about the Koha-devel mailing list