[Koha] URI field link options

Joe Atzberger ohiocore at gmail.com
Tue Nov 4 11:34:43 NZDT 2008


Your approach would change the data in MARC records.  This should be avoided
if possible.

Instead you should use Apache and possibly a proxy layer.  For example, if
you catalog all the records to point towards:
http://YourContentServer.org/logical_directory1/filename9

You could set up a VirtualHost in Apache

   - on the Koha server with ServerName "YourContentServer.org" (and
   NameVirtualHost) or
   - on a separate server.  The DNS would control which would respond.

Then for extensibility you could go further with Redirect:
Redirect /logical_directory1 http://my_other_server.com/other_dir
Or:
RedirectMatch ^/(logical_directory)(.)/(.)(.*)
http://my_other_server.com.com/$1/$2/$3/$3$4

That would redirect a request from:
/logical_directory3/shakespeare.jpg
to:
http://my_other_server.com.com/logical_directory/3/s/shakespeare.jpg

That splits out the request to a physical directory that is hashed by the
number from the logical directory and the first letter of the filename.  The
mappings are completely arbitrary.

Of course the splitting out could occur on the second (or third, fourth,
etc.) server.  And similar tricks could be accomplished with ModRewrite.
The point is that the data should be correct without any variable
substitution/interpretation.  You can make that so by ensuring your servers
respond to the request for that address, regardless of where the physical
location endsup.

Just don't use a circle of redirects since the browser expects the first
redirect to get to the right server.

--Joe Atzberger

On Mon, Nov 3, 2008 at 3:41 PM, Doug Dearden <dearden at sarsf.org> wrote:

> Hello all,
>
> I have a successful install of Koha 3.0 (revision 17 I believe) running on
> Debian etch, Apache2, Mysql 5.0.  In some cases we will be using this to
> catalog
> a computer file of some sort - text or maybe images or sound.  I find I can
> get
> this to work by putting in the full path to the file -
> http://ipaddressofserver/directory/filename, but am trying to figure out a
> way
> to use a variable for the first part of that so that I can move the
> directory in
> the future and not have to reenter all of the links.  For instance, a
> cataloged
> entry pointing to text_directory_variablename/filename is reinterpreted to
> http://kohaserver_ip_address/localtext/filename.  Or
> sound_directory_variablename is reinterpreted to
> http://another_web_server_ip_address/some_directory/filename.  I have
> tried
> using some SetEnv statements in the koha-httpd.conf file and also an extra
> entry
> in the <config> section of the koha-conf.xml file, but these did not work -
> the
> link shows up without reinterpreting the variable name.  At this point the
> best
> I have been able to do is to use http://kohaserver/a_directory/filenameand then
> create a DNS entry for the kohaserver that points to the correct IP
> address.  My
> concern is looking toward the future, and trying to make things as flexible
> as
> possible - so that these files could be moved later and the only change to
> make
> it work would be reconfiguring what the variable points to.
>
> Writing this I am thinking that there is probably not code in Koha to
> automatically do this, but not being a perl programmer I am not sure where
> I
> would start looking.  If a code modification is what it would take, a
> little
> bird dogging to the right place would help me also.
>
> Thanks,
>
> Doug
>
> _______________________________________________
> Koha mailing list
> Koha at lists.katipo.co.nz
> http://lists.katipo.co.nz/mailman/listinfo/koha
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.katipo.co.nz/pipermail/koha/attachments/20081103/8927d5d9/attachment.htm 


More information about the Koha mailing list