radicale.conf 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  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. <IfVersion >= 2.4.40>
  42. Proxy100Continue Off
  43. </IfVersion>
  44. Require local
  45. <IfDefine RADICALE_PERMIT_PUBLIC_ACCESS>
  46. Require all granted
  47. </IfDefine>
  48. </LocationMatch>
  49. <LocationMatch "^/radicale(?!/\.web)">
  50. RequestHeader set X-Script-Name /radicale
  51. RequestHeader set X-Forwarded-Port "%{SERVER_PORT}s"
  52. RequestHeader set X-Forwarded-Proto expr=%{REQUEST_SCHEME}
  53. ProxyPass http://localhost:5232/ retry=0
  54. ProxyPassReverse http://localhost:5232/
  55. <IfVersion >= 2.4.40>
  56. Proxy100Continue Off
  57. </IfVersion>
  58. <IfDefine !RADICALE_SERVER_USER_AUTHENTICATION>
  59. ## User authentication handled by "radicale"
  60. Require local
  61. <IfDefine RADICALE_PERMIT_PUBLIC_ACCESS>
  62. Require all granted
  63. </IfDefine>
  64. </IfDefine>
  65. <IfDefine RADICALE_SERVER_USER_AUTHENTICATION>
  66. ## You may want to use apache's authentication (config: [auth] type = http_x_remote_user)
  67. ## e.g. create a new file with a testuser: htpasswd -c -B /etc/httpd/conf/htpasswd-radicale testuser
  68. AuthBasicProvider file
  69. AuthType Basic
  70. AuthName "Enter your credentials"
  71. AuthUserFile /etc/httpd/conf/htpasswd-radicale
  72. AuthGroupFile /dev/null
  73. Require valid-user
  74. RequestHeader set X-Remote-User expr=%{REMOTE_USER}
  75. </IfDefine>
  76. <IfDefine RADICALE_ENFORCE_SSL>
  77. <IfModule !ssl_module>
  78. Error "RADICALE_ENFORCE_SSL selected but ssl module not loaded/enabled"
  79. </IfModule>
  80. SSLRequireSSL
  81. </IfDefine>
  82. </LocationMatch>
  83. </IfDefine>
  84. ## RADICALE_SERVER_WSGI
  85. # For more information, visit:
  86. # http://radicale.org/user_documentation/#idapache-and-mod-wsgi
  87. <IfDefine RADICALE_SERVER_WSGI>
  88. <IfModule wsgi_module>
  89. <Files /usr/share/radicale/radicale.wsgi>
  90. SetHandler wsgi-script
  91. Require local
  92. <IfDefine RADICALE_PERMIT_PUBLIC_ACCESS>
  93. Require all granted
  94. </IfDefine>
  95. </Files>
  96. WSGIDaemonProcess radicale user=radicale group=radicale threads=1 umask=0027
  97. WSGIProcessGroup radicale
  98. WSGIApplicationGroup %{GLOBAL}
  99. WSGIPassAuthorization On
  100. WSGIScriptAlias /radicale /usr/share/radicale/radicale.wsgi
  101. # Internal WebUI does not need authentication at all
  102. <LocationMatch "^/radicale/\.web.*>
  103. RequestHeader set X-Script-Name /radicale
  104. Require local
  105. <IfDefine RADICALE_PERMIT_PUBLIC_ACCESS>
  106. Require all granted
  107. </IfDefine>
  108. </LocationMatch>
  109. <LocationMatch "^/radicale(?!/\.web)">
  110. RequestHeader set X-Script-Name /radicale
  111. <IfDefine !RADICALE_SERVER_USER_AUTHENTICATION>
  112. ## User authentication handled by "radicale"
  113. Require local
  114. <IfDefine RADICALE_PERMIT_PUBLIC_ACCESS>
  115. Require all granted
  116. </IfDefine>
  117. </IfDefine>
  118. <IfDefine RADICALE_SERVER_USER_AUTHENTICATION>
  119. ## You may want to use apache's authentication (config: [auth] type = http_x_remote_user)
  120. ## e.g. create a new file with a testuser: htpasswd -c -B /etc/httpd/conf/htpasswd-radicale testuser
  121. AuthBasicProvider file
  122. AuthType Basic
  123. AuthName "Enter your credentials"
  124. AuthUserFile /etc/httpd/conf/htpasswd-radicale
  125. AuthGroupFile /dev/null
  126. Require valid-user
  127. RequestHeader set X-Remote-User expr=%{REMOTE_USER}
  128. </IfDefine>
  129. <IfDefine RADICALE_ENFORCE_SSL>
  130. <IfModule !ssl_module>
  131. Error "RADICALE_ENFORCE_SSL selected but ssl module not loaded/enabled"
  132. </IfModule>
  133. SSLRequireSSL
  134. </IfDefine>
  135. </LocationMatch>
  136. </IfModule>
  137. <IfModule !wsgi_module>
  138. Error "RADICALE_SERVER_WSGI selected but wsgi module not loaded/enabled"
  139. </IfModule>
  140. </IfDefine>
  141. </IfDefine>
  142. ##########################
  143. ### VHOST with SSL
  144. ##########################
  145. <IfDefine RADICALE_SERVER_VHOST_SSL>
  146. <IfModule ssl_module>
  147. Listen 8443 https
  148. <VirtualHost _default_:8443>
  149. ## taken from ssl.conf
  150. #ServerName www.example.com:443
  151. ErrorLog logs/ssl_error_log
  152. TransferLog logs/ssl_access_log
  153. LogLevel warn
  154. SSLEngine on
  155. SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1
  156. SSLProxyProtocol all -SSLv3 -TLSv1 -TLSv1.1
  157. SSLHonorCipherOrder on
  158. SSLCipherSuite PROFILE=SYSTEM
  159. SSLProxyCipherSuite PROFILE=SYSTEM
  160. SSLCertificateFile /etc/pki/tls/certs/localhost.crt
  161. SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
  162. #SSLCertificateChainFile /etc/pki/tls/certs/server-chain.crt
  163. #SSLCACertificateFile /etc/pki/tls/certs/ca-bundle.crt
  164. #SSLVerifyClient require
  165. #SSLVerifyDepth 10
  166. #SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
  167. BrowserMatch "MSIE [2-5]" \ nokeepalive ssl-unclean-shutdown \ downgrade-1.0 force-response-1.0
  168. CustomLog logs/ssl_request_log "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
  169. ## RADICALE_SERVER_REVERSE_PROXY
  170. <IfDefine RADICALE_SERVER_REVERSE_PROXY>
  171. RewriteEngine On
  172. RewriteCond %{REQUEST_METHOD} GET
  173. RewriteRule ^/$ /.web/ [R,L]
  174. <LocationMatch "^/\.web.*>
  175. RequestHeader set X-Forwarded-Port "%{SERVER_PORT}s"
  176. RequestHeader set X-Forwarded-Proto expr=%{REQUEST_SCHEME}
  177. ProxyPass http://localhost:5232/ retry=0
  178. ProxyPassReverse http://localhost:5232/
  179. <IfVersion >= 2.4.40>
  180. Proxy100Continue Off
  181. </IfVersion>
  182. Require local
  183. <IfDefine RADICALE_PERMIT_PUBLIC_ACCESS>
  184. Require all granted
  185. </IfDefine>
  186. </LocationMatch>
  187. <LocationMatch "^(?!/\.web)">
  188. RequestHeader set X-Forwarded-Port "%{SERVER_PORT}s"
  189. RequestHeader set X-Forwarded-Proto expr=%{REQUEST_SCHEME}
  190. ProxyPass http://localhost:5232/ retry=0
  191. ProxyPassReverse http://localhost:5232/
  192. <IfVersion >= 2.4.40>
  193. Proxy100Continue Off
  194. </IfVersion>
  195. <IfDefine !RADICALE_SERVER_USER_AUTHENTICATION>
  196. ## User authentication handled by "radicale"
  197. Require local
  198. <IfDefine RADICALE_PERMIT_PUBLIC_ACCESS>
  199. Require all granted
  200. </IfDefine>
  201. </IfDefine>
  202. <IfDefine RADICALE_SERVER_USER_AUTHENTICATION>
  203. ## You may want to use apache's authentication (config: [auth] type = http_x_remote_user)
  204. ## e.g. create a new file with a testuser: htpasswd -c -B /etc/httpd/conf/htpasswd-radicale testuser
  205. AuthBasicProvider file
  206. AuthType Basic
  207. AuthName "Enter your credentials"
  208. AuthUserFile /etc/httpd/conf/htpasswd-radicale
  209. AuthGroupFile /dev/null
  210. Require valid-user
  211. RequestHeader set X-Remote-User expr=%{REMOTE_USER}
  212. </IfDefine>
  213. </LocationMatch>
  214. </IfDefine>
  215. ## RADICALE_SERVER_WSGI
  216. # For more information, visit:
  217. # http://radicale.org/user_documentation/#idapache-and-mod-wsgi
  218. <IfDefine RADICALE_SERVER_WSGI>
  219. <IfModule wsgi_module>
  220. <Files /usr/share/radicale/radicale.wsgi>
  221. SetHandler wsgi-script
  222. Require local
  223. <IfDefine RADICALE_PERMIT_PUBLIC_ACCESS>
  224. Require all granted
  225. </IfDefine>
  226. </Files>
  227. WSGIDaemonProcess radicale user=radicale group=radicale threads=1 umask=0027
  228. WSGIProcessGroup radicale
  229. WSGIApplicationGroup %{GLOBAL}
  230. WSGIPassAuthorization On
  231. WSGIScriptAlias / /usr/share/radicale/radicale.wsgi
  232. <LocationMatch "^/(?!/\.web)">
  233. <IfDefine !RADICALE_SERVER_USER_AUTHENTICATION>
  234. ## User authentication handled by "radicale"
  235. Require local
  236. <IfDefine RADICALE_PERMIT_PUBLIC_ACCESS>
  237. Require all granted
  238. </IfDefine>
  239. </IfDefine>
  240. <IfDefine RADICALE_SERVER_USER_AUTHENTICATION>
  241. ## You may want to use apache's authentication (config: [auth] type = http_x_remote_user)
  242. ## e.g. create a new file with a testuser: htpasswd -c -B /etc/httpd/conf/htpasswd-radicale testuser
  243. AuthBasicProvider file
  244. AuthType Basic
  245. AuthName "Enter your credentials"
  246. AuthUserFile /etc/httpd/conf/htpasswd-radicale
  247. AuthGroupFile /dev/null
  248. Require valid-user
  249. RequestHeader set X-Remote-User expr=%{REMOTE_USER}
  250. </IfDefine>
  251. </LocationMatch>
  252. </IfModule>
  253. <IfModule !wsgi_module>
  254. Error "RADICALE_SERVER_WSGI selected but wsgi module not loaded/enabled"
  255. </IfModule>
  256. </IfDefine>
  257. </VirtualHost>
  258. </IfModule>
  259. <IfModule !ssl_module>
  260. Error "RADICALE_SERVER_VHOST_SSL selected but ssl module not loaded/enabled"
  261. </IfModule>
  262. </IfDefine>