Advertisement
Guest User

Untitled

a guest
Sep 17th, 2015
20
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.06 KB | None | 0 0
  1. # Autogenerated httpd.conf file for Foswiki.
  2. # Generated at http://foswiki.org/Support/ApacheConfigGenerator?vhost=foswiki.local;port=;dir=/var/www/foswiki;symlink=on;pathurl=/;shorterurls=enabled;engine=FastCGI;fastcgimodule=fcgid;fcgidreqlen=10000000;apver=2;allowconf=127.0.0.1;requireconf=admin;loginmanager=Template;htpath=;errordocument=UserRegistration;errorcustom=;phpinstalled=PHP4;blockpubhtml=;blocktrashpub=;controlattach=;blockspiders=;foswikiversion=1.1;timeout=30
  3.  
  4. # For Foswiki version 1.1
  5.  
  6. <VirtualHost *>
  7. ServerAdmin webmaster@foswiki.local
  8. DocumentRoot "/var/www/foswiki"
  9. ServerName foswiki.local
  10. ServerAlias www.foswiki.local # Optional. Add to list of redirect hosts in bin/configure
  11.  
  12. TimeOut 30
  13.  
  14. # The Alias defines a url that points to the root of the Foswiki installation.
  15. # The first parameter will be part of the URL to your installation e.g.
  16. # http://my.co.uk/foswiki/bin/view/...
  17. # The second parameter must point to the physical path on your disc.
  18.  
  19. Alias /bin/custom "/var/www/foswiki/bin/custom"
  20. Alias /bin "/var/www/foswiki/bin/foswiki.fcgi"
  21.  
  22. # The following Alias is used to access files in the pub directory (attachments etc)
  23. # It must come _after_ the ScriptAlias.
  24. # If short URLs are enabled, and any other local directories or files need to be accessed directly, they
  25. # must also be specified in an Alias statement, and must not conflict with a web name.
  26.  
  27. Alias /pub "/var/www/foswiki/pub"
  28. Alias /robots.txt "/var/www/foswiki/robots.txt"
  29.  
  30. # Rewriting is required for Short URLs, and Attachment redirecting to viewfile
  31. RewriteEngine on
  32. #RewriteLog "/var/log/apache/rewrite.log"
  33. #RewriteLogLevel 0
  34.  
  35. # short urls
  36. Alias / "/var/www/foswiki/bin/foswiki.fcgi/"
  37. RewriteRule ^/+bin/+view/+(.*) /$1 [L,NE,R]
  38. RewriteRule ^/+bin/+view$ / [L,NE,R]
  39.  
  40. # This enables access to the documents in the Foswiki root directory
  41. <Directory "/var/www/foswiki">
  42. Order Allow,Deny
  43. Allow from all
  44. Deny from env=blockAccess
  45. </Directory>
  46.  
  47. <IfModule mod_fcgid.c>
  48. DefaultMaxClassProcessCount 3
  49. # Set Busy and IO Timeout long enough to prevent server errors for long
  50. # searches and other complex wiki applications.
  51. FcgidBusyTimeout 30
  52. FcgidIOTimeout 30
  53. FcgidMaxRequestLen 10000000
  54.  
  55. # Refer to details at http://fastcgi.coremail.cn/doc.htm
  56. </IfModule>
  57.  
  58. # This specifies the options on the Foswiki scripts directory. The ExecCGI
  59. # and SetHandler tell apache that it contains scripts. "Allow from all"
  60. # lets any IP address access this URL.
  61. # Note: If you use SELinux, you also have to "Allow httpd cgi support" in your SELinux policies
  62.  
  63. <Directory "/var/www/foswiki/bin">
  64. AllowOverride None
  65. Order Allow,Deny
  66. Allow from all
  67. Deny from env=blockAccess
  68.  
  69. Options +ExecCGI +FollowSymLinks
  70. SetHandler cgi-script
  71. <Files "foswiki.fcgi">
  72. SetHandler fcgid-script
  73. </Files>
  74.  
  75. # Password file for Foswiki users
  76. AuthUserFile "/var/www/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
  79.  
  80. # File to return on access control error (e.g. wrong password)
  81. ErrorDocument 401 /System/UserRegistration
  82.  
  83. </Directory>
  84.  
  85. # This sets the options on the pub directory, which contains attachments and
  86. # other files like CSS stylesheets and icons. AllowOverride None stops a
  87. # user installing a .htaccess file that overrides these options.
  88. # Note that files in pub are *not* protected by Foswiki Access Controls,
  89. # so if you want to control access to files attached to topics you need to
  90. # block access to the specific directories same way as the ApacheConfigGenerator
  91. # blocks access to the pub directory of the Trash web
  92. <Directory "/var/www/foswiki/pub">
  93. Options None
  94. Options +FollowSymLinks
  95. AllowOverride None
  96. Order Allow,Deny
  97. Allow from all
  98. Deny from env=blockAccess
  99. ErrorDocument 404 /bin/viewfile
  100.  
  101. # Disable execution of PHP scripts
  102. <ifmodule mod_php3.c>
  103. php3_engine off
  104. </ifmodule>
  105. <ifmodule mod_php4.c>
  106. php_admin_flag engine off
  107. </ifmodule>
  108. <ifmodule mod_php5.c>
  109. php_admin_flag engine off
  110. </ifmodule>
  111.  
  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
  114. #
  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. <ifmodule mod_expires.c>
  121. <filesmatch "\.(jpe?g|gif|png|css(\.gz)?|js(\.gz)?|ico)$">
  122. ExpiresActive on
  123. ExpiresDefault "access plus 11 days"
  124. </filesmatch>
  125. </ifmodule>
  126. #
  127. # Serve pre-compressed versions of .js and .css files, if they exist
  128. # Some browsers do not handle this correctly, which is why it is disabled by default
  129. <FilesMatch "\.(js|css)$">
  130. RewriteEngine on
  131. RewriteCond %{HTTP:Accept-encoding} gzip
  132. RewriteCond %{REQUEST_FILENAME}.gz -f
  133. RewriteRule ^(.*)$ %{REQUEST_URI}.gz [L,QSA]
  134. </FilesMatch>
  135. <FilesMatch "\.(js|css)\?.*$">
  136. RewriteEngine on
  137. RewriteCond %{HTTP:Accept-encoding} gzip
  138. RewriteCond %{REQUEST_FILENAME}.gz -f
  139. RewriteRule ^([^?]*)\?(.*)$ $1.gz?$2 [L]
  140. </FilesMatch>
  141. <FilesMatch "\.js\.gz(\?.*)?$">
  142. AddEncoding x-gzip .gz
  143. AddType application/x-javascript .gz
  144. </FilesMatch>
  145. <FilesMatch "\.css\.gz(\?.*)?$">
  146. AddEncoding x-gzip .gz
  147. AddType text/css .gz
  148. </FilesMatch>
  149.  
  150. </Directory>
  151.  
  152. # Security note: All other directories should be set so
  153. # that they are *not* visible as URLs, so we set them as =deny from all=.
  154. <Directory "/var/www/foswiki/data">
  155. deny from all
  156. </Directory>
  157.  
  158. <Directory "/var/www/foswiki/templates">
  159. deny from all
  160. </Directory>
  161.  
  162. <Directory "/var/www/foswiki/lib">
  163. deny from all
  164. </Directory>
  165.  
  166. <Directory "/var/www/foswiki/locale">
  167. deny from all
  168. </Directory>
  169.  
  170. <Directory "/var/www/foswiki/tools">
  171. deny from all
  172. </Directory>
  173.  
  174. <Directory "/var/www/foswiki/working">
  175. deny from all
  176. </Directory>
  177.  
  178. # We set an environment variable called blockAccess.
  179. #
  180. # Setting a BrowserMatchNoCase to ^$ is important. It prevents Foswiki from
  181. # including its own topics as URLs and also prevents other Foswikis from
  182. # doing the same. This is important to prevent the most obvious
  183. # Denial of Service attacks.
  184. #
  185. # You can expand this by adding more BrowserMatchNoCase statements to
  186. # block evil browser agents trying to crawl your Foswiki
  187. #
  188. # Example:
  189. # BrowserMatchNoCase ^SiteSucker blockAccess
  190. # BrowserMatchNoCase ^$ blockAccess
  191.  
  192. BrowserMatchNoCase ^$ blockAccess
  193.  
  194. </VirtualHost>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement