Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: DAViCal: General

Davical migration - "PHP calendar extensions available : Fail" with lighttpd fastcgi

 

 

DAViCal general RSS feed   Index | Next | Previous | View Threaded


aggibson at cogeco

Feb 22, 2012, 1:37 PM

Post #1 of 3 (975 views)
Permalink
Davical migration - "PHP calendar extensions available : Fail" with lighttpd fastcgi

Hi All,

due to hardware failure, I am trying to migrate my home Davical server
from Fedora 14 i386 to ArchLinux ARM

To avoid simplicity, besides the migration from i386 to ARM, the web
server is changing from Apache to Lighty with FastCGI. :-)

Having restored the database and set up Lighty, I can access the admin
pages and list the users, etc. demonstrating basic web-server
functionlity and connection to the database. Unfortunately, calendar
clients (iPhone, Lightning) cannot access the calendar data.

setup.php confirms all of the dependencies except "PHP calendar
extensions : Fail"

Lighty access log has several entries for "PROPFIND
/caldav.php/drew/home" with a "401" response.

So, an authentication issue?

I understand that fastcgi does not pass all the headers through by
default, specifically "Authorization".
http://wiki.davical.org/w/FastCGI suggests adding "-pass-header
AUTHORIZATION" to the fcgi command. This does not work, the web server
does not respond at all. Latest attempt, inspired by other fastcgi
documents, was to try and pass an environment variable (
"PHP_FCGI_PASSHEADER" => "Authorization" ) but I'm back to 401 errors.

I'm not sure that this is required or in the proper format for ArchLinux
Lighty's FastCGI, does anyone have this working?

I think I'm going in circles trying to fix this problem. Is there anyone
running Davical on Lighty with FastCGI who can advise on the next steps
to debug?

config and version details below ....

regards,

Drew


software versions were:
Fedora 14 on i386
postgresql 8.4.9
Apache 2.2
awl 0.43
davical 0.9.9
php 5.3.3

and are now:
Archlinux ARM on Pogoplug
postgresql 9.1
Lighttpd 1.4.30-3
awl 0.51-1 (from ArchLinux AUR)
davical 1.0.2-3 (from ArchLinux AUR)
php-cgi 5.3.10-4

All the postgres db's were dumped from postgresql 8.4.9 on Fedora 14 and
restored to postgresql 9.1 on ArchLinux ARM without issue.

The davical_dba password was changed at the psql command line and the
davical_dba username/password set in .pgpass.
"update-davical-database" was run with the following result:

The database is version 9.1 currently at revision 1.2.8.
Applying patch 1.2.9.sql ... succeeded.
Applying patch 1.2.10.sql ... succeeded.
Applying patch 1.2.11.sql ... succeeded.
Successfully applied 3 patches.
Supported locales updated.
Updated view: dav_principal.sql applied.
CalDAV functions updated.
RRULE functions updated.
WARNING: no privileges were granted for "dav_id_seq"
WARNING: no privileges were granted for "dav_id_seq"
Database permissions updated

Ran psql and executed "ALTER SEQUENCE dav_id_seq OWNER TO davical_dba;"
Ran "update-davical-database" with the following result:

The database is version 9.1 currently at revision 1.2.11.
No patches were applied.
Supported locales updated.
Updated view: dav_principal.sql applied.
CalDAV functions updated.
RRULE functions updated.
Database permissions updated.

/etc/davical config files were restored from original:

<?php
// $c->domain_name = "alarm-1.example.ca";
// $c->sysabbr = 'DAViCal';
// $c->admin_email = 'me [at] example';
// $c->system_name = "DAViCal Server";
// $c->enable_row_linking = true;

$c->pg_connect[] = 'dbname=davical port=5432 user=davical_app';

phpinfo() confirms:-

include_path /usr/share/awl/inc
open_basedir /srv/http/davical:/usr/share/awl/inc:/etc/davical

/etc/php/php.ini does contain:

extension=gettext.so
extension=iconv.so
extension=pdo_pgsql.so
extension=pgsql.so

The lighttpd vhost config entry for fastcgi is currently:

fastcgi.server = ( ".php" =>
( "php-local" =>
(
"fastcgi.debug" => 1,
"socket" => socket_dir + "/php-fastcgi-1.socket",
"bin-path" => "/usr/bin/php-cgi -c
/etc/php/php.ini",
"min-procs" => 1,
"max-procs" => 10,
"broken-scriptfilename" => "enable",
"bin-environment" => ( "PHP_FCGI_PASSHEADER"
=> "Authorization" )
)
),
)





------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Davical-general mailing list
Davical-general [at] lists
https://lists.sourceforge.net/lists/listinfo/davical-general


mir at datanom

Feb 22, 2012, 2:46 PM

Post #2 of 3 (907 views)
Permalink
Re: Davical migration - "PHP calendar extensions available : Fail" with lighttpd fastcgi [In reply to]

On Wed, 22 Feb 2012 16:37:17 -0500
Drew Gibson <aggibson [at] cogeco> wrote:

> "PHP_FCGI_PASSHEADER" => "Authorization" ) but I'm back to 401 errors.
>
I think this needs to be done manually:
add_header "DAV" "1, 2, 3, access-control, calendar-access,
calendar-schedule, extended-mkcol, calendar-proxy, bind, addressbook,
calendar-auto-schedule"
add_header "Content-Type" 'text/calendar; charset="utf-8"'


--
Hilsen/Regards
Michael Rasmussen

Get my public GnuPG keys:
michael <at> rasmussen <dot> cc
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xD3C9A00E
mir <at> datanom <dot> net
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xE501F51C
mir <at> miras <dot> org
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xE3E80917
--------------------------------------------------------------
Attachments: signature.asc (0.19 KB)


aggibson at cogeco

Mar 1, 2012, 7:35 PM

Post #3 of 3 (898 views)
Permalink
Re: Davical migration - "PHP calendar extensions available : Fail" with lighttpd fastcgi [In reply to]

Michael Rasmussen wrote:
> On Wed, 22 Feb 2012 16:37:17 -0500
> Drew Gibson<aggibson [at] cogeco> wrote:
>
>> "PHP_FCGI_PASSHEADER" => "Authorization" ) but I'm back to 401 errors.
>>
>>
> I think this needs to be done manually:
> add_header "DAV" "1, 2, 3, access-control, calendar-access,
> calendar-schedule, extended-mkcol, calendar-proxy, bind, addressbook,
> calendar-auto-schedule"
> add_header "Content-Type" 'text/calendar; charset="utf-8"'
>

Problem 1: Solved

Thanks for the tips Michael.

After much time reading and experimenting (don't tell my boss!), I'm
over the first big hurdle.

I'm not quite sure where to add those items for Lighttpd (are they from
Nginx configs?), I did attempt variations on
"pass-header" => ( "HTTP_AUTHORIZATION", "HTTP_DAV",
"HTTP_CONTENT-TYPE" )
to no avail.

To make a long story short, this issue is resolved and its root lay in
the URL rewrite statements.
I had followed examples for Davical rewrites found on the web. However,
Lighty rewrites seem to be far more particular than Apache.

The docs say "<regex>" => "$0" means pass the whole of the original URL
through.

"to pass URLs through unmangled: specify "$0" as the rule target."
(<http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:ModRewrite>)

My experience is that $0 only passes the whole of the original URL
unmangled if <regex> matches the whole of the URL. Anyway, this is
working for me right now..

## rewrite URLs for easy configuration of clients, iPhone, etc.
url.rewrite-once = (

## Don't rewrite the root URL.
"^\/$" => "$0",

## Don't rewrite for any .php, stylesheet, script, image or (robots).txt.
"^\/.+\.(php|css|js|png|gif|jpg|txt).*" => "$0",

## Rewrite for ?
# "^/.well-known(.*)$" =>
"/caldav.php/.well-known$1",

## Rewrite for iPhone
# "^/principals/users(.*)$" => "/caldav.php$1",

## Rewrite anything else to caldav.php
"^/(.+)" => "/caldav.php/$1"
)

I would be happy to post my configs and experience to the wiki,
especially if someone can confirm in a similar environment.

If things don't improve shortly, there may be a following post for
Problem 2!

regards,

Drew


------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Davical-general mailing list
Davical-general [at] lists
https://lists.sourceforge.net/lists/listinfo/davical-general

DAViCal general RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.