Apache und DAViCal Problem mit mod_rewrite

Debian macht sich hervorragend als Web- und Mailserver. Schau auch in den " Tipps und Tricks"-Bereich.
Antworten
Benutzeravatar
LeoLinux
Beiträge: 408
Registriert: 24.11.2005 17:58:47
Wohnort: Frankfurt Am Main

Apache und DAViCal Problem mit mod_rewrite

Beitrag von LeoLinux » 22.05.2015 16:01:24

Hi,

ich habe eine voll funktionsfähige DAViCal Installation. Clients können sich über die gewöhnliche URL: https://DAViCal.Hostname.MyDomain.Local ... b]Username[/b]/Collection anmelden und arbeiten. Dabei steht "Collection" stellvertretend für die Bezeichnung des Adressbuchs oder des Kalendernamens. Nun stehe ich vor der Herausforderung, dass Username und Collection via Subdomain anstelle der Ordner mitgeteilt werden muss. An dieser Stelle habe ich auf die mod_rewrite Methode gesetzt, sodass im Hintergrund: https://calendar.username.davical.hostname.mydomain.local zu folgendem übersetzt wird: https://davical.hostname.mydomain.local ... b]username[/b]/collection
Der hierfür verantwortliche Teil der vHosts Konfiguration sieht wiefolgt aus:

Code: Alles auswählen

AcceptPathInfo On

<IfModule mod_fcgid.c>
  FcgidPassHeader Authorization
</IfModule>

<IfModule mod_proxy.c>
  SSLProxyEngine on
  <ifModule mod_rewrite.c>
    <If "(%{SERVER_NAME} =~ m#^.*\..*\.DaviCal\..*$#i)">
      RewriteEngine on
      RewriteCond %{HTTP_HOST} ^(.*)\.(.*)\.(DaviCal\..*)/?(.*) [NC]
      RewriteRule ^(.*)$ https://%3/htdocs/caldav.php/%2/%1/%4 [E=WEBDAV:true,E=REDIRECT_WEBDAV:true,E=REMOTE_USER:%{HTTP:Authorization},NC,QSA,L,P]
    </If>
  </IfModule>
</IfModule>
Leider ist diese Konfiguration noch nicht das Gelbe vom Ei. Meinem httpd-error.log kann ich entnehmen, dass irgendwo ein HTTP Status 405 (Methode nicht erlaubt) verursacht wird.

Code: Alles auswählen

[Thu May 21 20:58:41.533379 2015] [fcgid:warn] [pid 3027:tid 34540181504] [client 192.168.50.101:25960] mod_fcgid: stderr: davical: LOG: :Response status 405 for PUT /htdocs/caldav.php/username/calendar/
[Thu May 21 20:58:41.533439 2015] [fcgid:warn] [pid 3027:tid 34540181504] [client 192.168.50.101:25960] mod_fcgid: stderr: davical: LOG: :***************** Response Header ****************
[Thu May 21 20:58:41.533453 2015] [fcgid:warn] [pid 3027:tid 34540181504] [client 192.168.50.101:25960] mod_fcgid: stderr: davical: LOG: headers:-->Server: 1.1
[Thu May 21 20:58:41.533463 2015] [fcgid:warn] [pid 3027:tid 34540181504] [client 192.168.50.101:25960] mod_fcgid: stderr: davical: LOG: headers:-->DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule
[Thu May 21 20:58:41.533474 2015] [fcgid:warn] [pid 3027:tid 34540181504] [client 192.168.50.101:25960] mod_fcgid: stderr: davical: LOG: headers:-->DAV: extended-mkcol, bind, addressbook, calendar-auto-schedule, calendar-proxy
[Thu May 21 20:58:41.533484 2015] [fcgid:warn] [pid 3027:tid 34540181504] [client 192.168.50.101:25960] mod_fcgid: stderr: davical: LOG: headers:-->X-DAViCal-Version: DAViCal/1.1.2; DB/1.2.11
[Thu May 21 20:58:41.533494 2015] [fcgid:warn] [pid 3027:tid 34540181504] [client 192.168.50.101:25960] mod_fcgid: stderr: davical: LOG: headers:-->Content-type: text/plain; charset="utf-8"
[Thu May 21 20:58:41.533504 2015] [fcgid:warn] [pid 3027:tid 34540181504] [client 192.168.50.101:25960] mod_fcgid: stderr: davical: LOG: :******************** Response ********************
[Thu May 21 20:58:41.533514 2015] [fcgid:warn] [pid 3027:tid 34540181504] [client 192.168.50.101:25960] mod_fcgid: stderr: davical: LOG: response:-->
Lesen und Schreiben ist mit der derzeitigen Konfiguration nicht mehr möglich. Lediglich das Anmelden funktioniert reibungslos. Die URL scheint im Hintergrund korrekt übersetzt worden zu sein. Hat jemand eine Idee woran es liegen könnte, dass der Datenverkehr nicht reibungslos abläuft?
Zuletzt geändert von LeoLinux am 22.05.2015 18:28:01, insgesamt 7-mal geändert.

Benutzeravatar
LeoLinux
Beiträge: 408
Registriert: 24.11.2005 17:58:47
Wohnort: Frankfurt Am Main

Re: Apache und DAViCal Problem mit mod_rewrite

Beitrag von LeoLinux » 22.05.2015 16:02:12

Re-Write debugging nachdem ein neuer Kalender in Thunderbird eingerichtet wurde:

Code: Alles auswählen

cat /usr/local/www/davical.hostname.mydomain.local/logs/httpd-error.log 

[Fri May 22 15:50:48.577071 2015] [rewrite:trace2] [pid 69540:tid 34540184576] mod_rewrite.c(475): [client 192.168.10.233:57662] 192.168.10.233 - - [calendar.username.davical.hostname.mydomain.local/sid#802a19438][rid#80b03e0a0/initial] init rewrite engine with requested uri /
[Fri May 22 15:50:48.577162 2015] [rewrite:trace1] [pid 69540:tid 34540184576] mod_rewrite.c(475): [client 192.168.10.233:57662] 192.168.10.233 - - [calendar.username.davical.hostname.mydomain.local/sid#802a19438][rid#80b03e0a0/initial] pass through /
[Fri May 22 15:50:48.577769 2015] [rewrite:trace3] [pid 69540:tid 34540184576] mod_rewrite.c(475): [client 192.168.10.233:57662] 192.168.10.233 - - [calendar.username.davical.hostname.mydomain.local/sid#802a19438][rid#80b03e0a0/initial] [perdir *If/] applying pattern '^(.*)$' to uri '/usr/local/www/davical.hostname.mydomain.local/sites/'
[Fri May 22 15:50:48.577826 2015] [rewrite:trace2] [pid 69540:tid 34540184576] mod_rewrite.c(475): [client 192.168.10.233:57662] 192.168.10.233 - - [calendar.username.davical.hostname.mydomain.local/sid#802a19438][rid#80b03e0a0/initial] [perdir *If/] rewrite '/usr/local/www/davical.hostname.mydomain.local/sites/' -> 'https://davical.hostname.mydomain.local/htdocs/caldav.php/username/calendar/'
[Fri May 22 15:50:48.577851 2015] [rewrite:trace2] [pid 69540:tid 34540184576] mod_rewrite.c(475): [client 192.168.10.233:57662] 192.168.10.233 - - [calendar.username.davical.hostname.mydomain.local/sid#802a19438][rid#80b03e0a0/initial] [perdir *If/] escaped URI in per-dir context for proxy, https://davical.hostname.mydomain.local/htdocs/caldav.php/username/calendar/ -> https://davical.hostname.mydomain.local/htdocs/caldav.php/username/calendar/
[Fri May 22 15:50:48.577868 2015] [rewrite:trace2] [pid 69540:tid 34540184576] mod_rewrite.c(475): [client 192.168.10.233:57662] 192.168.10.233 - - [calendar.username.davical.hostname.mydomain.local/sid#802a19438][rid#80b03e0a0/initial] [perdir *If/] forcing proxy-throughput with https://davical.hostname.mydomain.local/htdocs/caldav.php/username/calendar/
[Fri May 22 15:50:48.577884 2015] [rewrite:trace1] [pid 69540:tid 34540184576] mod_rewrite.c(475): [client 192.168.10.233:57662] 192.168.10.233 - - [calendar.username.davical.hostname.mydomain.local/sid#802a19438][rid#80b03e0a0/initial] [perdir *If/] go-ahead with proxy request proxy:https://davical.hostname.mydomain.local/htdocs/caldav.php/username/calendar/ [OK]
[Fri May 22 15:50:48.577967 2015] [rewrite:trace2] [pid 69540:tid 34540184576] mod_rewrite.c(475): [client 192.168.10.233:57662] 192.168.10.233 - - [calendar.username.davical.hostname.mydomain.local/sid#802a19438][rid#80b10e0a0/subreq] init rewrite engine with requested uri /index.html
[Fri May 22 15:50:48.577986 2015] [rewrite:trace1] [pid 69540:tid 34540184576] mod_rewrite.c(475): [client 192.168.10.233:57662] 192.168.10.233 - - [calendar.username.davical.hostname.mydomain.local/sid#802a19438][rid#80b10e0a0/subreq] pass through /index.html
[Fri May 22 15:50:48.578261 2015] [rewrite:trace3] [pid 69540:tid 34540184576] mod_rewrite.c(475): [client 192.168.10.233:57662] 192.168.10.233 - - [calendar.username.davical.hostname.mydomain.local/sid#802a19438][rid#80b10e0a0/subreq] [perdir *If/] applying pattern '^(.*)$' to uri '/usr/local/www/davical.hostname.mydomain.local/sites/index.html'
[Fri May 22 15:50:48.578305 2015] [rewrite:trace2] [pid 69540:tid 34540184576] mod_rewrite.c(475): [client 192.168.10.233:57662] 192.168.10.233 - - [calendar.username.davical.hostname.mydomain.local/sid#802a19438][rid#80b10e0a0/subreq] [perdir *If/] rewrite '/usr/local/www/davical.hostname.mydomain.local/sites/index.html' -> 'https://davical.hostname.mydomain.local/htdocs/caldav.php/username/calendar/'
[Fri May 22 15:50:48.578336 2015] [rewrite:trace2] [pid 69540:tid 34540184576] mod_rewrite.c(475): [client 192.168.10.233:57662] 192.168.10.233 - - [calendar.username.davical.hostname.mydomain.local/sid#802a19438][rid#80b10e0a0/subreq] [perdir *If/] escaped URI in per-dir context for proxy, https://davical.hostname.mydomain.local/htdocs/caldav.php/username/calendar/ -> https://davical.hostname.mydomain.local/htdocs/caldav.php/username/calendar/
[Fri May 22 15:50:48.578391 2015] [rewrite:trace2] [pid 69540:tid 34540184576] mod_rewrite.c(475): [client 192.168.10.233:57662] 192.168.10.233 - - [calendar.username.davical.hostname.mydomain.local/sid#802a19438][rid#80b10e0a0/subreq] [perdir *If/] forcing proxy-throughput with https://davical.hostname.mydomain.local/htdocs/caldav.php/username/calendar/
[Fri May 22 15:50:48.578409 2015] [rewrite:trace1] [pid 69540:tid 34540184576] mod_rewrite.c(475): [client 192.168.10.233:57662] 192.168.10.233 - - [calendar.username.davical.hostname.mydomain.local/sid#802a19438][rid#80b10e0a0/subreq] [perdir *If/] go-ahead with proxy request proxy:https://davical.hostname.mydomain.local/htdocs/caldav.php/username/calendar/ [OK]
[Fri May 22 15:50:54.720025 2015] [rewrite:trace2] [pid 69540:tid 34540184576] mod_rewrite.c(475): [client 192.168.10.233:57666] 192.168.10.233 - - [calendar.username.davical.hostname.mydomain.local/sid#802a19438][rid#80b0fc0a0/initial] init rewrite engine with requested uri /
[Fri May 22 15:50:54.720082 2015] [rewrite:trace1] [pid 69540:tid 34540184576] mod_rewrite.c(475): [client 192.168.10.233:57666] 192.168.10.233 - - [calendar.username.davical.hostname.mydomain.local/sid#802a19438][rid#80b0fc0a0/initial] pass through /
[Fri May 22 15:50:54.720640 2015] [rewrite:trace3] [pid 69540:tid 34540184576] mod_rewrite.c(475): [client 192.168.10.233:57666] 192.168.10.233 - - [calendar.username.davical.hostname.mydomain.local/sid#802a19438][rid#80b0fc0a0/initial] [perdir *If/] applying pattern '^(.*)$' to uri '/usr/local/www/davical.hostname.mydomain.local/sites/'
[Fri May 22 15:50:54.720695 2015] [rewrite:trace2] [pid 69540:tid 34540184576] mod_rewrite.c(475): [client 192.168.10.233:57666] 192.168.10.233 - - [calendar.username.davical.hostname.mydomain.local/sid#802a19438][rid#80b0fc0a0/initial] [perdir *If/] rewrite '/usr/local/www/davical.hostname.mydomain.local/sites/' -> 'https://davical.hostname.mydomain.local/htdocs/caldav.php/username/calendar/'
[Fri May 22 15:50:54.720721 2015] [rewrite:trace2] [pid 69540:tid 34540184576] mod_rewrite.c(475): [client 192.168.10.233:57666] 192.168.10.233 - - [calendar.username.davical.hostname.mydomain.local/sid#802a19438][rid#80b0fc0a0/initial] [perdir *If/] escaped URI in per-dir context for proxy, https://davical.hostname.mydomain.local/htdocs/caldav.php/username/calendar/ -> https://davical.hostname.mydomain.local/htdocs/caldav.php/username/calendar/
[Fri May 22 15:50:54.720738 2015] [rewrite:trace2] [pid 69540:tid 34540184576] mod_rewrite.c(475): [client 192.168.10.233:57666] 192.168.10.233 - - [calendar.username.davical.hostname.mydomain.local/sid#802a19438][rid#80b0fc0a0/initial] [perdir *If/] forcing proxy-throughput with https://davical.hostname.mydomain.local/htdocs/caldav.php/username/calendar/
[Fri May 22 15:50:54.720755 2015] [rewrite:trace1] [pid 69540:tid 34540184576] mod_rewrite.c(475): [client 192.168.10.233:57666] 192.168.10.233 - - [calendar.username.davical.hostname.mydomain.local/sid#802a19438][rid#80b0fc0a0/initial] [perdir *If/] go-ahead with proxy request proxy:https://davical.hostname.mydomain.local/htdocs/caldav.php/username/calendar/ [OK]
[Fri May 22 15:50:54.720828 2015] [rewrite:trace2] [pid 69540:tid 34540184576] mod_rewrite.c(475): [client 192.168.10.233:57666] 192.168.10.233 - - [calendar.username.davical.hostname.mydomain.local/sid#802a19438][rid#80b17f0a0/subreq] init rewrite engine with requested uri /index.html
[Fri May 22 15:50:54.720847 2015] [rewrite:trace1] [pid 69540:tid 34540184576] mod_rewrite.c(475): [client 192.168.10.233:57666] 192.168.10.233 - - [calendar.username.davical.hostname.mydomain.local/sid#802a19438][rid#80b17f0a0/subreq] pass through /index.html
[Fri May 22 15:50:54.721113 2015] [rewrite:trace3] [pid 69540:tid 34540184576] mod_rewrite.c(475): [client 192.168.10.233:57666] 192.168.10.233 - - [calendar.username.davical.hostname.mydomain.local/sid#802a19438][rid#80b17f0a0/subreq] [perdir *If/] applying pattern '^(.*)$' to uri '/usr/local/www/davical.hostname.mydomain.local/sites/index.html'
[Fri May 22 15:50:54.721165 2015] [rewrite:trace2] [pid 69540:tid 34540184576] mod_rewrite.c(475): [client 192.168.10.233:57666] 192.168.10.233 - - [calendar.username.davical.hostname.mydomain.local/sid#802a19438][rid#80b17f0a0/subreq] [perdir *If/] rewrite '/usr/local/www/davical.hostname.mydomain.local/sites/index.html' -> 'https://davical.hostname.mydomain.local/htdocs/caldav.php/username/calendar/'
[Fri May 22 15:50:54.721210 2015] [rewrite:trace2] [pid 69540:tid 34540184576] mod_rewrite.c(475): [client 192.168.10.233:57666] 192.168.10.233 - - [calendar.username.davical.hostname.mydomain.local/sid#802a19438][rid#80b17f0a0/subreq] [perdir *If/] escaped URI in per-dir context for proxy, https://davical.hostname.mydomain.local/htdocs/caldav.php/username/calendar/ -> https://davical.hostname.mydomain.local/htdocs/caldav.php/username/calendar/
[Fri May 22 15:50:54.721227 2015] [rewrite:trace2] [pid 69540:tid 34540184576] mod_rewrite.c(475): [client 192.168.10.233:57666] 192.168.10.233 - - [calendar.username.davical.hostname.mydomain.local/sid#802a19438][rid#80b17f0a0/subreq] [perdir *If/] forcing proxy-throughput with https://davical.hostname.mydomain.local/htdocs/caldav.php/username/calendar/
[Fri May 22 15:50:54.721243 2015] [rewrite:trace1] [pid 69540:tid 34540184576] mod_rewrite.c(475): [client 192.168.10.233:57666] 192.168.10.233 - - [calendar.username.davical.hostname.mydomain.local/sid#802a19438][rid#80b17f0a0/subreq] [perdir *If/] go-ahead with proxy request proxy:https://davical.hostname.mydomain.local/htdocs/caldav.php/username/calendar/ [OK]

... und nachdem ein neuer Termin via Thunderbird abgespeichert werden sollte:

Code: Alles auswählen

[Fri May 22 15:55:10.493019 2015] [rewrite:trace2] [pid 80493:tid 34540184576] mod_rewrite.c(475): [client 192.168.10.233:57691] 192.168.10.233 - - [calendar.username.davical.hostname.mydomain.local/sid#802a19438][rid#80b03e0a0/initial] init rewrite engine with requested uri /f64399b7-54e4-ea4b-81aa-8bcb9765b21e.ics
[Fri May 22 15:55:10.493101 2015] [rewrite:trace1] [pid 80493:tid 34540184576] mod_rewrite.c(475): [client 192.168.10.233:57691] 192.168.10.233 - - [calendar.username.davical.hostname.mydomain.local/sid#802a19438][rid#80b03e0a0/initial] pass through /f64399b7-54e4-ea4b-81aa-8bcb9765b21e.ics
[Fri May 22 15:55:10.493656 2015] [rewrite:trace3] [pid 80493:tid 34540184576] mod_rewrite.c(475): [client 192.168.10.233:57691] 192.168.10.233 - - [calendar.username.davical.hostname.mydomain.local/sid#802a19438][rid#80b03e0a0/initial] [perdir *If/] applying pattern '^(.*)$' to uri '/usr/local/www/davical.hostname.mydomain.local/sites/f64399b7-54e4-ea4b-81aa-8bcb9765b21e.ics'
[Fri May 22 15:55:10.493710 2015] [rewrite:trace2] [pid 80493:tid 34540184576] mod_rewrite.c(475): [client 192.168.10.233:57691] 192.168.10.233 - - [calendar.username.davical.hostname.mydomain.local/sid#802a19438][rid#80b03e0a0/initial] [perdir *If/] rewrite '/usr/local/www/davical.hostname.mydomain.local/sites/f64399b7-54e4-ea4b-81aa-8bcb9765b21e.ics' -> 'https://davical.hostname.mydomain.local/htdocs/caldav.php/username/calendar/'
[Fri May 22 15:55:10.493736 2015] [rewrite:trace2] [pid 80493:tid 34540184576] mod_rewrite.c(475): [client 192.168.10.233:57691] 192.168.10.233 - - [calendar.username.davical.hostname.mydomain.local/sid#802a19438][rid#80b03e0a0/initial] [perdir *If/] escaped URI in per-dir context for proxy, https://davical.hostname.mydomain.local/htdocs/caldav.php/username/calendar/ -> https://davical.hostname.mydomain.local/htdocs/caldav.php/username/calendar/
[Fri May 22 15:55:10.493752 2015] [rewrite:trace2] [pid 80493:tid 34540184576] mod_rewrite.c(475): [client 192.168.10.233:57691] 192.168.10.233 - - [calendar.username.davical.hostname.mydomain.local/sid#802a19438][rid#80b03e0a0/initial] [perdir *If/] forcing proxy-throughput with https://davical.hostname.mydomain.local/htdocs/caldav.php/username/calendar/
[Fri May 22 15:55:10.493768 2015] [rewrite:trace1] [pid 80493:tid 34540184576] mod_rewrite.c(475): [client 192.168.10.233:57691] 192.168.10.233 - - [calendar.username.davical.hostname.mydomain.local/sid#802a19438][rid#80b03e0a0/initial] [perdir *If/] go-ahead with proxy request proxy:https://davical.hostname.mydomain.local/htdocs/caldav.php/username/calendar/ [OK]
[Fri May 22 15:55:11.064046 2015] [fcgid:warn] [pid 80494:tid 34540184576] [client 192.168.50.101:38438] mod_fcgid: stderr: davical: LOG: :Response status 405 for PUT /htdocs/caldav.php/username/calendar/
[Fri May 22 15:55:11.064155 2015] [fcgid:warn] [pid 80494:tid 34540184576] [client 192.168.50.101:38438] mod_fcgid: stderr: davical: LOG: :***************** Response Header ****************
[Fri May 22 15:55:11.064168 2015] [fcgid:warn] [pid 80494:tid 34540184576] [client 192.168.50.101:38438] mod_fcgid: stderr: davical: LOG: headers:-->Server: 1.1
[Fri May 22 15:55:11.064179 2015] [fcgid:warn] [pid 80494:tid 34540184576] [client 192.168.50.101:38438] mod_fcgid: stderr: davical: LOG: headers:-->DAV: 1, 2, 3, access-control, calendar-access, calendar-schedule
[Fri May 22 15:55:11.064190 2015] [fcgid:warn] [pid 80494:tid 34540184576] [client 192.168.50.101:38438] mod_fcgid: stderr: davical: LOG: headers:-->DAV: extended-mkcol, bind, addressbook, calendar-auto-schedule, calendar-proxy
[Fri May 22 15:55:11.064200 2015] [fcgid:warn] [pid 80494:tid 34540184576] [client 192.168.50.101:38438] mod_fcgid: stderr: davical: LOG: headers:-->X-DAViCal-Version: DAViCal/1.1.2; DB/1.2.11
[Fri May 22 15:55:11.064211 2015] [fcgid:warn] [pid 80494:tid 34540184576] [client 192.168.50.101:38438] mod_fcgid: stderr: davical: LOG: headers:-->Content-type: text/plain; charset="utf-8"
[Fri May 22 15:55:11.064221 2015] [fcgid:warn] [pid 80494:tid 34540184576] [client 192.168.50.101:38438] mod_fcgid: stderr: davical: LOG: :******************** Response ********************
[Fri May 22 15:55:11.064267 2015] [fcgid:warn] [pid 80494:tid 34540184576] [client 192.168.50.101:38438] mod_fcgid: stderr: davical: LOG: response:-->

Antworten