From d444d9aebc6e401333968ec697c48fb23214a1ea Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 30 Apr 2014 20:24:54 +0000 Subject: add example configs for Apache2 mod_perl and CGI These are probably still popular configurations in some settings, so include sample configurations to get folks started. These are trickier than an average CGI script to setup because we rely on pretty URLs from PATH_INFO and not ugly query parameters. --- examples/apache2_cgi.conf | 32 ++++++++++++++++++++++++++++++++ examples/apache2_perl.conf | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 examples/apache2_cgi.conf create mode 100644 examples/apache2_perl.conf (limited to 'examples') diff --git a/examples/apache2_cgi.conf b/examples/apache2_cgi.conf new file mode 100644 index 00000000..455e4780 --- /dev/null +++ b/examples/apache2_cgi.conf @@ -0,0 +1,32 @@ +# Example Apache2 configuration using mod_cgi +# adjust paths to your installation + +ServerName "public-inbox" +ServerRoot "/var/www/cgi-bin" +DocumentRoot "/var/www/cgi-bin" +ErrorLog "/tmp/public-inbox-error.log" +PidFile "/tmp/public-inbox.pid" +Listen 8080 +LoadModule cgi_module /usr/lib/apache2/modules/mod_cgi.so +LoadModule env_module /usr/lib/apache2/modules/mod_env.so +LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so +LoadModule dir_module /usr/lib/apache2/modules/mod_dir.so +LoadModule mime_module /usr/lib/apache2/modules/mod_mime.so +TypesConfig "/dev/null" + + + Options +ExecCGI + AddHandler cgi-script .cgi + + # we use this hack to ensure "public-inbox.cgi" doesn't show up + # in any of our redirects: + SetEnv NO_SCRIPT_NAME 1 + + # our public-inbox.cgi requires PATH_INFO-based URLs with minimal + # use of query parameters + DirectoryIndex public-inbox.cgi + RewriteEngine On + RewriteCond %{REQUEST_FILENAME} !-f + RewriteCond %{REQUEST_FILENAME} !-d + RewriteRule ^.* /public-inbox.cgi/$0 [L,PT] + diff --git a/examples/apache2_perl.conf b/examples/apache2_perl.conf new file mode 100644 index 00000000..e963af6e --- /dev/null +++ b/examples/apache2_perl.conf @@ -0,0 +1,35 @@ +# Example Apache2 configuration using mod_perl2 +# adjust paths to your installation + +ServerName "public-inbox" +ServerRoot "/var/www/cgi-bin" +DocumentRoot "/var/www/cgi-bin" +ErrorLog "/tmp/public-inbox-error.log" +PidFile "/tmp/public-inbox.pid" +Listen 8080 +LoadModule perl_module /usr/lib/apache2/modules/mod_perl.so +LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so +LoadModule dir_module /usr/lib/apache2/modules/mod_dir.so +LoadModule mime_module /usr/lib/apache2/modules/mod_mime.so +TypesConfig "/dev/null" + +# PerlPassEnv PATH # this is implicit +PerlPassEnv HOME + + Options +ExecCGI + AddHandler perl-script .cgi + PerlResponseHandler ModPerl::Registry + PerlOptions +ParseHeaders + + # we use this hack to ensure "public-inbox.cgi" doesn't show up + # in any of our redirects: + PerlSetEnv NO_SCRIPT_NAME 1 + + # our public-inbox.cgi requires PATH_INFO-based URLs with minimal + # use of query parameters + DirectoryIndex public-inbox.cgi + RewriteEngine On + RewriteCond %{REQUEST_FILENAME} !-f + RewriteCond %{REQUEST_FILENAME} !-d + RewriteRule ^.* /public-inbox.cgi/$0 [L,PT] + -- cgit v1.2.3-24-ge0c7