All pastes #640898 Raw Edit

Meins

public text v1 · immutable
#640898 ·published 2007-07-31 19:40 UTC
rendered paste body
ServerRoot "/usr/local/apache-build"

Listen 81

LogLevel debug


LoadModule perl_module modules/mod_perl.so

<IfModule !mpm_netware_module>
User daemon
Group daemon
</IfModule>

ServerAdmin xyz@xyz.com

ServerName xyz.com

DocumentRoot "/data/htdocs/twiki"

RedirectMatch ^/$ /bin/view/

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>

# Autogenerated httpd.conf file for TWiki.
# Generated at http://twiki.org/cgi-bin/view/TWiki/ApacheConfigGenerator

# We set an environment variable called blockAccess.
#
# Setting a BrowserMatchNoCase to ^$ is important. It prevents TWiki from
# including its own topics as URLs and also prevents other TWikis from
# doing the same. This is important to prevent the most obvious
# Denial of Service attacks.
#
# You can expand this by adding more BrowserMatchNoCase statements to
# block evil browser agents trying the impossible task of mirroring a twiki
#
# Example:
# BrowserMatchNoCase ^SiteSucker blockAccess
# BrowserMatchNoCase ^$ blockAccess

BrowserMatchNoCase ^Accoona blockAccess
BrowserMatchNoCase ^ActiveAgent blockAccess
BrowserMatchNoCase ^Attache blockAccess
...

# Mod_perl preloading
Perlrequire /data/htdocs/twiki/tools/mod_perl_startup.pl
PerlSwitches -T

# The ScriptAlias defines the bin directory as a directory where CGI
# scripts are allowed.
# The first parameter will be part of the URL to your installation e.g.
# http://my.co.uk/twiki/bin/view/...
# The second parameter must point to the physical path on your disc.
ScriptAlias /twiki/bin "/data/htdocs/twiki/bin"

# The Alias defines a url that points to the root of the twiki installation.
# It is used to access files in the pub directory (attachments etc)
# It must come _after_ the ScriptAlias.
Alias /twiki "/data/htdocs/twiki"

# This specifies the options on the TWiki scripts directory. The ExecCGI
# and SetHandler tell apache that it contains scripts. "Allow from all"
# lets any IP address access this URL.
<Directory "/data/htdocs/twiki/bin">
    AllowOverride All
    Order Allow,Deny
    Allow from all
    Deny from env=blockAccess

    Options ExecCGI FollowSymLinks
    SetHandler cgi-script

    # Password file for TWiki users
    AuthUserFile /data/htdocs/twiki/data/.htpasswd
    AuthName 'Enter your WikiName: (First name and last name, no space, no dots, capitalized, e.g. JohnSmith). Cancel to re
    AuthType Basic

    # File to return on access control error (e.g. wrong password)
    # By convention this is the TWikiRegistration page, that allows users
    # to register with the TWiki. Apache requires this to be a *local* path.
    ErrorDocument 401 /twiki/bin/view/TWiki/TWikiRegistration

# Limit access to configure to specific IP addresses and or users.
# Make sure configure is not open to the general public.
# It exposes system details that can help attackers.
<FilesMatch "^(configure)$">
    SetHandler cgi-script
    Order Deny,Allow
    Allow from all



</FilesMatch>

# Enable mod_perl for the bin scripts listed

<FilesMatch "(attach|edit|manage|rename|save|upload|view|.*auth).*">
    SetHandler perl-script
    PerlResponseHandler ModPerl::Registry
    PerlSendHeader On
    PerlOptions +ParseHeaders
</FilesMatch>

</Directory>
# This sets the options on the pub directory, which contains attachments and
# other files like CSS stylesheets and icons. AllowOverride None stops a
# user installing a .htaccess file that overrides these options.
# Note that files in pub are *not* protected by TWiki Access Controls,
# so if you want to control access to files attached to topics you need to
# block access to the specific directories same way as the ApacheConfigGenerator
# blocks access to the pub directory of the Trash web
<Directory "/data/htdocs/twiki/pub">
    Options None
    AllowOverride None
    Order Allow,Deny
    Allow from all
    Deny from env=blockAccess

    # This line will redefine the mime type for the most common types of scripts
    # It will also deliver HTML files as if they are text files
    AddType text/plain .html .htm .shtml .php .php3 .phtml .phtm .pl .py .cgi
</Directory>

# Security note: All other directories should be set so
# that they are *not* visible as URLs, so we set them as =deny from all=.
<Directory "/data/htdocs/twiki/data">
    deny from all
</Directory>

<Directory "/data/htdocs/twiki/templates">
    deny from all
</Directory>

<Directory "/data/htdocs/twiki/lib">
    deny from all
</Directory>

<Directory "/data/htdocs/twiki/locale">
    deny from all
</Directory>

<Directory "/data/htdocs/twiki/tools">
    deny from all
</Directory>