radicale.conf 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  1. ### Define how Apache should serve "radicale"
  2. ## !!! Do not enable both at the same time !!!
  3. ## Apache acting as reverse proxy and forward requests via ProxyPass to a running "radicale" server
  4. # SELinux WARNING: To use this correctly, you will need to set:
  5. # setsebool -P httpd_can_network_connect=1
  6. # URI prefix: /radicale
  7. #Define RADICALE_SERVER_REVERSE_PROXY
  8. ## Apache starting WSGI server running with "radicale" application
  9. # MAY CONFLICT with other WSG servers on same system -> use then inside a VirtualHost
  10. # SELinux WARNING: To use this correctly, you will need to set:
  11. # setsebool -P httpd_can_read_write_radicale=1
  12. # URI prefix: /radicale
  13. #Define RADICALE_SERVER_WSGI
  14. ### Extra options
  15. ## Apache starting a dedicated VHOST with SSL without "/radicale" prefix in URI on port 8443
  16. #Define RADICALE_SERVER_VHOST_SSL
  17. ### permit public access to "radicale"
  18. #Define RADICALE_PERMIT_PUBLIC_ACCESS
  19. ### enforce SSL on default host
  20. #Define RADICALE_ENFORCE_SSL
  21. ### enable authentication by web server (config: [auth] type = http_x_remote_user)
  22. #Define RADICALE_SERVER_USER_AUTHENTICATION
  23. ### Particular configuration EXAMPLES, adjust/extend/override to your needs
  24. ##########################
  25. ### default host
  26. ##########################
  27. <IfDefine !RADICALE_SERVER_VHOST_SSL>
  28. ## RADICALE_SERVER_REVERSE_PROXY
  29. <IfDefine RADICALE_SERVER_REVERSE_PROXY>
  30. RewriteEngine On
  31. RewriteRule ^/radicale$ /radicale/ [R,L]
  32. RewriteCond %{REQUEST_METHOD} GET
  33. RewriteRule ^/radicale/$ /radicale/.web/ [R,L]
  34. <LocationMatch "^/radicale/\.web.*>
  35. # Internal WebUI does not need authentication at all
  36. RequestHeader set X-Script-Name /radicale
  37. RequestHeader set X-Forwarded-Port "%{SERVER_PORT}s"
  38. RequestHeader set X-Forwarded-Proto expr=%{REQUEST_SCHEME}
  39. ProxyPass http://localhost:5232/ retry=0
  40. ProxyPassReverse http://localhost:5232/
  41. Require local
  42. <IfDefine RADICALE_PERMIT_PUBLIC_ACCESS>
  43. Require all granted
  44. </IfDefine>
  45. </LocationMatch>
  46. <LocationMatch "^/radicale(?!/\.web)">
  47. RequestHeader set X-Script-Name /radicale
  48. RequestHeader set X-Forwarded-Port "%{SERVER_PORT}s"
  49. RequestHeader set X-Forwarded-Proto expr=%{REQUEST_SCHEME}
  50. ProxyPass http://localhost:5232/ retry=0
  51. ProxyPassReverse http://localhost:5232/
  52. <IfDefine !RADICALE_SERVER_USER_AUTHENTICATION>
  53. ## User authentication handled by "radicale"
  54. Require local
  55. <IfDefine RADICALE_PERMIT_PUBLIC_ACCESS>
  56. Require all granted
  57. </IfDefine>
  58. </IfDefine>
  59. <IfDefine RADICALE_SERVER_USER_AUTHENTICATION>
  60. ## You may want to use apache's authentication (config: [auth] type = http_x_remote_user)
  61. ## e.g. create a new file with a testuser: htpasswd -c -B /etc/httpd/conf/htpasswd-radicale testuser
  62. AuthBasicProvider file
  63. AuthType Basic
  64. AuthName "Enter your credentials"
  65. AuthUserFile /etc/httpd/conf/htpasswd-radicale
  66. AuthGroupFile /dev/null
  67. Require valid-user
  68. RequestHeader set X-Remote-User expr=%{REMOTE_USER}
  69. </IfDefine>
  70. <IfDefine RADICALE_ENFORCE_SSL>
  71. <IfModule !ssl_module>
  72. Error "RADICALE_ENFORCE_SSL selected but ssl module not loaded/enabled"
  73. </IfModule>
  74. SSLRequireSSL
  75. </IfDefine>
  76. </LocationMatch>
  77. </IfDefine>
  78. ## RADICALE_SERVER_WSGI
  79. # For more information, visit:
  80. # http://radicale.org/user_documentation/#idapache-and-mod-wsgi
  81. <IfDefine RADICALE_SERVER_WSGI>
  82. <IfModule wsgi_module>
  83. <Files /usr/share/radicale/radicale.wsgi>
  84. SetHandler wsgi-script
  85. Require local
  86. <IfDefine RADICALE_PERMIT_PUBLIC_ACCESS>
  87. Require all granted
  88. </IfDefine>
  89. </Files>
  90. WSGIDaemonProcess radicale user=radicale group=radicale threads=1 umask=0027
  91. WSGIProcessGroup radicale
  92. WSGIApplicationGroup %{GLOBAL}
  93. WSGIPassAuthorization On
  94. WSGIScriptAlias /radicale /usr/share/radicale/radicale.wsgi
  95. # Internal WebUI does not need authentication at all
  96. <LocationMatch "^/radicale/\.web.*>
  97. RequestHeader set X-Script-Name /radicale
  98. Require local
  99. <IfDefine RADICALE_PERMIT_PUBLIC_ACCESS>
  100. Require all granted
  101. </IfDefine>
  102. </LocationMatch>
  103. <LocationMatch "^/radicale(?!/\.web)">
  104. RequestHeader set X-Script-Name /radicale
  105. <IfDefine !RADICALE_SERVER_USER_AUTHENTICATION>
  106. ## User authentication handled by "radicale"
  107. Require local
  108. <IfDefine RADICALE_PERMIT_PUBLIC_ACCESS>
  109. Require all granted
  110. </IfDefine>
  111. </IfDefine>
  112. <IfDefine RADICALE_SERVER_USER_AUTHENTICATION>
  113. ## You may want to use apache's authentication (config: [auth] type = http_x_remote_user)
  114. ## e.g. create a new file with a testuser: htpasswd -c -B /etc/httpd/conf/htpasswd-radicale testuser
  115. AuthBasicProvider file
  116. AuthType Basic
  117. AuthName "Enter your credentials"
  118. AuthUserFile /etc/httpd/conf/htpasswd-radicale
  119. AuthGroupFile /dev/null
  120. Require valid-user
  121. RequestHeader set X-Remote-User expr=%{REMOTE_USER}
  122. </IfDefine>
  123. <IfDefine RADICALE_ENFORCE_SSL>
  124. <IfModule !ssl_module>
  125. Error "RADICALE_ENFORCE_SSL selected but ssl module not loaded/enabled"
  126. </IfModule>
  127. SSLRequireSSL
  128. </IfDefine>
  129. </LocationMatch>
  130. </IfModule>
  131. <IfModule !wsgi_module>
  132. Error "RADICALE_SERVER_WSGI selected but wsgi module not loaded/enabled"
  133. </IfModule>
  134. </IfDefine>
  135. </IfDefine>
  136. ##########################
  137. ### VHOST with SSL
  138. ##########################
  139. <IfDefine RADICALE_SERVER_VHOST_SSL>
  140. <IfModule ssl_module>
  141. Listen 8443 https
  142. <VirtualHost _default_:8443>
  143. ## taken from ssl.conf
  144. #ServerName www.example.com:443
  145. ErrorLog logs/ssl_error_log
  146. TransferLog logs/ssl_access_log
  147. LogLevel warn
  148. SSLEngine on
  149. SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1
  150. SSLProxyProtocol all -SSLv3 -TLSv1 -TLSv1.1
  151. SSLHonorCipherOrder on
  152. SSLCipherSuite PROFILE=SYSTEM
  153. SSLProxyCipherSuite PROFILE=SYSTEM
  154. SSLCertificateFile /etc/pki/tls/certs/localhost.crt
  155. SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
  156. #SSLCertificateChainFile /etc/pki/tls/certs/server-chain.crt
  157. #SSLCACertificateFile /etc/pki/tls/certs/ca-bundle.crt
  158. #SSLVerifyClient require
  159. #SSLVerifyDepth 10
  160. #SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
  161. BrowserMatch "MSIE [2-5]" \ nokeepalive ssl-unclean-shutdown \ downgrade-1.0 force-response-1.0
  162. CustomLog logs/ssl_request_log "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
  163. ## RADICALE_SERVER_REVERSE_PROXY
  164. <IfDefine RADICALE_SERVER_REVERSE_PROXY>
  165. RewriteEngine On
  166. RewriteCond %{REQUEST_METHOD} GET
  167. RewriteRule ^/$ /.web/ [R,L]
  168. <LocationMatch "^/\.web.*>
  169. RequestHeader set X-Forwarded-Port "%{SERVER_PORT}s"
  170. RequestHeader set X-Forwarded-Proto expr=%{REQUEST_SCHEME}
  171. ProxyPass http://localhost:5232/ retry=0
  172. ProxyPassReverse http://localhost:5232/
  173. Require local
  174. <IfDefine RADICALE_PERMIT_PUBLIC_ACCESS>
  175. Require all granted
  176. </IfDefine>
  177. </LocationMatch>
  178. <LocationMatch "^(?!/\.web)">
  179. RequestHeader set X-Forwarded-Port "%{SERVER_PORT}s"
  180. RequestHeader set X-Forwarded-Proto expr=%{REQUEST_SCHEME}
  181. ProxyPass http://localhost:5232/ retry=0
  182. ProxyPassReverse http://localhost:5232/
  183. <IfDefine !RADICALE_SERVER_USER_AUTHENTICATION>
  184. ## User authentication handled by "radicale"
  185. Require local
  186. <IfDefine RADICALE_PERMIT_PUBLIC_ACCESS>
  187. Require all granted
  188. </IfDefine>
  189. </IfDefine>
  190. <IfDefine RADICALE_SERVER_USER_AUTHENTICATION>
  191. ## You may want to use apache's authentication (config: [auth] type = http_x_remote_user)
  192. ## e.g. create a new file with a testuser: htpasswd -c -B /etc/httpd/conf/htpasswd-radicale testuser
  193. AuthBasicProvider file
  194. AuthType Basic
  195. AuthName "Enter your credentials"
  196. AuthUserFile /etc/httpd/conf/htpasswd-radicale
  197. AuthGroupFile /dev/null
  198. Require valid-user
  199. RequestHeader set X-Remote-User expr=%{REMOTE_USER}
  200. </IfDefine>
  201. </LocationMatch>
  202. </IfDefine>
  203. ## RADICALE_SERVER_WSGI
  204. # For more information, visit:
  205. # http://radicale.org/user_documentation/#idapache-and-mod-wsgi
  206. <IfDefine RADICALE_SERVER_WSGI>
  207. <IfModule wsgi_module>
  208. <Files /usr/share/radicale/radicale.wsgi>
  209. SetHandler wsgi-script
  210. Require local
  211. <IfDefine RADICALE_PERMIT_PUBLIC_ACCESS>
  212. Require all granted
  213. </IfDefine>
  214. </Files>
  215. WSGIDaemonProcess radicale user=radicale group=radicale threads=1 umask=0027
  216. WSGIProcessGroup radicale
  217. WSGIApplicationGroup %{GLOBAL}
  218. WSGIPassAuthorization On
  219. WSGIScriptAlias / /usr/share/radicale/radicale.wsgi
  220. <LocationMatch "^/(?!/\.web)">
  221. <IfDefine !RADICALE_SERVER_USER_AUTHENTICATION>
  222. ## User authentication handled by "radicale"
  223. Require local
  224. <IfDefine RADICALE_PERMIT_PUBLIC_ACCESS>
  225. Require all granted
  226. </IfDefine>
  227. </IfDefine>
  228. <IfDefine RADICALE_SERVER_USER_AUTHENTICATION>
  229. ## You may want to use apache's authentication (config: [auth] type = http_x_remote_user)
  230. ## e.g. create a new file with a testuser: htpasswd -c -B /etc/httpd/conf/htpasswd-radicale testuser
  231. AuthBasicProvider file
  232. AuthType Basic
  233. AuthName "Enter your credentials"
  234. AuthUserFile /etc/httpd/conf/htpasswd-radicale
  235. AuthGroupFile /dev/null
  236. Require valid-user
  237. RequestHeader set X-Remote-User expr=%{REMOTE_USER}
  238. </IfDefine>
  239. </LocationMatch>
  240. </IfModule>
  241. <IfModule !wsgi_module>
  242. Error "RADICALE_SERVER_WSGI selected but wsgi module not loaded/enabled"
  243. </IfModule>
  244. </IfDefine>
  245. </VirtualHost>
  246. </IfModule>
  247. <IfModule !ssl_module>
  248. Error "RADICALE_SERVER_VHOST_SSL selected but ssl module not loaded/enabled"
  249. </IfModule>
  250. </IfDefine>