summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile5
-rwxr-xr-xhttpd/cgi-bin/check3
-rw-r--r--httpd/conf/httpd.conf3
-rw-r--r--httpd/mod_perl/startup.pl14
4 files changed, 22 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index c5fd9cd..3f51adc 100644
--- a/Makefile
+++ b/Makefile
@@ -4,8 +4,9 @@ CSS_FILES = htdocs/style/base.css htdocs/style/results.css
JS_SOURCES = htdocs/scripts/mootools-1.2.5-core-nc.js \
htdocs/scripts/mootools-1.2.5.1-more.js htdocs/scripts/w3c-validator.js
PERL_FILES = httpd/cgi-bin/check httpd/cgi-bin/sendfeedback.pl \
- misc/soc2xml.pl misc/spmpp.pl misc/docs_errors.pl \
- misc/bundle/Makefile.PL misc/bundle/lib/Bundle/W3C/Validator.pm
+ httpd/mod_perl/startup.pl misc/soc2xml.pl misc/spmpp.pl \
+ misc/docs_errors.pl misc/bundle/Makefile.PL \
+ misc/bundle/lib/Bundle/W3C/Validator.pm
GZIP_FILES = $(addsuffix .gz,$(CSS_FILES)) htdocs/scripts/combined.js.gz
PERLTIDY = perltidy --profile=misc/perltidyrc --backup-and-modify-in-place
diff --git a/httpd/cgi-bin/check b/httpd/cgi-bin/check
index 335d014..56da108 100755
--- a/httpd/cgi-bin/check
+++ b/httpd/cgi-bin/check
@@ -219,6 +219,9 @@ EOF
# SGML open catalogs but they don't seem to work (again as of 1.70 and
# 2.7.7); if we use xml.soc here, no entities seem to end up being resolved
# from it - so we use a (redundant) XML catalog which works.
+ # Note that setting XML_CATALOG_FILES here does not seem to work with
+ # mod_perl (it doesn't end up being used by XML::LibXML), therefore we do
+ # it in the mod_perl/startup.pl startup file for it too.
local $ENV{XML_CATALOG_FILES} =
catfile($CFG->{Paths}->{SGML}->{Library}, 'catalog.xml');
require XML::LibXML;
diff --git a/httpd/conf/httpd.conf b/httpd/conf/httpd.conf
index 40ce1ba..6dbfb7e 100644
--- a/httpd/conf/httpd.conf
+++ b/httpd/conf/httpd.conf
@@ -36,8 +36,9 @@ AliasMatch ^/+w3c-validator/+feedback(\.html)?$ \
/usr/local/validator/cgi-bin/sendfeedback.pl
<IfDefine MODPERL2>
-# Note: this affects the whole server, not just the validator.
+# Note: this block affects the whole server, not just the validator.
PerlSwitches -T
+PerlPostConfigRequire /usr/local/validator/httpd/mod_perl/startup.pl
</IfDefine>
<LocationMatch "^/+w3c-validator/+(check|feedback(\.html)?)$">
diff --git a/httpd/mod_perl/startup.pl b/httpd/mod_perl/startup.pl
new file mode 100644
index 0000000..39d8e40
--- /dev/null
+++ b/httpd/mod_perl/startup.pl
@@ -0,0 +1,14 @@
+# mod_perl startup file for the W3C Markup Validator
+# http://perl.apache.org/docs/2.0/user/handlers/server.html#mod_perl_Startup
+
+use warnings;
+use strict;
+
+# If the validator is not installed in its default dir layout in
+# /usr/local/validator, be sure to modify this file so that the path to
+# catalog.xml below is correct for validator's sgml-lib/catalog.xml
+
+my $home = $ENV{W3C_VALIDATOR_HOME} || "/usr/local/validator";
+$ENV{XML_CATALOG_FILES} = "$home/htdocs/sgml-lib/catalog.xml";
+
+1;