Installation Experiences/May 2008: Kubuntu with PostgreSQL 8.3

Install on Kubuntu with Postgres 8.3
There were major problems with Postgres permissions, but YEA! deb http:// debian.mcmillan.net.nz/debian unstable awm
 * Anyway, this is from the start to actually being able to login.
 * DISCALIMER - as always E&OE, and I have yet to actually try using - this is just the install.
 * I use kate under root (Run -> kedsu kate) so the configuration files are automatically saved as root-root
 * 1) /etc/apt/sources.list
 * 2) SERVER - Install LDAP AddressBook
 * 3) sudo apt-key advanced --keyserver pgp.net.nz --recv-keys 8FEB8EBF

sudo apt-key advanced --keyserver pgp.net.nz --recv-keys 8FEB8EBF sudo aptitude update sudo aptitude install -y davical # DAViCal CalDAV Server

You can change the include path for PHP by editing /etc/php5/apache2/php.ini and adding in /usr/share/awl/inc or you can crudely symlink them all into the DAViCal include directory like this: cd /usr/share/davical/inc ln -s /usr/share/awl/inc/*.

Postgres 8.3
local  davical     davical_app                       trust sudo -i      # Become User root su postgres  # Become User postgres createuser --no-createdb --no-createrole --no-superuser davical_app createuser --no-createdb --no-createrole --no-superuser davical_dba psql -U postgres -c "GRANT davical_dba TO postgres" createdb --encoding UTF8 --template template0 --owner davical_dba davical /usr/share/rscds/dba/create-database.sh exit         # From User postgres sudo /etc/init.d/postgresql-8.3 restart
 * 1) /etc/postgresql/8.3/main/pg_hba.conf
 * This is where the major problems occurred - I did delete the database/users and did it again with these commands.
 * That line *MUST* be at the top of the pg_hba.conf file.
 * If you continue to have permission problems, check /var/log/postgresql/postgresql-8.3-main.log
 * If you are getting EST FATAL:  Ident authentication failed for user "www-data", then you haven't specified the correct user in your /etc/davical/*.conf file's $c->pg_connect[] assignment statement.
 * If you are getting EST FATAL:  Ident authentication failed for user "davical_app", then need to modify your ph_hba.conf file. Make sure the davical_app trust line appears at the *BEGINNING* of the file.
 * Note: When a client connects to the database, hosts/rules listed are processed in order until one matches and the client is allowed or denied. So, when editing the pg_hba.conf file, put the trust lines (shown here) before the other rules. Webmin's Postgres module will display the problem visually and easily allow you to reorder the rules.
 * You should be able to test connectivity from an account that doesn't have a role with: $ psl davical davical_app

Apache2
Alias /cal/ /usr/share/davical/htdocs/
 * I think the postgres standard is shifting towards the /etc/apache2/conf.d directory
 * 1) /etc/apache2/conf.d/davical
 * 2) DAViCal

/etc/init.d/apache2 restart

DAViCal
sudo mkdir -p -v /etc/davical

admin_email = 'admin@example.net'; $c->system_name = "DAViCal CalDAV Store"; $c->pg_connect[] = 'dbname=davical port=5432 user=general';
 * 1) /etc/davical/ -conf.php

ln -s "/etc/davical/ -conf.php" localhost-conf.php ln -s "/etc/davical/ -conf.php" /etc/davical/server1-conf.php
 * Yes, I connected from localhost and (my LAN) server1
 * 1) WARNING: the "-quotes are required

http://localhost/cal/ # and Good Luck

Change the password? admin-user?
su postgres psql -d davical -c "UPDATE usr SET password = '**abcdef' WHERE user_no=1;" psql -d davical -c "UPDATE usr SET username = 'admin1' WHERE user_no=1;" exit         # From User postgres

Trailing newline in config
Never have a trailing newline in your config, better don't close the <?php bracket at all. This innocent-looking newline is copied to the xml data stream with Sunbird complaining about "xml declaration not at start of external entity".

Mistreated like this, Sunbird will happily add new entries to the calendar, but fail to reload them. I've seen numerous reports all over the net that might actually be caused by this.