LoadModule perl_module                  /usr/lib/apache2-prefork/mod_perl.so

# If you want mod_rewrite
#LoadModule rewrite_module               /usr/lib/apache2-prefork/mod_rewrite.so

# php einschalten
#AddType application/x-httpd-php .php #That is a stupid idea.

#ePerl not required for this dist.
#   <Files ~ "/var/www/cgi-bin/.+\.epl$">
#       Options     +ExecCGI
#       SetHandler  perl-script
#       PerlHandler Apache::ePerl
#   </Files>
#enable perl (cgi-version).
#AddHandler cgi-script cgi pl

#cache control
#LoadModule expires_module                 /usr/lib/apache2-prefork/mod_expires.so
#         <IfModule mod_expires.c>
#                 ExpiresActive On
# #ExpiresByType text/html "access plus 1 month"
#                 ExpiresByType text/css "access plus 1 month"
#                 ExpiresByType text/javascript "access plus 1 month"
#                 ExpiresByType image/gif "access plus 1 month"
#                 ExpiresByType image/jpeg "access plus 6 month"
#                 ExpiresByType image/png "access plus 6 month"
#         </IfModule>
# 
#         LoadModule headers_module                 /usr/lib/apache2-prefork/mod_headers.so
#         <IfModule mod_headers.c>
#                 <Files ~ "\.(js|css|gif|jpe?g|png)$">
#                        Header append Cache-Control "public"
#                 </Files>
#         </IfModule>

NameVirtualHost *:80

#user
User linse
Group users

<VirtualHost *:80>
        DirectoryIndex index.html index.pl index.php
        ServerName localhost
        ServerAlias localhost
        ServerAdmin lze@cpan.org
        ServerSignature on
        UseCanonicalName On
        HostnameLookups On
        DocumentRoot "/var/www/htdocs/"
        RewriteEngine On
        RedirectMatch /perl/lze.pl https://localhost
        <Directory "/var/www/htdocs">
                AllowOverride All
                Order allow,deny
                Allow from all
        </Directory>
        ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"

        <Directory "/var/www/cgi-bin/">
                 AllowOverride None
                 Options +ExecCGI -Includes
                 Order allow,deny
                 Allow from all
        </Directory>
      LoadModule perl_module                    /usr/lib/apache2/mod_perl.so
      <IfModule mod_perl.c>
            PerlModule Apache2
            PerlRequire "/var/wwwcgi-bin/config/startup.pl"
            ScriptAlias /perl/ "/var/www/cgi-bin/"
            PerlModule Apache2::Reload
            PerlInitHandler Apache2::Reload
            <Location /perl/>
                  SetHandler perl-script
                  PerlResponseHandler ModPerl::Registry
                  PerlOptions +ParseHeaders
                  PerlSetVar PerlTaintCheck On
            </Location>
      </IfModule>
</VirtualHost>

################################################################################################
#ssl
#  create ssl key
# 1. openssl genrsa -out server.key -des3 1024
# create cert
# 2.openssl req -new -key server.key -out server.csr
# 3. sign
# openssl req -new -x509 -days 1500 -key server.key -out server.crt
################################################################################################

LoadModule ssl_module                 /usr/lib/apache2-prefork/mod_ssl.so

Listen 443
SSLMutex sem
SSLRandomSeed startup builtin
NameVirtualHost *:443

 <VirtualHost *:443>
       DirectoryIndex index.html index.pl index.php
       ServerName localhost
       ServerAlias localhost
       ServerAdmin lindnerei@o2online.de
       ServerSignature on
       UseCanonicalName On
       HostnameLookups On
       DocumentRoot "/var/www/htdocs"
       RewriteEngine On

       SSLEngine on
       SSLCertificateFile    /home/linse/server.crt
       SSLCertificateKeyFile /home/linse/server.key

       <Directory "/var/www/htdocs">
               AllowOverride All
               Order allow,deny
               Allow from all
       </Directory>
         ScriptAlias /cgi-bin/ "D:\srv\www\cgi-bin\"

         <Directory "/var/www/cgi-bin">
                  AllowOverride None
                  Options +ExecCGI -Includes
                  Order allow,deny
                  Allow from all
       </Directory>
       LoadModule perl_module                    /usr/lib/apache2/mod_perl.so
       <IfModule mod_perl.c>
             PerlModule Apache2
             PerlRequire "/var/www/cgi-bin/config/startup.pl"
             ScriptAlias /perl/ "/var/www/cgi-bin"
             PerlModule Apache2::Reload
             PerlInitHandler Apache2::Reload
             <Location /perl/>
                   SetHandler perl-script
                   PerlResponseHandler ModPerl::Registry
                   PerlOptions +ParseHeaders
                   PerlSetVar PerlTaintCheck On
             </Location>
       </IfModule>
 </VirtualHost>