>>>>> "Eric" == Eric  writes:

Eric> On Sun, Jan 09, 2000 at 08:47:04PM +0300, [EMAIL PROTECTED] wrote:
>> I'm trying to configure httpd.conf using Perl sections (mod_macro is
>> not enough for me), but the result is weird. 

Eric> Do you have a specific example of your config, and what doesn't work,
Eric> that you could post maybe? It's hard to help without specifics.
Okay, here it is. Note that fragment marked #!!! is critical for some
bugs: when these strings are commented out, first <Perl> block
executes with error, if they are uncommented, it does NOT
executes. Second <Perl> block never executes at all.

=== cut ===
##
## httpd.conf -- Apache HTTP server configuration file
##
# $Id: httpd.conf,v 1.2 2000/01/09 10:49:48 root Exp root $
#
# $Log: httpd.conf,v $
# Revision 1.2  2000/01/09 10:49:48  root
# It is working now; I'll start reconfiguring it with Perl,
# including Perl configuration for virtual hosts
#
#
ServerType standalone

ServerRoot "/usr/local"

#LockFile /var/run/httpd.lock

PidFile /var/run/httpd.pid

ScoreBoardFile /var/run/httpd.scoreboard

#ResourceConfig conf/srm.conf
#AccessConfig conf/access.conf

Timeout 300

KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15

MinSpareServers 5
MaxSpareServers 10
StartServers 5
MaxClients 40
MaxRequestsPerChild 0

#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, in addition to the default. See also the <VirtualHost>
# directive.
#
#Listen 3000
#Listen 12.34.56.78:80

#
# BindAddress: You can support virtual hosts with this option. This directive
# is used to tell the server which IP address to listen to. It can either
# contain "*", an IP address, or a fully qualified Internet domain name.
# See also the <VirtualHost> and Listen directives.
#
#BindAddress *

#
# Dynamic Shared Object (DSO) Support
#
# To be able to use the functionality of a module which was built as a DSO you
# have to place corresponding `LoadModule' lines at this location so the
# directives contained in it are actually available _before_ they are used.
# Please read the file README.DSO in the Apache 1.3 distribution for more
# details about the DSO mechanism and run `httpd -l' for the list of already
# built-in (statically linked and thus always available) modules in your httpd
# binary.
#
# Note: The order is which modules are loaded is important.  Don't change
# the order below without expert advice.
#
# Example:
# LoadModule foo_module libexec/mod_foo.so
LoadModule vhost_alias_module libexec/apache/mod_vhost_alias.so
LoadModule env_module         libexec/apache/mod_env.so
LoadModule config_log_module  libexec/apache/mod_log_config.so
LoadModule mime_magic_module  libexec/apache/mod_mime_magic.so
LoadModule mime_module        libexec/apache/mod_mime.so
LoadModule negotiation_module libexec/apache/mod_negotiation.so
LoadModule status_module      libexec/apache/mod_status.so
LoadModule info_module        libexec/apache/mod_info.so
LoadModule includes_module    libexec/apache/mod_include.so
LoadModule autoindex_module   libexec/apache/mod_autoindex.so
LoadModule dir_module         libexec/apache/mod_dir.so
LoadModule cgi_module         libexec/apache/mod_cgi.so
LoadModule asis_module        libexec/apache/mod_asis.so
LoadModule imap_module        libexec/apache/mod_imap.so
LoadModule action_module      libexec/apache/mod_actions.so
LoadModule speling_module     libexec/apache/mod_speling.so
LoadModule userdir_module     libexec/apache/mod_userdir.so
LoadModule alias_module       libexec/apache/mod_alias.so
LoadModule rewrite_module     libexec/apache/mod_rewrite.so
LoadModule access_module      libexec/apache/mod_access.so
LoadModule auth_module        libexec/apache/mod_auth.so
LoadModule anon_auth_module   libexec/apache/mod_auth_anon.so
LoadModule db_auth_module     libexec/apache/mod_auth_db.so
LoadModule digest_module      libexec/apache/mod_digest.so
#LoadModule proxy_module       libexec/apache/libproxy.so
LoadModule cern_meta_module   libexec/apache/mod_cern_meta.so
LoadModule expires_module     libexec/apache/mod_expires.so
LoadModule headers_module     libexec/apache/mod_headers.so
LoadModule usertrack_module   libexec/apache/mod_usertrack.so
LoadModule unique_id_module   libexec/apache/mod_unique_id.so
LoadModule setenvif_module    libexec/apache/mod_setenvif.so
LoadModule perl_module        libexec/apache/libperl.so
LoadModule php3_module        libexec/apache/libphp3.so
LoadModule dav_module         libexec/apache/libdav.so

#  Reconstruction of the complete module list from all available modules
#  (static and shared ones) to achieve correct module execution order.
#  [WHENEVER YOU CHANGE THE LOADMODULE SECTION ABOVE UPDATE THIS, TOO]
ClearModuleList
AddModule mod_charset.c
AddModule mod_vhost_alias.c
AddModule mod_env.c
AddModule mod_log_config.c
AddModule mod_mime_magic.c
AddModule mod_mime.c
AddModule mod_negotiation.c
AddModule mod_status.c
AddModule mod_info.c
AddModule mod_include.c
AddModule mod_autoindex.c
AddModule mod_dir.c
AddModule mod_cgi.c
AddModule mod_asis.c
AddModule mod_imap.c
AddModule mod_actions.c
AddModule mod_speling.c
AddModule mod_userdir.c
AddModule mod_alias.c
AddModule mod_rewrite.c
AddModule mod_access.c
AddModule mod_auth.c
AddModule mod_auth_anon.c
AddModule mod_auth_db.c
AddModule mod_digest.c
#AddModule mod_proxy.c
AddModule mod_cern_meta.c
AddModule mod_expires.c
AddModule mod_headers.c
AddModule mod_usertrack.c
AddModule mod_unique_id.c
AddModule mod_so.c
AddModule mod_setenvif.c
AddModule mod_perl.c
AddModule mod_php3.c
AddModule mod_dav.c

ExtendedStatus On

### Section 2: 'Main' server configuration
Port 80

User nobody
Group nogroup

ServerAdmin [EMAIL PROTECTED]

#ServerName new.host.name

DocumentRoot "/usr/local//www/htdocs"

<Directory />
    Options FollowSymLinks
    AllowOverride All
</Directory>

<Directory "/usr/local//www/htdocs">
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

# Sample settings for Russian Apache documentation
#<Directory "/usr/local//www/htdocs/apache-rus-doc">
#    Options Indexes FollowSymLinks ExecCGI
#    AllowOverride All
#    Order allow,deny
#    Allow from all
#    AddHandler server-parsed .html
#    DirectoryIndex index.html
#    AddHandler cgi-script .cgi
#  <IfModule mod_perl.c>
#    PerlSendHeader On
#    AddHandler perl-script .cgi
#    PerlHandler Apache::Registry
#  </IfModule>
#</Directory>

#
# UserDir: The name of the directory which is appended onto a user's home
# directory if a ~user request is received.
#
UserDir public_html

#
# Control access to UserDir directories.  The following is an example
# for a site where these directories are restricted to read-only.
#
#<Directory /home/*/public_html>
#    AllowOverride FileInfo AuthConfig Limit
#    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
#    <Limit GET POST OPTIONS PROPFIND>
#        Order allow,deny
#        Allow from all
#    </Limit>
#    <Limit PUT DELETE PATCH PROPPATCH MKCOL COPY MOVE LOCK UNLOCK>
#        Order deny,allow
#        Deny from all
#    </Limit>
#</Directory>

DirectoryIndex index.html index.htm index.shtml

AccessFileName .htaccess

<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
</Files>

#
# CacheNegotiatedDocs: By default, Apache sends "Pragma: no-cache" with each
# document that was negotiated on the basis of content. This asks proxy
# servers not to cache the document. Uncommenting the following line disables
# this behavior, and proxies will be allowed to cache the documents.
#
#CacheNegotiatedDocs

UseCanonicalName On

TypesConfig /usr/local//etc/apache/mime.types

DefaultType text/plain

<IfModule mod_mime_magic.c>
    MIMEMagicFile /usr/local//etc/apache/magic
</IfModule>

HostnameLookups Off

#
# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here.  If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog /var/log/error_log

#
# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel warn

#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
#
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

CustomLog /var/log/access_log common

#
# If you would like to have agent and referer logfiles, uncomment the
# following directives.
#
#CustomLog /var/log/referer_log referer
#CustomLog /var/log/agent_log agent

#
# If you prefer a single logfile with access, agent, and referer information
# (Combined Logfile Format) you can use the following directive.
#
#CustomLog /var/log/access_log combined

# Optionally add a line containing the server version and virtual host
# name to server-generated pages (error documents, FTP directory listings,
# mod_status and mod_info output etc., but not CGI generated documents).
# Set to "EMail" to also include a mailto: link to the ServerAdmin.
# Set to one of:  On | Off | EMail
#
ServerSignature EMail

Alias /icons/ "/usr/local//www/icons/"

<Directory "/usr/local//www/icons">
    Options Indexes MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

ScriptAlias /cgi-bin/ "/usr/local//www/cgi-bin/"

<Directory "/usr/local//www/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>

IndexOptions FancyIndexing

#
# AddIcon* directives tell the server which icon to show for different
# files or filename extensions.  These are only displayed for
# FancyIndexed directories.
#
AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip

AddIconByType (TXT,/icons/text.gif) text/*
AddIconByType (IMG,/icons/image2.gif) image/*
AddIconByType (SND,/icons/sound2.gif) audio/*
AddIconByType (VID,/icons/movie.gif) video/*

AddIcon /icons/binary.gif .bin .exe
AddIcon /icons/binhex.gif .hqx
AddIcon /icons/tar.gif .tar
AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
AddIcon /icons/a.gif .ps .ai .eps
AddIcon /icons/layout.gif .html .shtml .htm .pdf
AddIcon /icons/text.gif .txt
AddIcon /icons/c.gif .c
AddIcon /icons/p.gif .pl .py
AddIcon /icons/f.gif .for
AddIcon /icons/dvi.gif .dvi
AddIcon /icons/uuencoded.gif .uu
AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
AddIcon /icons/tex.gif .tex
AddIcon /icons/bomb.gif core

AddIcon /icons/back.gif ..
AddIcon /icons/hand.right.gif README
AddIcon /icons/folder.gif ^^DIRECTORY^^
AddIcon /icons/blank.gif ^^BLANKICON^^

#
# DefaultIcon is which icon to show for files which do not have an icon
# explicitly set.
#
DefaultIcon /icons/unknown.gif

#
# AddDescription allows you to place a short description after a file in
# server-generated indexes.  These are only displayed for FancyIndexed
# directories.
# Format: AddDescription "description" filename
#
#AddDescription "GZIP compressed document" .gz
#AddDescription "tar archive" .tar
#AddDescription "GZIP compressed tar archive" .tgz

#
# ReadmeName is the name of the README file the server will look for by
# default, and append to directory listings.
#
# HeaderName is the name of a file which should be prepended to
# directory indexes. 
#
# The server will first look for name.html and include it if found.
# If name.html doesn't exist, the server will then look for name.txt
# and include it as plaintext if found.
#
ReadmeName README
HeaderName HEADER

#
# IndexIgnore is a set of filenames which directory indexing should ignore
# and not include in the listing.  Shell-style wildcarding is permitted.
#
IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t

#
# AddEncoding allows you to have certain browsers (Mosaic/X 2.1+) uncompress
# information on the fly. Note: Not all browsers support this.
# Despite the name similarity, the following Add* directives have nothing
# to do with the FancyIndexing customization directives above.
#
AddEncoding x-compress Z
AddEncoding x-gzip gz tgz

#
# AddLanguage allows you to specify the language of a document. You can
# then use content negotiation to give a browser a file in a language
# it can understand.  Note that the suffix does not have to be the same
# as the language keyword --- those with documents in Polish (whose
# net-standard language code is pl) may wish to use "AddLanguage pl .po" 
# to avoid the ambiguity with the common suffix for perl scripts.
#
AddLanguage en .en
AddLanguage fr .fr
AddLanguage de .de
AddLanguage da .da
AddLanguage el .el
AddLanguage it .it
AddLanguage ru .ru

#
# LanguagePriority allows you to give precedence to some languages
# in case of a tie during content negotiation.
# Just list the languages in decreasing order of preference.
#
LanguagePriority ru en

#
# AddType allows you to tweak mime.types without actually editing it, or to
# make certain files to be certain types.
#
# For example, the PHP3 module (not part of the Apache distribution - see
# http://www.php.net) will typically use:
#
AddType application/x-httpd-php3 .php3
AddType application/x-httpd-php3-source .phps

AddType application/x-tar .tgz

#
# AddHandler allows you to map certain file extensions to "handlers",
# actions unrelated to filetype. These can be either built into the server
# or added with the Action command (see below)
#
# If you want to use server side includes, or CGI outside
# ScriptAliased directories, uncomment the following lines.
#
# To use CGI scripts:
#
#AddHandler cgi-script .cgi

#
# To use server-parsed HTML files
#
AddType text/html .shtml
AddHandler server-parsed .shtml .htm .html

#
# Uncomment the following line to enable Apache's send-asis HTTP file
# feature
#
#AddHandler send-as-is asis

#
# If you wish to use server-parsed imagemap files, use
#
#AddHandler imap-file map

#
# To enable type maps, you might want to use
#
#AddHandler type-map var

# Action lets you define media types that will execute a script whenever
# a matching file is called. This eliminates the need for repeated URL
# pathnames for oft-used CGI file processors.
# Format: Action media/type /cgi-script/location
# Format: Action handler-name /cgi-script/location

# MetaDir: specifies the name of the directory in which Apache can find
# meta information files. These files contain additional HTTP headers
# to include when sending the document
#MetaDir .web

# MetaSuffix: specifies the file name suffix for the file containing the
# meta information.
#MetaSuffix .meta

#
# Customizable error response (Apache style)
#  these come in three flavors
#
#    1) plain text
#ErrorDocument 500 "The server made a boo boo.
#  n.b.  the (") marks it as text, it does not get output
#
#    2) local redirects
#ErrorDocument 404 /missing.html
#  to redirect to local URL /missing.html
#ErrorDocument 404 /cgi-bin/missing_handler.pl
#  N.B.: You can redirect to a script or a document using server-side-includes.
#
#    3) external redirects
#ErrorDocument 402 http://some.other_server.com/subscription_info.html
#  N.B.: Many of the environment variables associated with the original
#  request will *not* be available to such a script.

BrowserMatch "Mozilla/2" nokeepalive
BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0

BrowserMatch "RealPlayer 4\.0" force-response-1.0
BrowserMatch "Java/1\.0" force-response-1.0
BrowserMatch "JDK/1\.0" force-response-1.0

PerlModule Apache::Status Apache CGI LWP Apache::Registry
PerlModule Apache::SSI
#PerlModule Apache::Resource 

<Perl>
print STDERR "Running PERL section\n";
sub ProtectedLocation {
    my $loc = shift;
    my $rparm = shift;
    print STDERR "Setting up /$loc:\n";
    $Location{"/$loc"} = {
                    AuthType => 'Basic',
                    AuthName => 'System-dependent data',
                    AuthUserFile => '/usr/local/etc/apache/users',
                    require => 'valid-user'
    };
    foreach (keys %$rparm) {
            $Location{"/$loc"}->{$_} = $rparm->{$_};    
    }
#!!!
#    foreach (keys %$Location{"/$loc"}) {
#           print STDERR "\t$_ => ", $Location{"/$loc"}->{$_}, "\n";
#    }   
#!!!
}
#foreach ('server-status', 'server-info') {
#   ProtectedLocation($_, {SetHandler => $_});
#}
#ProtectedLocation('perl-status', { SetHandler => 'perl-script',
#PerlHandler => 'Apache::Status'});
</Perl>

#
# There have been reports of people trying to abuse an old bug from pre-1.1
# days.  This bug involved a CGI script distributed as a part of Apache.
# By uncommenting these lines you can redirect these attacks to a logging 
# script on phf.apache.org.  Or, you can record them yourself, using the script
# support/phf_abuse_log.cgi.
#
#<Location /cgi-bin/phf*>
#    Deny from all
#    ErrorDocument 403 http://phf.apache.org/phf_abuse_log.cgi
#</Location>

#
# Proxy Server directives. Uncomment the following lines to
# enable the proxy server:
#
#<IfModule mod_proxy.c>
#ProxyRequests On
#
#<Directory proxy:*>
#    Order deny,allow
#    Deny from all
#    Allow from .your_domain.com
#</Directory>

#
# Enable/disable the handling of HTTP/1.1 "Via:" headers.
# ("Full" adds the server version; "Block" removes all outgoing Via: headers)
# Set to one of: Off | On | Full | Block
#
#ProxyVia On

#
# To enable the cache as well, edit and uncomment the following lines:
# (no cacheing without CacheRoot)
#
#CacheRoot "/usr/local//www/proxy"
#CacheSize 5
#CacheGcInterval 4
#CacheMaxExpire 24
#CacheLastModifiedFactor 0.1
#CacheDefaultExpire 1
#NoCache a_domain.com another_domain.edu joes.garage_sale.com

#</IfModule>
# End of proxy directives.

### Section 3: Virtual Hosts
#
# VirtualHost: If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them.
# Please see the documentation at <URL:http://www.apache.org/docs/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.

#
# If you want to use name-based virtual hosts you need to define at
# least one IP address (and port number) for them.
#
#NameVirtualHost 12.34.56.78:80
#NameVirtualHost 12.34.56.78

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
#
#<VirtualHost ip.address.of.host.some_domain.com>
#    ServerAdmin [EMAIL PROTECTED]
#    DocumentRoot /www/docs/host.some_domain.com
#    ServerName host.some_domain.com
#    ErrorLog logs/host.some_domain.com-error_log
#    CustomLog logs/host.some_domain.com-access_log common
#</VirtualHost>

#<VirtualHost _default_:*>
#</VirtualHost>

### Section 4: Russian Apache (mod_charset) tuning
# Please visit http://apache.lexa.ru for description of directives
#

<IfModule mod_charset.c>
# Select charset codepages
# Format: CharsetDecl charset_name lang [flags
CharsetDecl ISO-8859-5 ru
CharsetDecl ibm866 ru 
CharsetDecl windows-1251 ru
CharsetDecl koi8-r ru


#CharsetRecodeTable charset1 charset2 table1-2 [table2-1]
CharsetRecodeTable koi8-r ISO-8859-5 /usr/local//etc/apache/tables/russian/koi-iso.tab 
CharsetRecodeTable koi8-r ibm866 /usr/local//etc/apache/tables/russian/koi-alt.tab 
CharsetRecodeTable koi8-r windows-1251 
/usr/local//etc/apache/tables/russian/koi-win.tab 

# Recoding rules for windows-1251 source encoding
CharsetRecodeTable windows-1251 ISO-8859-5 
/usr/local//etc/apache/tables/russian/win-iso.tab 
CharsetRecodeTable windows-1251 ibm866 
/usr/local//etc/apache/tables/russian/win-alt.tab 

#### DO NOT FORGET TO ADD CharsetRecodeTable directives if your
#### html files are stored on disk in different (neither koi8-r nor
#### windows-1251) encodings. Server MUST know all possible
#### Client<->file translations

# If you want to enable Mac support - uncomment next 4 lines 
#CharsetDecl x-mac-cyrillic ru
#CharsetRecodeTable koi8-r x-mac-cyrillic 
/usr/local//etc/apache/tables/russian/koi-mac.tab 
#CharsetRecodeTable windows-1251 x-mac-cyrillic 
/usr/local//etc/apache/tables/russian/win-mac.tab 
#CharsetAgent x-mac-cyrillic Macintosh

## TRANSLIT Support
#CharsetDecl translit ru S
#CharsetWideRecodeTable koi8-r translit 
/usr/local//etc/apache/tables/russian/koi-tran.tab
#CharsetWideRecodeTable windows-1251 translit 
/usr/local//etc/apache/tables/russian/win-tran.tab

# UTF-8 support (for NN/IE 4.x)
# Note! This is one-way conversion (server->client), you should write special
# CGI-support for your input forms
#CharsetDecl utf-8 ru
#CharsetWideRecodeTable koi8-r utf-8 /usr/local//etc/apache/tables/russian/koi-utf8.tab
#CharsetAlias utf-8 utf unicode


## Alternate recode tables by Victor B Wagner <[EMAIL PROTECTED]> 
## with recoding of 'unbreakable space' (0x9a in koi8r)
#CharsetRecodeTable koi8-r windows-1251 
/usr/local//etc/apache/tables/russian2/koi-win.tab 
#CharsetRecodeTable koi8-r iso-8859-5 
/usr/local//etc/apache/tables/russian2/koi-iso.tab 
#CharsetRecodeTable koi8-r ibm866 /usr/local//etc/apache/tables/russian2/koi-alt.tab 
#CharsetRecodeTable koi8-r x-mac-cyrillic 
/usr/local//etc/apache/tables/russian2/koi-mac.tab 
#CharsetRecodeTable windows-1251 iso-8859-5 
/usr/local//etc/apache/tables/russian2/win-iso.tab 
#CharsetRecodeTable windows-1251 ibm866 
/usr/local//etc/apache/tables/russian2/win-alt.tab 
#CharsetRecodeTable windows-1251 x-mac-cyrillic 
/usr/local//etc/apache/tables/russian2/win-mac.tab 

 
# Aliases of charsets
# Format: CharsetAlias real_name alias1 alias2 alias3 ...
CharsetAlias ISO-8859-5 iso_8859-5:1988 iso-ir-144 iso_8859-5 cyrillic
CharsetAlias ISO-8859-5 iso8859-5 iso-8859.5 iso8859.5 iso
CharsetAlias ibm866 csibm866 866 cp866 x-cp866 x-ibm866 cp-866 alt
CharsetAlias windows-1251 win x-cp1251 cp1251 cp-1251
CharsetAlias koi8-r koi-8-r koi8 koi-8 koi
 
# Priority of charsets
CharsetPriority koi8-r windows-1251 ISO-8859-5 ibm866 # x-mac-cyrillic
 
# default charset for real or virtual server (selected if all other charset-
# selectons methods fails)
CharsetDefault koi8-r

#Default source (on-disk) charset
CharsetSourceEnc win
 
# Order in which charset selection rules  applied
#CharsetSelectionOrder Portnumber Hostname UriHostname EnvVariable Dirprefix Useragent
 
# Associate file (on-disk) charset with extension
#CharsetByExtension windows-1251 .htm .js
 
# Strip <META HTTP-EQUIV ...> from this extension (NOTE! this is mutually 
# exclusive with SSI and other non-default file processing)
#AddHandler strip-meta-http .htm .html 


#Select substrings for different clients identification and charsets for 
# each charset
# No CharsetAgent directives - no User-Agent charset selection on server
CharsetAgent windows-1251 AIR_Mosaic IWENG/1 MSIE WinMosaic (Windows (WinNT;
CharsetAgent windows-1251 (Win16; (Win95; (Win98; (16-bit) Opera/3.0
CharsetAgent koi8-r Arena Ariadna OmniWeb Sextant PRD (X11 Lynx/
CharsetAgent ibm866 DosLynx Lynx2/OS/2

# Agents that can't understand MIME
CharsetBadAgent arena Lynx/2.0 Lynx/2.1 Lynx/2.2 Lynx/2.3 Lynx/2.4 "MSIE 2.0;" 
Lynx2/OS/2 


# Uncomment this if server must reject queries with illegal charset
#CharsetErrReject on
 
# Add charset= to Content-Type in all replies - default
#CharsetUseMultiViews off
 
# Uncomment, if you want to recode response headers (turned off by
# default for compatibility with older versions)
# CharsetRecodeHeaders on
 
# Comment out, if you want to recode filenames. Not recommended
CharsetRecodeFilenames Off
 
# CharsetDisable directive turns off all charset processing.
# Sample:
# <Directory /some/where/sub/dir>
# CharsetDisable on
# </Directory>

# Charset Selection by portnumber
# do not forget to COMMENT OUT ALL Port directive above
# Listen 80  
# Listen 8100
# Listen 8101
# Listen 8102
# Listen 8103
# Listen 8104
# CharsetByPort koi8-r 8100
# CharsetByPort windows-1251 8101
# CharsetByPort ibm866 8102
# CharsetByPort iso-8859-5 8103
# CharsetByPort x-mac-cyrillic 8104
#
# "AutoRedirect" setup
#
# CharsetAutoRedirect koi8-r :8100
# CharsetAutoRedirect windows-1251 :8101
# CharsetAutoRedirect ibm866 :8102
# CharsetAutoRedirect iso-8859-5 :8103
# CharsetAutoRedirect x-mac-cyrillic :8104
# CharsetNormalizeTypes image/ application/ video/ audio/
# CharsetNormalizeToURL :80 200
#   Do not redirect if charset determined as charsetdefault
# CharsetNoAutoRedirectForDefaultCharset On 
#   When redirect, use original unparsed URI instead of parsed one
#   (useful with mod_rewrite)
#  CharsetRedirectFromOriginalURL On
#
# 
#  Additional notes:
# Use 
# CharsetAutoRedirect koi8-r none
# and
# CharsetNormalizeToUrl none
# in .htaccess/<Directory>/<Location>/<Files> if you wish to
# disable AutoRedirect for some particular URL
 
 CharsetBrokenAccept "Mozilla/4." "iso-8859-1,*,utf-8"
# Uncomment next line if you want strict hostname/dirname <->charset match
# (see documentation)
# CharsetStrictURIMatch On

</IfModule>

<Files *.shtml>
SetHandler perl-script
PerlHandler Apache::SSI
</Files>

<Perl>
print STDERR "Loading virtual servers\n";
sub CgiDir {
    my ($rsa, $rsd,$alias, $path) = @_;
    push @$rsa, ["/$alias/", "$path/$alias/"];
    $rsd->{"$path/$alias"} = {
                               Options => 'ExecCgi'
                               };
} 

# MkVirtualHost('www.land.ru', {}, $path, 'koi')
sub MkVirtualHost {
   my $name = shift;
   my $rparm = shift; # RESERVED
   my $path = shift||"/usr/local/www/virtual/$name";
   my $enc = shift||'win';
   my $ralias = shift;
   $VirtualHost{'212.24.43.133'} = {
        ServerName => "www.$name";
        ServerAlias => defined($ralias)?[$name, @$ralias]:[$name];
        CharserSourceEnc => $enc,
        DocumentRoot => "$path/docs",
        Options => '+Includes',
        ErrorLog => "/var/log/apache/$name.err",
        CustomLog => ["/var/log/apache/$name.log", "combined"]
        Directory => {"$path/cgi-bin" => { Options => 'ExecCgi'},
        "$path/cgi" => { Options => 'ExecCgi'} },
        ScriptAlias => { "/cgi-bin/" => "$path/cgi-bin" }
   };
}
sub LandHost {
   my $name = shift;
   my $rparm = shift;
   MkVirtualHost("$name.land.ru", $rparm, "/usr/local/www/virtual/land/$name",
@_);
}

sub LVirtualHost {
   my $name = shift;
   my $rparm = shift;
   MkVirtualHost($name, $rparm,
   "/usr/local/www/virtual/land/www.$name", @_);
}

NameVirtualHost 212.24.43.133

# DEFAULT
LVirtualHost('land.ru');
foreach (qw(zhurnal.net.ru bpower.ru colors.land.ru jokes.ru warum.ru
value.ru boards.ru)) {
        MkVirtualHost($_);
}
LVirtualHost('vektra.ru',undef, undef, undef, [qw(lego.land.ru www.lego.land.ru)]);
MkVirtualHost('webgid.ru', undef, undef, 'koi8');
#<Files *.html>
#SetHandler server-parsed 
#SetHandler perl-script
#PerlHandler Apache::SSI
#</Files>
foreach (qw(integral.net.ru channel2000.net.ru mirs.ru abbott.ru
eliz.ru hum.com.ru land.net.ru script.ru medialand.ru)) {
        LVirtualHost($_);
}
<VirtualHost 212.24.43.133>
DocumentRoot /usr/local/www/htdocs
ServerName flagship.land.ru
</VirtualHost>
foreach (qw(advokat bbp deti fun humour italy itimes kozachek love
moskva ng pskov)) {
       LandHost($_);
}
LandHost('prikol.ru', undef, undef, undef, 'zzz.land.ru');
use Apache::PerlSections();
print STDERR Apache::PerlSections->dump();
</Perl>
=== cut ===
-- 
Alexander B. Povolotsky                            [ICQ 18277558]
[2:5020/145]                                    [[EMAIL PROTECTED]]

Reply via email to