Public feed #726564

slave httpd-vhosts.conf file

public text v1 · immutable
Raw Edit
·published 2007-10-05 10:07 UTC
rendered paste body
#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at 
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# Use name-based virtual hosting.
#
NameVirtualHost *:80

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:80>
    ServerAdmin vitaly@i-zum.com
    DocumentRoot /usr/local/www/apache22/i-zum.com
    ServerName i-zum.com
    ServerAlias www.i-zum.com
#    ErrorLog /var/log/biling-error_log
#    CustomLog /var/log/biling-access_log common

    <Directory "/usr/local/www/apache22/i-zum.com">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride None

    #
    # Controls who can get stuff from this server.
    #
    Order allow,deny
    Allow from all

    </Directory>

</VirtualHost>

<VirtualHost *:80>
    ServerAdmin vitaly@i-zum.com
    DocumentRoot /usr/local/www/apache22/admin.i-zum.com
    ServerName admin.i-zum.com
#    ServerAlias www.dummy-host.example.com
    ErrorLog /var/log/admin-error.log
    CustomLog /var/log/admin-access.log common

#    Include "/usr/local/etc/apache22/extra/extra.conf"
    <IfModule mod_perl.c>
	PerlSwitches -Mlib=/tmp/Apache-AuthCookie-3.10/t
    </IfModule>

    <IfModule mod_perl.c>
	PerlRequire /tmp/Apache-AuthCookie-3.10/t/conf/modperl_startup.pl
    </IfModule>

    <IfModule mod_perl.c>
        #PerlRequire /tmp/Apache-AuthCookie-3.10/t/conf/modperl_startup.pl
	PerlSwitches -Mlib=/usr/local/www/apache22
	PerlSwitches -I/usr/local/www/apache22/lib
    </IfModule>
    
    # In httpd.conf or .htaccess:

#PerlSwitches -I/usr/local/www/apache22/lib

PerlModule Sample::AuthCookieHandler
PerlSetVar WhatEverPath /
PerlSetVar WhatEverLoginScript /login.pl

# use to alter how "require" directives are matched. Can be "Any" or "All".
# If its "Any", then you must only match Any of the "require" directives. If
# its "All", then you must match All of the require directives. 
#
# Default: All
PerlSetVar WhatEverSatisfy Any

# The following line is optional - it allows you to set the domain
# scope of your cookie.  Default is the current domain.
PerlSetVar WhatEverDomain .yourdomain.com

# Use this to only send over a secure connection
PerlSetVar WhatEverSecure 1

# Use this if you want user session cookies to expire if the user
# doesn't request a auth-required or recognize_user page for some
# time period.  If set, a new cookie (with updated expire time)
# is set on every request.
PerlSetVar WhatEverSessionTimeout +30m

# to enable the HttpOnly cookie property, use HttpOnly.
# this is an MS extension.  See:
# http://msdn.microsoft.com/workshop/author/dhtml/httponly_cookies.asp
PerlSetVar WhatEverHttpOnly 1

# Usually documents are uncached - turn off here
PerlSetVar WhatEverCache 1

# Use this to make your cookies persistent (+2 hours here)
PerlSetVar WhatEverExpires +2h

# Use to make AuthCookie send a P3P header with the cookie
# see http://www.w3.org/P3P/ for details about what the value 
# of this should be
PerlSetVar WhatEverP3P "CP=\"...\""

    <Directory "/usr/local/www/apache22/admin.i-zum.com">
    
    Options Indexes FollowSymLinks

    AllowOverride All

    Order allow,deny
    Allow from all

    </Directory>

# These documents require user to be logged in.
<Location />
 AuthType Sample::AuthCookieHandler
 AuthName WhatEver
 PerlAuthenHandler Sample::AuthCookieHandler->authenticate
 PerlAuthzHandler Sample::AuthCookieHandler->authorize
 require valid-user
</Location>

# These documents don't require logging in, but allow it.
<FilesMatch "\.ok$">
 AuthType Sample::AuthCookieHandler
 AuthName WhatEver
 PerlFixupHandler Sample::AuthCookieHandler->recognize_user
</FilesMatch>

# These documents don't require logging in, but allow it.
<FilesMatch "\.cgi$">
 AuthType Sample::AuthCookieHandler
 AuthName WhatEver
 PerlFixupHandler Sample::AuthCookieHandler->recognize_user
</FilesMatch>

<IfDefine APACHE2>
 PerlModule ModPerl::Registry

 <FilesMatch "\.pl$">
  SetHandler perl-script
  PerlResponseHandler ModPerl::Registry
  Options +ExecCGI
  AuthType Sample::AuthCookieHandler
  AuthName WhatEver
 </FilesMatch>
</IfDefine>

# This is the action of the login.pl script above.
<Files LOGIN>
 AuthType Sample::AuthCookieHandler
 AuthName WhatEver
 SetHandler perl-script
 PerlResponseHandler Sample::AuthCookieHandler->login
</Files>

</VirtualHost>

#<VirtualHost *:80>
#    ServerAdmin webmaster@dummy-host2.example.com
#    DocumentRoot /www/docs/dummy-host2.example.com
#    ServerName dummy-host2.example.com
#    ErrorLog /var/log/dummy-host2.example.com-error_log
#    CustomLog /var/log/dummy-host2.example.com-access_log common
#</VirtualHost>