LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Blogs > catkin
User Name
Password

Notices

Rate this Entry

Xapian omega: simple URLs for users (Apache)

Posted 04-11-2011 at 11:59 AM by catkin

Xapian's Omega component is primarily used as tool for building interactive text searching solutions but can be used directly.

When using it directly, a typical URL is http://<host_ID>/cgi-bin/omega. That results in omega running with its default CGI parameters. The default CGI parameters can be over-ridden by specifying them on the URL, for example http://<host_ID>/cgi-bin/omega?DB=<index_ID>&FMT=<template_ID>.

There are two problems with such complex URLs: firstly they are not easy to remember or dictate so not ideal for user-land and secondly they do not allow the system administrator to change CGI parameters, for example to try out a new index database and back out the change if desired.

If an Apache web server is being used these problems can be solved using a Redirect as shown in this example which redirects http://<host_ID>/search to http://<host_ID>/cgi-bin/omega?DB=docoll
Code:
<VirtualHost *:80>
    CustomLog "/var/log/apache2/xapian.access.log" combined
    DocumentRoot "/srv/docoll"
    <Directory "/srv/docoll">
        AllowOverride None
        Options All
        Order Allow,Deny
        Allow from all
    </Directory>
    <Directory "/usr/lib/cgi-bin/omega/omega/">
        AllowOverride None
        Options None
        Order Allow,Deny
        Allow from all
    </Directory>
    Redirect "/search" "/cgi-bin/omega?DB=docoll"
    ScriptAlias "/cgi-bin/" "/usr/lib/cgi-bin/omega/"
    ServerAdmin <email address hidden>
    ServerName "Document Collation"
</VirtualHost>
Notes:
  1. /srv/docoll is where the documents are stored.
  2. The Xapian Omega CGI binary is installed as /usr/lib/cgi-bin/omega/omega
  3. 'Directory "/usr/lib/cgi-bin/omega/omega/"' looks wrong -- it is not a directory; it is a file -- but this configuration does work.
This was tested on Debian 6.0 Squeeze running Apache 2.2.16 and Xapian 1.2.4 where the above file was /etc/apache2/sites-enabled/docoll. On CentOS 5.5 a similar configuration in /etc/httpd/conf/httpd.conf should work; on Slackware 13.1 a similar configuration in /etc/httpd/extra/httpd-vhosts.conf should work.
Posted in Uncategorized
Views 1588 Comments 0
« Prev     Main     Next »
Total Comments 0

Comments

 

  



All times are GMT -5. The time now is 09:21 PM.

Main Menu
Advertisement

My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration