updated on Sat Jan 14 00:11:12 UTC 2012
[aur-mirror.git] / foswiki / httpd-foswiki.conf
blob296a461eeb9ba8fe96956cf8f3addd35758c4d32
1 # Autogenerated httpd.conf file for Foswiki.
2 # Generated at http://foswiki.org/Support/ApacheConfigGenerator?vhost=localhost;port=;dir=/srv/http/htdocs/foswiki;symlink=on;pathurl=/foswiki;shorterurls=enabled;engine=CGI;fastcgimodule=fastcgi;apver=2;allowconf=;requireconf=foswiki;loginmanager=Template;htpath=;errordocument=UserRegistration;errorcustom=;phpinstalled=None;blockpubhtml=;blocktrashpub=;controlattach=;blockspiders=;foswikiversion=1.1
4 # For Foswiki version 1.1
8 NameVirtualHost *:80
10 <VirtualHost *:80>
11         # Change below
12         ServerAdmin webmaster@localhost
13         DocumentRoot /srv/http/htdocs/foswiki
14         # Change below
15         ServerName localhost
16 #        ServerAlias www.localhost         # Optional.  Add to list of redirect hosts in bin/configure
19 # The Alias defines a url that points to the root of the Foswiki installation.
20 # The first parameter will be part of the URL to your installation e.g.
21 # http://my.co.uk/foswiki/bin/view/...
22 # The second parameter must point to the physical path on your disc.
24 ScriptAlias /foswiki/bin "/srv/http/htdocs/foswiki/bin"
26 # The following Alias is used to access files in the pub directory (attachments etc)
27 # It must come _after_ the ScriptAlias.  
28 # If short URLs are enabled, and any other local directories or files need to be accessed directly, they 
29 # must also be specified in an Alias statement, and must not conflict with a web name.  
31 Alias /foswiki/pub "/srv/http/htdocs/foswiki/pub"
32 Alias /foswiki/robots.txt "/srv/http/htdocs/foswiki/robots.txt"
36 #  Rewriting is required for Short URLs, and Attachment redirecting to viewfile
37 RewriteEngine    on
38 #RewriteLog "/var/log/apache/rewrite.log"  
39 #RewriteLogLevel 0   
43 # short urls
44 Alias /foswiki "/srv/http/htdocs/foswiki/bin/view"
45 RewriteRule ^/+foswiki/+bin/+view/+(.*) /foswiki/$1 [L,NE,R]
46 RewriteRule ^/+foswiki/+bin/+view$ /foswiki/ [L,NE,R]
52 # This enables access to the documents in the Foswiki root directory
53 <Directory "/srv/http/htdocs/foswiki">
54         Order Allow,Deny
55         Allow from all
56         Deny from env=blockAccess
57 </Directory>
61 # This specifies the options on the Foswiki scripts directory. The ExecCGI
62 # and SetHandler tell apache that it contains scripts. "Allow from all"
63 # lets any IP address access this URL.
64 # Note:  If you use SELinux, you also have to "Allow httpd cgi support" in your SELinux policies
66 <Directory "/srv/http/htdocs/foswiki/bin">
67         AllowOverride None
68         Order Allow,Deny
69         Allow from all
70         Deny from env=blockAccess
72         Options +ExecCGI  +FollowSymLinks
73         SetHandler cgi-script
75 # Password file for Foswiki users
76         AuthUserFile /srv/http/htdocs/foswiki/data/.htpasswd
77         AuthName 'Enter your WikiName: (First name and last name, no space, no dots, capitalized, e.g. JohnSmith). Cancel to register if you do not have one.'
78         AuthType Basic
80 # File to return on access control error (e.g. wrong password)
81         ErrorDocument 401 /foswiki/System/UserRegistration
83 # Limit access to configure to specific IP address(es) or user(s).
84 # Make sure configure is not open to the general public.
85 # It exposes system details that can help attackers.
86 # cf. http://foswiki.org/Support/ProtectingYourConfiguration for details.
87         <FilesMatch "^(configure)$">
88                 SetHandler cgi-script
89 #                Require user foswiki # EDIT
90 #                Satisfy Any # EDIT
91                 ErrorDocument 401 default
92         </FilesMatch>
94 </Directory>
96 # This sets the options on the pub directory, which contains attachments and
97 # other files like CSS stylesheets and icons. AllowOverride None stops a
98 # user installing a .htaccess file that overrides these options.
99 # Note that files in pub are *not* protected by Foswiki Access Controls,
100 # so if you want to control access to files attached to topics you need to
101 # block access to the specific directories same way as the ApacheConfigGenerator
102 # blocks access to the pub directory of the Trash web
103 <Directory "/srv/http/htdocs/foswiki/pub">
104         Options None
105         Options +FollowSymLinks
106         AllowOverride None
107         Order Allow,Deny
108         Allow from all
109         Deny from env=blockAccess
110         ErrorDocument 404 /foswiki/bin/viewfile
112 # This line will redefine the mime type for the most common types of scripts
113         AddType text/plain .shtml .php .php3 .phtml .phtm .pl .py .cgi
115 #add an Expires header that is sufficiently in the future that the browser does not even ask if its uptodate
116 # reducing the load on the server significantly
117 #IF you can, you should enable this - it _will_ improve your Foswiki experience, even if you set it to under one day. 
118 # you may need to enable expires_module in your main apache config
119 #LoadModule expires_module libexec/httpd/mod_expires.so
120 #AddModule mod_expires.c
121 #<ifmodule mod_expires.c>
122 #  <filesmatch "\.(jpe?g|gif|png|css(\.gz)?|js(\.gz)?|ico)$">
123 #       ExpiresActive on
124 #       ExpiresDefault "access plus 11 days"
125 #   </filesmatch>
126 #</ifmodule>
128 # Serve pre-compressed versions of .js and .css files, if they exist
129 # Some browsers do not handle this correctly, which is why it is disabled by default
130 # <FilesMatch "\.(js|css)$">
131 #         RewriteEngine on
132 #         RewriteCond %{HTTP:Accept-encoding} gzip
133 #         RewriteCond %{REQUEST_FILENAME}.gz -f
134 #         RewriteRule ^(.*)$ %{REQUEST_URI}.gz [L,QSA]
135 # </FilesMatch>
136 # <FilesMatch "\.(js|css)\?.*$">
137 #         RewriteEngine on
138 #         RewriteCond %{HTTP:Accept-encoding} gzip
139 #         RewriteCond %{REQUEST_FILENAME}.gz -f
140 #         RewriteRule ^([^?]*)\?(.*)$ $1.gz?$2 [L]
141 # </FilesMatch>
142 # <FilesMatch "\.js\.gz(\?.*)?$">
143 #         AddEncoding x-gzip .gz
144 #         AddType application/x-javascript .gz
145 # </FilesMatch>
146 # <FilesMatch "\.css\.gz(\?.*)?$">
147 #         AddEncoding x-gzip .gz
148 #         AddType text/css .gz
149 # </FilesMatch>
152 </Directory>
154 # Security note: All other directories should be set so
155 # that they are *not* visible as URLs, so we set them as =deny from all=.
156 <Directory "/srv/http/htdocs/foswiki/data">
157         deny from all
158 </Directory>
160 <Directory "/srv/http/htdocs/foswiki/templates">
161         deny from all
162 </Directory>
164 <Directory "/srv/http/htdocs/foswiki/lib">
165         deny from all
166 </Directory>
168 <Directory "/srv/http/htdocs/foswiki/locale">
169         deny from all
170 </Directory>
172 <Directory "/srv/http/htdocs/foswiki/tools">
173         deny from all
174 </Directory>
176 <Directory "/srv/http/htdocs/foswiki/working">
177         deny from all
178 </Directory>
180 # We set an environment variable called blockAccess.
182 # Setting a BrowserMatchNoCase to ^$ is important. It prevents Foswiki from
183 # including its own topics as URLs and also prevents other Foswikis from
184 # doing the same. This is important to prevent the most obvious
185 # Denial of Service attacks.
187 # You can expand this by adding more BrowserMatchNoCase statements to
188 # block evil browser agents trying to crawl your Foswiki
190 # Example:
191 # BrowserMatchNoCase ^SiteSucker blockAccess
192 # BrowserMatchNoCase ^$ blockAccess
196 BrowserMatchNoCase ^$ blockAccess
199 </VirtualHost>