merecat.conf 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. ## /etc/merecat.conf -*-conf-unix-*-
  2. ## This is a sample configuration file for Merecat httpd
  3. ## For more help and more settings, see merecat.conf(5).
  4. ##
  5. ## what interface to bind to?
  6. ## (default is binding to any interface)
  7. hostname = 127.0.0.1
  8. ## Port to listen to, overrides command line argument
  9. ## Defaults to 80, or 443 when enabling HTTPS
  10. #port = 80
  11. ## Unpriviliged user to run as, usually nobody or www-data
  12. username = nobody
  13. ## Global .htpasswd (true) or local per-directory (false)
  14. global-passwd = false
  15. ## Chrooting is a security measure which means isolating the webserver's
  16. ## access to files only available from a the given directory. To access
  17. ## files outside the chroot the administrator can either copy or bind
  18. ## mount files and directories into the chroot.
  19. chroot = false
  20. ## Only useful if not chrooting
  21. check-symlinks = false
  22. ## Alt. charset=iso-8859-1
  23. charset = UTF-8
  24. ## Deflate (gzip) compression level: -1 .. 9
  25. ## -1: Default (zlib's reasonable default, currently 6)
  26. ## 0: Disabled
  27. ## 1: Best speed
  28. ## 9: Best compression
  29. compression-level = -1
  30. ## Webserver document root, or chroot
  31. directory = /var/merecat/www
  32. ## When chrooting, alt. document root inside chroot
  33. ## => /var/www/htdocs
  34. data-directory = /htdocs
  35. ## Skip dotfiles in dirlistings
  36. list-dotfiles = false
  37. ## Virtual hosting
  38. ## /var/www/cgi-bin/ <-- Shared CGI
  39. ## /var/www/git.example.com <-- git.example.com
  40. ## /var/www/ftp.example.com <-- ftp.example.com
  41. virtual-host = false
  42. ## Control the caching, in seconds, by setting the following header for
  43. ## all transactions. Depends heavily on the content you provide, and
  44. ## this global setting is disabled by default. It is recommended to
  45. ## instead set it per server location, e.g. for all image files.
  46. ##
  47. ## Cache-Control: max-age=SEC
  48. ##
  49. ## Min max-age value 0 (browser caching disabled)
  50. ## Max max-age value 31536000 (1 year)
  51. ##
  52. max-age = 3600
  53. ## Some bots behave really badly and may overload your server. Often
  54. ## they cannot be blocked based on IP address, so the only means we are
  55. ## left with is User-Agent blocking. Use patterns like this:
  56. user-agent-deny = "**SemrushBot**|**MJ12bot**|**DotBot**|**PetalBot**"
  57. ## Enable HTTPS support. The certificate (public) and key (private) are
  58. ## required when enabling HTTPS support. The (min) protocol and cipher
  59. ## settings are optional and have sane built-in defaults, e.g. 'protocol'
  60. ## defaults to TLSv1.1. See ciphers(1) man page for possible values.
  61. ##
  62. ## Note: You may want to enable this on a per-server basis instead.
  63. #ssl {
  64. # protocol = "TLSv1.1"
  65. # ciphers = "..."
  66. # certfile = certs/cert.pem
  67. # keyfile = private/key.pem
  68. # dhfile = certs/dhparam.pem
  69. #}
  70. ## The CGI module is a core part of Merecat httpd and is for security
  71. ## reasons disabled by default. Like other modules it uses pattern
  72. ## matching to trigger the CGI functionality:
  73. ## ? match a single char
  74. ## * matches any string excluding "/"
  75. ## ** matches any string including "/"
  76. ## separate multiple patterns with "|"
  77. ## Example: "**.sh|**.cgi"
  78. ##
  79. ## `limit` sets the max number of simultaneous CGI programs allowed.
  80. ##
  81. ## The below values are the default, so to enable CGI only `enabled`
  82. ## need to be set to 'true'.
  83. #cgi "**.cgi|/cgi-bin/*" {
  84. # enabled = false
  85. # limit = 50
  86. #}
  87. ## The PHP module is bolted on top of the CGI module, so the same limits
  88. ## apply also to PHP scripts. The below are the built-in defaults.
  89. ## Verify the path to the php-cgi binary for your system and expand on
  90. ## the pattern if you have, e.g. .php5 files.
  91. php "**.php*" {
  92. enabled = true
  93. cgi-path = "/usr/bin/php-cgi"
  94. }
  95. ## The SSI module, like PHP above, is built on top of the CGI module,
  96. ## and it also requires the Merecat SSI CGI script to be installed, the
  97. ## defaults are commented out below. The silent setting controls the
  98. ## default <!--#config errmsg="..." --> value.
  99. #ssi "**.shtml" {
  100. # enabled = false
  101. # silent = false
  102. # cgi-path = "cgi-bin/ssi"
  103. #}
  104. ## Server specific settings, overrides certain global settings
  105. ## Notice the HTTP redirect from the default server to HTTPS.
  106. server default {
  107. port = 80
  108. redirect "/**" {
  109. code = 301
  110. location = "https://$host$request_uri$args"
  111. }
  112. }
  113. server secure {
  114. port = 443
  115. ssl {
  116. certfile = /var/merecat/www/certs/server.pem
  117. keyfile = /var/merecat/www/private/server.key
  118. dhfile = /var/merecat/www/certs/dhparm.pem
  119. }
  120. }