1 # Example legacy Apache2 configuration using CGI + mod_perl2
2 # Consider using Plack::Handler::Apache2 instead (see apache2_perl.conf)
3 # Adjust paths to your installation
5 ServerName "public-inbox"
6 ServerRoot "/var/www/cgi-bin"
7 DocumentRoot "/var/www/cgi-bin"
8 ErrorLog "/tmp/public-inbox-error.log"
9 PidFile "/tmp/public-inbox.pid"
11 LoadModule perl_module /usr/lib/apache2/modules/mod_perl.so
12 LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so
13 LoadModule dir_module /usr/lib/apache2/modules/mod_dir.so
14 LoadModule mime_module /usr/lib/apache2/modules/mod_mime.so
15 TypesConfig "/dev/null"
17 # PerlPassEnv PATH # this is implicit
18 <Directory /var/www/cgi-bin>
20 AddHandler perl-script .cgi
21 PerlResponseHandler ModPerl::Registry
22 PerlOptions +ParseHeaders
24 # we use this hack to ensure "public-inbox.cgi" doesn't show up
25 # in any of our redirects:
26 PerlSetEnv NO_SCRIPT_NAME 1
28 # no need to set no rely on HOME if using this:
29 PerlSetEnv PI_CONFIG /home/pi/.public-inbox/config
31 # our public-inbox.cgi requires PATH_INFO-based URLs with minimal
32 # use of query parameters
33 DirectoryIndex public-inbox.cgi
35 RewriteCond %{REQUEST_FILENAME} !-f
36 RewriteCond %{REQUEST_FILENAME} !-d
37 RewriteRule ^.* /public-inbox.cgi/$0 [L,PT]