File: httpd.conf

package info (click to toggle)
w3c-markup-validator 1.3%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster
  • size: 5,044 kB
  • sloc: perl: 2,888; xml: 1,331; python: 427; sh: 216; makefile: 75
file content (96 lines) | stat: -rw-r--r-- 3,585 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#                                                                -*- apache -*-
# Debianized httpd.conf snippet for W3C Markup Validation Service
# Note that this is not a complete server configuration file, but contains
# only the validator-specific part.
#
# The w3c-markup-validator postinst script will link
# /etc/apache2/conf.available/w3c-markup-validator.conf -> /etc/w3c/httpd.conf
#
# To run the validator without mod_perl 2.x even if it is loaded, comment
# out the "IfDefine MODPERL2" sections below.

# Referer dependent redirects.

<IfModule mod_rewrite.c>
RewriteEngine On

# check/referer is deprecated in favor of check?uri=referer
RewriteRule ^(/+w3c-validator/+check)/+referr?er$ $1?uri=referer [R=301,QSA,L]

# If Referer is present, redirect check?uri=referer to check?uri=$Referer
RewriteRule . - [E=have_uri_referer:false]
RewriteCond %{QUERY_STRING} (^|.*?[;&])ur[il]=referer([;&].*|$)
RewriteRule . - [E=qs1:%1,E=qs2:%2,E=have_uri_referer:true]
RewriteCond %{ENV:have_uri_referer} =true
RewriteCond %{HTTP_REFERER} ^(.+)$
RewriteRule ^/+w3c-validator/+check$ \
            /w3c-validator/check?%{ENV:qs1}uri=%1%{ENV:qs2} [R,B,NE,L]
</IfModule>

# Tell httpd that check and sendfeedback.pl are CGI scripts.

Alias /w3c-validator/check /usr/lib/cgi-bin/w3c-markup-validator/check
AliasMatch ^/+w3c-validator/+feedback(\.html)?$ \
           /usr/lib/cgi-bin/w3c-markup-validator/sendfeedback.pl

<IfDefine MODPERL2>
# 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)?)$">
  Options               +ExecCGI
  SetHandler            cgi-script
<IfDefine MODPERL2>
  SetHandler            perl-script
  PerlResponseHandler   ModPerl::Registry
  PerlOptions           +ParseHeaders
</IfDefine>
  # Environment settings affecting validator's outside connectivity, see
  # LWP::UserAgent and Net::FTP documentation for details.
  #SetEnv                http_proxy      http://proxy:3128
  #SetEnv                https_proxy     http://proxy:3128
  #SetEnv                ftp_proxy       http://proxy:3128
  #SetEnv                no_proxy        localdomain
  #SetEnv                FTP_PASSIVE     1
</LocationMatch>

# This is the directory where you have the validator's *.html, *.css etc files.

Alias /w3c-validator/   /usr/share/w3c-markup-validator/html/
<Directory /usr/share/w3c-markup-validator/html/>
  Options               IncludesNOEXEC Indexes MultiViews
  AllowOverride         None
  AddHandler            server-parsed .html
  AddCharset            utf-8         .html
  AddEncoding           x-gzip        .gz
  <Files *.js.gz>
    ForceType           application/javascript
  </Files>
  <Files *.css.gz>
    ForceType           text/css
  </Files>

  <IfModule mod_rewrite.c>
  Options +SymLinksIfOwnerMatch
  RewriteBase /w3c-validator/
  RewriteRule fragment-upload(\.html)? detailed.html#validate-by-input [R,L,NE]
  RewriteRule file-upload(\.html)? detailed.html#validate-by-upload [R,L,NE]
  </IfModule>

  <IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType image/gif A2592000
  ExpiresByType image/png A2592000
  ExpiresByType text/html A604800
  ExpiresByType text/css A2592000
  ExpiresByType text/javascript A2592000
  ExpiresByType application/javascript A2592000
  ExpiresByType application/ecmascript A2592000
  </IfModule>
</Directory>

# Atom news feed
Redirect /w3c-validator/whatsnew.atom \
         http://www.w3.org/QA/Tools/validator-whatsnew.atom