Advertisement
Guest User

HawaiiMike foswiki.conf

a guest
Apr 5th, 2011
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.14 KB | None | 0 0
  1. # Example httpd.conf file for Foswiki.
  2. #
  3. # You are recommended to take a copy of this file and edit
  4. # the paths to match your installation. Most Linux distributions are setup so
  5. # Apache includes all config files that ends with .conf within a specific
  6. # directory. If your distribution does not have this feature then add:
  7. # include "/var/www/foswiki/foswiki_httpd.conf"
  8. # to the end of your main httpd.conf file.
  9. #
  10. # See also http://foswiki.org/Support/ApacheConfigGenerator
  11. # that helps you configure Apache
  12.  
  13. # The first parameter will be part of the URL to your installation e.g.
  14. # http://example.com/foswiki/bin/view/...
  15. # The second parameter must point to the physical path on your disk. Be
  16. # careful not to lose any trailing /'s.
  17.  
  18. #### Change the _second_ path to match your local installation
  19. ScriptAlias /foswiki/bin "/var/www/foswiki/bin"
  20.  
  21. # This defines a url that points to the pub directory of the foswiki installation. It is
  22. # used to access files in the pub directory (attachments etc)
  23. # It must come _after_ the ScriptAlias.
  24. Alias /foswiki/pub "/var/www/foswiki/pub"
  25.  
  26. # This enables access to the documents in the Foswiki root directory
  27. <Directory "/var/www/foswiki">
  28. Order Allow,Deny
  29. Allow from all
  30. Deny from env=blockAccess
  31. </Directory>
  32.  
  33. # This alias enables access to the documents in the Foswiki root directory.
  34. # You may comment this out if you do not desire that people have this access.
  35. #### Change the path to match your local installation
  36. Alias /foswiki "/var/www/foswiki"
  37.  
  38. # Block access to typical spam related attachments (.htm and .html files)
  39. # Except the Foswiki directory which is read only and does have attached html files.
  40. # You should uncomment the two lines below if the Foswiki is on the public Internet
  41. #SetEnvIf Request_URI "/foswiki/pub/.*\.[hH][tT][mM][lL]?$" blockAccess
  42. #SetEnvIf Request_URI "/foswiki/pub/System/.*\.[hH][tT][mM][lL]?$" !blockAccess
  43.  
  44. # We set an environment variable called blockAccess.
  45. #
  46. # Setting a BrowserMatchNoCase to ^$ is important. It prevents Foswiki from
  47. # including its own topics as URLs and also prevents other Foswikis from
  48. # doing the same. This is important to prevent the most obvious
  49. # Denial of Service attacks.
  50. #
  51. # You can expand this by adding more BrowserMatchNoCase statements to
  52. # block evil browser agents trying the impossible task of mirroring a Foswiki.
  53. # http://foswiki.org/Support/ApacheConfigGenerator has a good list
  54. # of bad spiders to block.
  55. #
  56. # Example:
  57. # BrowserMatchNoCase ^SiteSucker blockAccess
  58. BrowserMatchNoCase ^$ blockAccess
  59.  
  60. # Setting the NO_FOSWIKI_SESSION environment variable prevents a
  61. # session being created for the Google Search Appliance bot. This
  62. # is useful if you have the Google Search Appliance installed on
  63. # your intranet, as they can be very aggressive when indexing, creating
  64. # a lot of session files and slowing Foswiki down.
  65. # You can also set this environment variable for public sites, to
  66. # prevent Google and other search engines' bots. However, these tend
  67. # to index your site a lot less often than the Google Search Appliance.
  68. BrowserMatch "^gsa-crawler" NO_FOSWIKI_SESSION
  69.  
  70.  
  71. # This specifies the options on the Foswiki scripts directory. The ExecCGI
  72. # and SetHandler tell apache that it contains scripts. "Allow from all"
  73. # lets any IP address access this URL.
  74.  
  75. #### Change the path to match your local installation
  76. <Directory "/var/www/foswiki/bin">
  77. AllowOverride None
  78. Order Allow,Deny
  79. Allow from all
  80. Deny from env=blockAccess
  81.  
  82. Options ExecCGI FollowSymLinks
  83. SetHandler cgi-script
  84.  
  85. # Password file for Foswiki users
  86. AuthUserFile /var/www/foswiki/data/.htpasswd
  87. 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.'
  88. AuthType Basic
  89.  
  90. #for htdigest password suport uncomment the following
  91. #AuthDigestDomain / {DefaultUrlHost}
  92. #AuthDigestFile {DataDir}/.htdigest
  93. #BrowserMatch "MSIE" AuthDigestEnableQueryStringHack=On
  94. #AuthDigestProvider file
  95. #AuthUserFile {DataDir}/.htpasswd
  96. # For "Digest" authentication to work properly, this string must match
  97. # the value of configuration variable $authRealm
  98. #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.'
  99. #AuthType Digest
  100.  
  101. # File to return on access control error (e.g. wrong password)
  102. # By convention this is the UserRegistration page, that allows users
  103. # to register with the Foswiki. Apache requires this to be a *local* path.
  104. # Comment this out if you setup Foswiki to completely deny access to WikiGuest
  105. # in all webs or change the path to a static html page.
  106. ErrorDocument 401 /foswiki/bin/view/System/UserRegistration
  107. # Alternatively if your users are all known to be registered you may want
  108. # to redirect them to the ResetPassword page.
  109. # ErrorDocument 401 /foswiki/bin/view/System/ResetPassword
  110.  
  111. # Limit access to configure to specific IP addresses and or users.
  112. # Make sure configure is not open to the general public.
  113. # The configure script is designed for administrators only.
  114. # The script itself and the information it reveals can be abused by
  115. # attackers if not properly protected against public access.
  116. # Replace JohnDoe with the login name of the administrator
  117. <FilesMatch "^configure.*">
  118. SetHandler cgi-script
  119. Order Deny,Allow
  120. Deny from all
  121. Allow from 127.0.0.1 192.168.1.10
  122. Require user JohnDoe
  123. Satisfy Any
  124. </FilesMatch>
  125.  
  126. # When using Apache type login the following defines the Foswiki scripts
  127. # that makes Apache ask the browser to authenticate. It is correct that
  128. # scripts such as view, resetpasswd & passwd are not authenticated.
  129. # (un-comment to activate)
  130. #<FilesMatch "(attach|edit|manage|rename|save|upload|mail|logon|rest|.*auth).*">
  131. # require valid-user
  132. #</FilesMatch>
  133.  
  134. </Directory>
  135.  
  136.  
  137. # This sets the options on the pub directory, which contains attachments and
  138. # other files like CSS stylesheets and icons. AllowOverride None stops a
  139. # user installing a .htaccess file that overrides these options.
  140. # Finally all execution of PHP and other scripts is disabled.
  141.  
  142. # Note that files in pub are *not* protected by Foswiki Access Controls,
  143. # so if you want to control access to files attached to topics, you may
  144. # need to add your own .htaccess files to subdirectories of pub. See the
  145. # Apache documentation on .htaccess for more info.
  146.  
  147. #### Change the path to match your local installation
  148. <Directory "/var/www/foswiki/pub">
  149. #if you are using an svn checkout an pseudo-install.pl, you will need to enable symlinks
  150. #Options FollowSymLinks
  151. Options None
  152. AllowOverride None
  153. Order Allow,Deny
  154. Allow from all
  155. Deny from env=blockAccess
  156.  
  157. # If you have PHP4 or PHP5 installed as Apache module make sure the directive below is enabled
  158. # If you do not have PHP installed you will need to comment out the directory below
  159. # to avoid errors.
  160. # If PHP is installed as CGI this flag is not needed and will in fact make Apache fail
  161. php_admin_flag engine off
  162.  
  163. # If you have PHP3 installed as Apache module make sure the directive below is enabled
  164. # If PHP is installed as CGI this flag is not needed and will in fact make Apache fail
  165. #php3_engine off
  166.  
  167. # This line will redefine the mime type for the most common types of scripts
  168. AddType text/plain .shtml .php .php3 .phtml .phtm .pl .py .cgi
  169.  
  170. #for TWikiCompatibility - or even to make 'attachment not found's more user friendly
  171. ErrorDocument 404 /foswiki/bin/viewfile
  172.  
  173. #
  174. #add an Expires header that is sufficiently in the future that the browser does not even ask if its uptodate
  175. # reducing the load on the server significantly
  176. #IF you can, you should enable this - it _will_ improve your Foswiki experience, even if you set it to under one day.
  177. # you may need to enable expires_module in your main apache config
  178. #LoadModule expires_module libexec/httpd/mod_expires.so
  179. #AddModule mod_expires.c
  180. #<ifmodule mod_expires.c>
  181. # <filesmatch "\.(jpg|gif|png|css|js)$">
  182. # ExpiresActive on
  183. # ExpiresDefault "access plus 11 days"
  184. # </filesmatch>
  185. #</ifmodule>
  186. #
  187.  
  188. </Directory>
  189.  
  190.  
  191. # Spammers are known to attach their stuff and then move it to trash where it remains unnoticed.
  192. # We prevent viewing any attachments directly from pub
  193. #### Change the path to match your local installation
  194. <Directory "/var/www/foswiki/pub/Trash">
  195. deny from all
  196. </Directory>
  197.  
  198.  
  199. # Security note: All other directories should be set so
  200. # that they are *not* visible as URLs, so we set them as =deny from all=.
  201.  
  202. #### Change the paths to match your local installation
  203. <Directory "/var/www/foswiki/data">
  204. deny from all
  205. </Directory>
  206.  
  207. <Directory "/var/www/foswiki/templates">
  208. deny from all
  209. </Directory>
  210.  
  211. <Directory "/var/www/foswiki/lib">
  212. deny from all
  213. </Directory>
  214.  
  215. <Directory "/var/www/foswiki/locale">
  216. deny from all
  217. </Directory>
  218.  
  219. <Directory "/var/www/foswiki/tools">
  220. deny from all
  221. </Directory>
  222.  
  223. <Directory "/var/www/foswiki/working">
  224. deny from all
  225. </Directory>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement