All pastes #790690 Raw Edit

host.conf

public text v1 · immutable
·published 2007-11-20 15:26 UTC
rendered paste body
############################
#      Host Settings       #
############################
# Required Modules
LoadModule macro_module modules/mod_macro.so
<IfDefine DAV>
    LoadModule dav_module modules/mod_dav.so
    LoadModule dav_fs_module modules/mod_dav_fs.so
    DAVLockDB logs/davlock
</IfDefine>
<IfDefine SSL>
    LoadModule ssl_module modules/mod_ssl.so
    SSLRandomSeed startup builtin
    SSLRandomSeed connect builtin
    AddType application/x-x509-ca-cert .crt
    AddType application/x-pkcs7-crl    .crl
    SSLPassPhraseDialog  builtin
    SSLSessionCache dbm:logs/ssl_scache
    SSLSessionCacheTimeout  300
    SSLMutex default
</IfDefine>

# Listening Sockets
Listen 80
NameVirtualHost *:80
<IfDefine SSL>
    Listen 443
	NameVirtualHost *:443
</IfDefine>
<IfDefine DAV>
    Listen 81
	NameVirtualHost *:81
</IfDefine>

# VirtualHost Macro
<Macro VirtualHost $host>
    # HTTP Server
    <VirtualHost *:80>
        ServerName $host:80
        ErrorLog "/hosts/$host/_server/logs/error_log"
        CustomLog "/hosts/$host/_server/logs/access_log" combined
        
        DocumentRoot "/hosts/$host/httpdocs"
        <Directory "/hosts/$host/httpdocs">
            Options FollowSymLinks ExecCGI Indexes
            AllowOverride AuthConfig Limit
            order allow,deny
            Allow from All
        </Directory>
        
        ScriptAlias /cgi-bin/ "/hosts/$host/cgi-bin/"
        <Directory "/hosts/$host/cgi-bin">
            AllowOverride None
            Options None
            Order allow,deny
            Allow from all
        </Directory>
        
        # Server Options (PHP, mod_perl,...)
        Include "/hosts/$host/_server/host_settings.conf"
        
        # PHP Configuration
        <IfModule mod_php5.c>
            php_admin_value open_basedir "/hosts/$host;/httpd-2.2/error;C:\WINDOWS\Temp"
            php_admin_value upload_tmp_dir "/hosts/$host/_server/tmp"
            php_admin_value session.safe_path "/hosts/$host/_server/sessions"
        </IfModule>
        
        # Mod_Security
        <IfModule mod_security2.c>
            SecUploadDir "/hosts/$host/_server/tmp"
        </IfModule>
    </VirtualHost>

    # DAV Server
    <IfDefine DAV>
        <VirtualHost *:81>
            ServerName $host:81
            ErrorLog "/hosts/$host/_server/logs/error_log"
            CustomLog "/hosts/$host/_server/logs/access_log_dav" combined

            DocumentRoot "/hosts/$host"
			DirectoryIndex dav_index_list
            <Directory "/hosts/$host">
                Options FollowSymLinks
                AllowOverride none
                order allow,deny
                Allow from All
                #DAV Settings
                DAV On
                #Authentication
                AuthName "DAV for $host"
                AuthType basic
               	AuthBasicProvider file
                AuthUserFile "/hosts/$host/_server/users.db"
               	Require valid-user
				#Remove filter for dynamic content
				RemoveHandler .pl .cgi .shtm .shtml
				RemoveType .php .phps .phtml
        	    <Files ~ "^\.ht">
                    Order allow,deny
                    Allow from all
                </Files>
            </Directory>
            BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
            BrowserMatch "MS FrontPage" redirect-carefully
            BrowserMatch "^WebDrive" redirect-carefully
            BrowserMatch "^WebDAVFS/1.[0123]" redirect-carefully
            BrowserMatch "^gnome-vfs/1.0" redirect-carefully
            BrowserMatch "^XML Spy" redirect-carefully
            BrowserMatch "^Dreamweaver-WebDAV-SCM1" redirect-carefully
            BrowserMatch "MSIE" AuthDigestEnableQueryStringHack=On
        </VirtualHost>
    </IfDefine>

    # HTTPS Server
    <IfDefine SSL>
        <VirtualHost *:443>
            ServerName $host:443
            ErrorLog "/hosts/$host/_server/logs/error_log"
            CustomLog "/hosts/$host/_server/logs/access_log_ssl" combined
            
            DocumentRoot "/hosts/$host/httpsdocs"
            <Directory "/hosts/$host/httpsdocs">
                Options FollowSymLinks ExecCGI
                AllowOverride AuthConfig Limit
                order allow,deny
                Allow from All
            </Directory>
            
            ScriptAlias /cgi-bin/ "/hosts/$host/cgi-bin/"
            <Directory "/hosts/$host/cgi-bin">
                SSLOptions +StdEnvVars
                AllowOverride None
                Options None
                Order allow,deny
                Allow from all
            </Directory>
        
            SSLEngine on
            SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
            SSLCertificateFile "/hosts/$host/_server/ssl/server.crt"
            SSLCertificateKeyFile "/hosts/$host/_server/ssl/server.key"
            <Files ~ "\.(cgi|shtml|phtml|php|pl?)$">
                 SSLOptions +StdEnvVars
            </Files>
            SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0

            # Server Options (PHP, mod_perl,...)
            Include "/hosts/$host/_server/host_settings.conf"

            # PHP Configuration
            <IfModule mod_php5.c>
                php_admin_value open_basedir "/hosts/$host;/httpd-2.2/error;C:\WINDOWS\Temp"
                php_admin_value upload_tmp_dir "/hosts/$host/_server/tmp"
                php_admin_value session.safe_path "/hosts/$host/_server/sessions"
            </IfModule>
            
            # Mod_Security
            <IfModule mod_security2.c>
                SecUploadDir "/hosts/$host/_server/tmp"
            </IfModule>
        </VirtualHost>
    </IfDefine>
</Macro>

# Host Options Macro
<Macro EnableCGI>
    <IfModule mod_cgi.c>
       AddHandler cgi-script .cgi .pl
    </IfModule>
    <IfModule mod_cgid.c>
        AddHandler cgi-script .cgi .pl
    </IfModule>
</Macro>

<Macro EnableSSI>
    <IfModule mod_include.c>
        AddType text/html .shtml .shtm
        AddOutputFilter INCLUDES .shtml  .shtm
    </IfModule>
</Macro>

<Macro EnablePHP>
    <IfModule mod_php5.c>
        AddHandler application/x-httpd-php .php
        AddHandler application/x-httpd-php-source .phps
    </IfModule>
</Macro>


# Host Configuration
Use VirtualHost localhost