chuk-shirley
7/29/2015 - 9:42 PM

httpd.conf

LoadModule ibm_ssl_module /QSYS.LIB/QHTTPSVR.LIB/QZSRVSSL.SRVPGM

# Enable compression
LoadModule deflate_module /QSYS.LIB/QHTTPSVR.LIB/QZSRCORE.SRVPGM

# Specify content types to compress
AddOutputFilterByType DEFLATE application/x-httpd-php application/json text/css application/x-javascript application/javascript text/html

# Browser caching rules
ExpiresActive On
ExpiresByType text/css A2592000
ExpiresByType application/x-javascript A2592000
ExpiresByType application/javascript A2592000
ExpiresByType text/html A2592000

# Logging rules
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%{Cookie}n \"%r\" %t" cookie
LogFormat "%{User-agent}i" agent
LogFormat "%{Referer}i -> %U" referer
LogFormat "%h %l %u %t \"%r\" %>s %b" common
CustomLog logs/access_log combined

# Keep alive
KeepAlive On
KeepAliveTimeout 15

# Set CCSID
DefaultFsCCSID 37
CGIJobCCSID 37

# Enable rewrites
RewriteEngine on

# Set document root
# DocumentRoot /www/sabel/htdocs

<Location />
   <LimitExcept GET HEAD OPTIONS POST>
      Order Allow,Deny
      Deny From all
   </LimitExcept>
</Location>

Options -ExecCGI +FollowSymLinks -SymLinksIfOwnerMatch -Includes -IncludesNoExec -Indexes -MultiViews
DefaultType www/unknown

Listen *:80
<VirtualHost *:80>
    RewriteEngine on
    RewriteCond %{SERVER_PORT} !^443$
    RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R=301,L]
</VirtualHost>

# CGIDEV2 virtual host
Listen *:443
<VirtualHost *:443>

    # Turn on SSL
    SSLEngine On
    SSLAppName QIBM_HTTP_SERVER_SABEL
    SSLCacheDisable

    DirectoryIndex welcome.html

    ScriptAliasMatch ^/cgi-bin/(.*) /QSYS.LIB/WWW.LIB/$1.PGM

    AliasMatch ^/(.*) /www/$1
    MapMatch ^/(.*) /www/$1

    CGIConvMode %%MIXED/MIXED%%
    IndexOptions -DescriptionWidth -FancyIndexing -FoldersFirst -IconHeight -IconsAreLinks -IconWidth -IgnoreCase -IgnoreClient -NameWidth -NameMinWidth -ScanHTMLTitles -SelectiveDirAccess -ShowSmallFileBytes -ShowOwner -SuppressColumnSorting -SuppressDescription -SuppressHTMLPreamble -SuppressIcon -SuppressLastModified -SuppressRules -SuppressSize -TrackModified -VersionSort
    HeaderName README
    <Location /cgi-bin/>
       AuthType Basic
       Authname "Your AS400 user id"
       Require valid-user
       PasswdFile %%SYSTEM%%
       UserID %%SERVER%%
    </Location>
    <Directory />
       Order Allow,Deny
       Deny From all
       UserID %%SERVER%%
    </Directory>
    <Directory /www/>
       Allow From all
    </Directory>
    <Directory /QSYS.LIB/WWW.LIB/>
        CGIConvMode %%EBCDIC/EBCDIC%%
        Allow From all
        <FilesMatch ^(.*)\.PGM$>
           Options +ExecCGI
           CGIConvMode %%EBCDIC/EBCDIC%%
           Allow From all
        </FilesMatch>
    </Directory>
    <Directory /QSYS.LIB/CGIDEV2.LIB/>
        Allow From all
       CGIConvMode %%EBCDIC/MIXED%%
    </Directory>
    <Directory /www/images/>
        Order allow,deny
        allow from all
     </Directory>
</VirtualHost>