aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArne Georg Gleditsch <argggh@lxr.linpro.no>2008-02-08 01:16:56 +0100
committerArne Georg Gleditsch <argggh@lxr.linpro.no>2008-02-08 01:16:56 +0100
commit2e28387613b7de506671f1657ed539d2470caff1 (patch)
tree4f50dd249d0dc15462909a9dab577913b8e29178
parenta57b1d79950ce63209e052a1b1f394cf3c6eb588 (diff)
Add Apache config template for mod_perl.
-rw-r--r--INSTALL18
-rw-r--r--apache2-site.conf-dist8
-rw-r--r--apache2-site.conf-dist-cgi16
-rw-r--r--apache2-site.conf-dist-mod_perl32
-rw-r--r--webroot/.htaccess20
-rw-r--r--webroot/.static/.htaccess3
-rwxr-xr-xwebroot/lxr.cgi36
7 files changed, 100 insertions, 33 deletions
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 <my-tree>
-* 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 <lxr-path>/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 <lxr-path>/cgi-bin/gfx
+ $ make -C <lxr-path>/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/"
-<Directory "@@LXRROOT@@/cgi-bin/">
- Options None
- AllowOverride All
- Order deny,allow
- Deny from none
- Allow from all
-</Directory>
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"
+
+<Directory "@@LXRROOT@@/webroot/">
+ Options ExecCGI
+ AllowOverride None
+ Order deny,allow
+ Allow from all
+</Directory>
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/"
+
+<Directory "@@LXRROOT@@/webroot/">
+ Options ExecCGI
+ AllowOverride None
+ Order deny,allow
+ Allow from all
+
+ <Files *>
+ SetHandler perl-script
+ PerlResponseHandler LXRng::ModPerl
+ </Files>
+
+ <Files favicon.ico>
+ SetHandler send-as-is
+ </Files>
+
+ <Files robots.txt>
+ SetHandler send-as-is
+ </Files>
+</Directory>
+
+<Directory "@@LXRROOT@@/webroot/.static/">
+ <Files *>
+ SetHandler send-as-is
+ </Files>
+</Directory>
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
-
-
-<IfModule mod_perl.c>
- PerlModule LXRng::ModPerl;
-
- <Files *>
- SetHandler perl-script
- PerlResponseHandler LXRng::ModPerl
- </Files>
-</IfModule>
-
-
-<Files robots.txt>
- SetHandler send-as-is
-</Files>
-
-<Files favicon.ico>
- SetHandler send-as-is
-</Files>
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 @@
-<Files *>
- SetHandler send-as-is
-</Files>
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 <lxr@linux.no> 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);
+