Advertisement
Guest User

TWiki Apache2 Config

a guest
Oct 10th, 2016
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 6.47 KB | None | 0 0
  1. # Autogenerated httpd.conf file for TWiki.
  2. # Generated at http://twiki.org/cgi-bin/view/TWiki/ApacheConfigGenerator
  3.  
  4. # IMPORTANT NOTE: Make sure to enable mod_cgi in the primary apache configuration file.
  5.  
  6. # We set an environment variable called blockAccess.
  7. #
  8. # Setting a BrowserMatchNoCase to ^$ is important. It prevents TWiki from
  9. # including its own topics as URLs and also prevents other TWikis from
  10. # doing the same. This is important to prevent the most obvious
  11. # Denial of Service attacks.
  12. #
  13. # You can expand this by adding more BrowserMatchNoCase statements to
  14. # block evil browser agents trying the impossible task of mirroring a twiki
  15. #
  16. # Example:
  17. # BrowserMatchNoCase ^SiteSucker blockAccess
  18. # BrowserMatchNoCase ^$ blockAccess
  19.  
  20. BrowserMatchNoCase ^Accoona blockAccess
  21. BrowserMatchNoCase ^ActiveAgent blockAccess
  22. BrowserMatchNoCase ^Attache blockAccess
  23. BrowserMatchNoCase BecomeBot blockAccess
  24. BrowserMatchNoCase ^bot blockAccess
  25. BrowserMatchNoCase Charlotte/ blockAccess
  26. BrowserMatchNoCase ^ConveraCrawler blockAccess
  27. BrowserMatchNoCase ^CrownPeak-HttpAgent blockAccess
  28. BrowserMatchNoCase ^EmailCollector blockAccess
  29. BrowserMatchNoCase ^EmailSiphon blockAccess
  30. BrowserMatchNoCase ^e-SocietyRobot blockAccess
  31. BrowserMatchNoCase ^Exabot blockAccess
  32. BrowserMatchNoCase ^FAST blockAccess
  33. BrowserMatchNoCase ^FDM blockAccess
  34. BrowserMatchNoCase ^GetRight/6.0a blockAccess
  35. BrowserMatchNoCase ^GetWebPics blockAccess
  36. BrowserMatchNoCase ^Gigabot blockAccess
  37. BrowserMatchNoCase ^gonzo1 blockAccess
  38. BrowserMatchNoCase ^Google\sSpider blockAccess
  39. BrowserMatchNoCase ^ichiro blockAccess
  40. BrowserMatchNoCase ^ie_crawler blockAccess
  41. BrowserMatchNoCase ^iGetter blockAccess
  42. BrowserMatchNoCase ^IRLbot blockAccess
  43. BrowserMatchNoCase Jakarta blockAccess
  44. BrowserMatchNoCase ^Java blockAccess
  45. BrowserMatchNoCase ^KrakSpider blockAccess
  46. BrowserMatchNoCase ^larbin blockAccess
  47. BrowserMatchNoCase ^LeechGet blockAccess
  48. BrowserMatchNoCase ^LinkWalker blockAccess
  49. BrowserMatchNoCase ^Lsearch blockAccess
  50. BrowserMatchNoCase ^Microsoft blockAccess
  51. BrowserMatchNoCase ^MJ12bot blockAccess
  52. BrowserMatchNoCase MSIECrawler blockAccess
  53. BrowserMatchNoCase ^MSRBOT blockAccess
  54. BrowserMatchNoCase ^noxtrumbot blockAccess
  55. BrowserMatchNoCase ^NutchCVS blockAccess
  56. BrowserMatchNoCase ^RealDownload blockAccess
  57. BrowserMatchNoCase ^Rome blockAccess
  58. BrowserMatchNoCase ^Roverbot blockAccess
  59. BrowserMatchNoCase ^schibstedsokbot blockAccess
  60. BrowserMatchNoCase ^Seekbot blockAccess
  61. BrowserMatchNoCase ^SiteSnagger blockAccess
  62. BrowserMatchNoCase ^SiteSucker blockAccess
  63. BrowserMatchNoCase ^Snapbot blockAccess
  64. BrowserMatchNoCase ^sogou blockAccess
  65. BrowserMatchNoCase ^SpiderKU blockAccess
  66. BrowserMatchNoCase ^SpiderMan blockAccess
  67. BrowserMatchNoCase ^Squid blockAccess
  68. BrowserMatchNoCase ^Teleport blockAccess
  69. BrowserMatchNoCase ^User-Agent\: blockAccess
  70. BrowserMatchNoCase VoilaBot blockAccess
  71. BrowserMatchNoCase ^voyager blockAccess
  72. BrowserMatchNoCase ^W3C blockAccess
  73. BrowserMatchNoCase ^w3search blockAccess
  74. BrowserMatchNoCase ^Web\sDownloader blockAccess
  75. BrowserMatchNoCase ^WebCopier blockAccess
  76. BrowserMatchNoCase ^WebDevil blockAccess
  77. BrowserMatchNoCase ^WebSec blockAccess
  78. BrowserMatchNoCase ^WebVac blockAccess
  79. BrowserMatchNoCase ^Webwhacker blockAccess
  80. BrowserMatchNoCase ^Webzip blockAccess
  81. BrowserMatchNoCase ^Wells blockAccess
  82. BrowserMatchNoCase ^WhoWhere blockAccess
  83. BrowserMatchNoCase www\.netforex\.org blockAccess
  84. BrowserMatchNoCase ^WX_mail blockAccess
  85. BrowserMatchNoCase ^yacybot blockAccess
  86. BrowserMatchNoCase ^ZIBB blockAccess
  87. BrowserMatchNoCase ^$ blockAccess
  88.  
  89. <IfModule mod_perl.c>
  90.     # Mod_perl preloading
  91.     PerlSwitches -T
  92. </IfModule>
  93.  
  94. # The ScriptAlias defines the bin directory as a directory where CGI
  95. # scripts are allowed.
  96. # The first parameter will be part of the URL to your installation e.g.
  97. # http://example.com/do/view/...
  98. # The second parameter must point to the physical path on your disc.
  99. ScriptAlias /do "/var/www/twiki/bin"
  100.  
  101. # The Alias defines a url that points to the twiki pub directory, which
  102. # is the root of file attachments.
  103. Alias /pub "/var/www/twiki/pub"
  104.  
  105. # This specifies the options on the TWiki scripts directory. The ExecCGI
  106. # and SetHandler tell apache that it contains scripts. "Require all granted"
  107. # lets any IP address access this URL.
  108. <Directory "/var/www/twiki/bin">
  109.     AllowOverride None
  110.     Require all granted
  111.     Deny from env=blockAccess
  112.  
  113.     Options ExecCGI FollowSymLinks
  114.     SetHandler cgi-script
  115.  
  116.     # Password file for TWiki users
  117.     AuthUserFile /var/www/twiki/data/.htpasswd
  118.     AuthName 'Enter your WikiName: (First name and last name, no space, no dots, capitalized, e.g. JohnSmith)'
  119.     AuthType Basic
  120.  
  121.     # File to return on access control error (e.g. wrong password)
  122.     ErrorDocument 401 /do/view/TWiki/ResetPassword
  123.  
  124.  
  125.  
  126. </Directory>
  127.  
  128. # This sets the options on the pub directory, which contains attachments and
  129. # other files like CSS stylesheets and icons. AllowOverride None stops a
  130. # user installing a .htaccess file that overrides these options.
  131. # Note that files in pub are *not* protected by TWiki Access Controls,
  132. # so if you want to control access to files attached to topics you need to
  133. # block access to the specific directories same way as the ApacheConfigGenerator
  134. # blocks access to the pub directory of the Trash web
  135. <Directory "/var/www/twiki/pub">
  136.     Options None
  137.     AllowOverride None
  138.     Require all granted
  139.     Deny from env=blockAccess
  140.  
  141.     # Disable execusion of PHP scripts
  142.     php_admin_flag engine off
  143.  
  144.     # This line will redefine the mime type for the most common types of scripts
  145.     AddType text/plain .shtml .php .php3 .phtml .phtm .pl .py .cgi
  146.  
  147. #add an Expires header that is sufficiently in the future that the browser does not even ask if its uptodate
  148. # reducing the load on the server significantly
  149. #IF you can, you should enable this - it _will_ improve your twiki experience, even if you set it to under one day.
  150. # you may need to enable expires_module in your main apache config
  151. #LoadModule expires_module libexec/httpd/mod_expires.so
  152. #AddModule mod_expires.c
  153. #<ifmodule mod_expires.c>
  154. #  <filesmatch "\.(jpg|gif|png|css|js)$">
  155. #       ExpiresActive on
  156. #       ExpiresDefault "access plus 11 days"
  157. #   </filesmatch>
  158. #</ifmodule>
  159.  
  160. </Directory>
  161.  
  162. # Spammers are known to attach their stuff and then move it to trash where it remains unnoticed.
  163. # We prevent viewing any attachments directly from pub
  164. <Directory "/var/www/twiki/pub/Trash">
  165.    deny from all
  166. </Directory>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement