From 2e28387613b7de506671f1657ed539d2470caff1 Mon Sep 17 00:00:00 2001 From: Arne Georg Gleditsch Date: Fri, 8 Feb 2008 01:16:56 +0100 Subject: Add Apache config template for mod_perl. --- INSTALL | 18 ++++++++++++++++-- apache2-site.conf-dist | 8 -------- apache2-site.conf-dist-cgi | 16 ++++++++++++++++ apache2-site.conf-dist-mod_perl | 32 ++++++++++++++++++++++++++++++++ webroot/.htaccess | 20 -------------------- webroot/.static/.htaccess | 3 --- webroot/lxr.cgi | 36 ++++++++++++++++++++++++++++++++++++ 7 files changed, 100 insertions(+), 33 deletions(-) delete mode 100644 apache2-site.conf-dist create mode 100644 apache2-site.conf-dist-cgi create mode 100644 apache2-site.conf-dist-mod_perl delete mode 100644 webroot/.htaccess delete mode 100644 webroot/.static/.htaccess create mode 100755 webroot/lxr.cgi diff --git a/INSTALL b/INSTALL index f278647..7c18f11 100644 --- a/INSTALL +++ b/INSTALL @@ -20,6 +20,8 @@ DEPENDENCIES - HTML::Entities [libhtml-parser-perl] - Template [libtemplate-perl] +* (For gzip content transfer compression: PerlIO::gzip) + * "Exuberant ctags", runnable as ctags-exuberant somewhere in the current $PATH. [exuberant-ctags] @@ -46,13 +48,25 @@ INSTALLATION * Cross reference your source repository $ lxr-genxref -* Copy the apache2-site.conf-dist to apache2-site.conf and adjust. +* Set up apache config + Determine values for + @@LXRURL@@ + Subdirectory of your web site to show the LXRng interface, + "", "/lxr", "/tools/lxr" or other. + @@LXRROOT@@ + Installation path of LXRng suite. + + Choose cgi or mod_perl mode of operation. Based on + apache2-site.conf-dist-[cgi|mod_perl], generate apache2-site.conf + to suit your local requirements. + + Add to global Apache2 configuration: # ln -s /apache2-site.conf /etc/apache2/sites-enabled/010-lxrng # /etc/init.d/apache2 reload (Or equivalent, depending on operating system (distribution) flavor.) * (Generate PNG icons) - $ make -C /cgi-bin/gfx + $ make -C /webroot/.static/gfx * Point web browser to configured web location. diff --git a/apache2-site.conf-dist b/apache2-site.conf-dist deleted file mode 100644 index e3d5e66..0000000 --- a/apache2-site.conf-dist +++ /dev/null @@ -1,8 +0,0 @@ -Alias / "@@LXRROOT@@/cgi-bin/" - - Options None - AllowOverride All - Order deny,allow - Deny from none - Allow from all - diff --git a/apache2-site.conf-dist-cgi b/apache2-site.conf-dist-cgi new file mode 100644 index 0000000..7ee3cda --- /dev/null +++ b/apache2-site.conf-dist-cgi @@ -0,0 +1,16 @@ + +Alias @@LXRURL@@/favicon.ico "@@LXRROOT@@/webroot/favicon.ico" +Alias @@LXRURL@@/robots.txt "@@LXRROOT@@/webroot/robots.txt" +Alias @@LXRURL@@/.static "@@LXRROOT@@/webroot/.static" + +# For LXRng installed directly in the web site root, use +# ScriptAlias / "@@LXRROOT@@/webroot/lxr.cgi/" +# otherwise use (no trailing slash): +# ScriptAlias /@@LXRURL@@ "@@LXRROOT@@/webroot/lxr.cgi" + + + Options ExecCGI + AllowOverride None + Order deny,allow + Allow from all + diff --git a/apache2-site.conf-dist-mod_perl b/apache2-site.conf-dist-mod_perl new file mode 100644 index 0000000..bfee027 --- /dev/null +++ b/apache2-site.conf-dist-mod_perl @@ -0,0 +1,32 @@ +PerlInitHandler Apache2::Reload +PerlOptions +GlobalRequest +PerlRequire @@LXRROOT@@/lxrng_mod_perl.pl +PerlModule LXRng::ModPerl + +Alias /@@LXRURL@@ "@@LXRROOT@@/webroot/" + + + Options ExecCGI + AllowOverride None + Order deny,allow + Allow from all + + + SetHandler perl-script + PerlResponseHandler LXRng::ModPerl + + + + SetHandler send-as-is + + + + SetHandler send-as-is + + + + + + SetHandler send-as-is + + diff --git a/webroot/.htaccess b/webroot/.htaccess deleted file mode 100644 index 2c850e5..0000000 --- a/webroot/.htaccess +++ /dev/null @@ -1,20 +0,0 @@ -Options ExecCGI - - - - PerlModule LXRng::ModPerl; - - - SetHandler perl-script - PerlResponseHandler LXRng::ModPerl - - - - - - SetHandler send-as-is - - - - SetHandler send-as-is - diff --git a/webroot/.static/.htaccess b/webroot/.static/.htaccess deleted file mode 100644 index 68f007e..0000000 --- a/webroot/.static/.htaccess +++ /dev/null @@ -1,3 +0,0 @@ - - SetHandler send-as-is - diff --git a/webroot/lxr.cgi b/webroot/lxr.cgi new file mode 100755 index 0000000..7117d65 --- /dev/null +++ b/webroot/lxr.cgi @@ -0,0 +1,36 @@ +#!/usr/bin/perl +# +# Copyright (C) 2008 Arne Georg Gleditsch and others. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# The full GNU General Public License is included in this distribution +# in the file called COPYING. + +use strict; + +use FindBin; +use lib "$FindBin::Bin/../lib"; + +use LXRng ROOT => "$FindBin::Bin/.."; +use LXRng::Web; + +use CGI::Simple qw(-newstyle_urls); +use CGI::Carp qw(fatalsToBrowser); + +my $query = CGI::Simple->new(); + +LXRng::Web->handle($query); + -- cgit v1.2.3