Installation Experiences/May 2008: Kubuntu with PostgreSQL 8.3

From Davical
Jump to navigationJump to search

Install on Kubuntu with Postgres 8.3

There were major problems with Postgres permissions, but YEA!

  • 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
# /etc/apt/sources.list
# SERVER - Install LDAP AddressBook
# sudo apt-key advanced --keyserver pgp.net.nz --recv-keys 8FEB8EBF
deb http://debian.mcmillan.net.nz/debian unstable awm
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

# /etc/postgresql/8.3/main/pg_hba.conf
local   davical     davical_app                       trust
  • 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.
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
  • 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

  • I think the postgres standard is shifting towards the /etc/apache2/conf.d directory
# /etc/apache2/conf.d/davical
# DAViCal
Alias /cal/ /usr/share/davical/htdocs/
/etc/init.d/apache2 restart

DAViCal

sudo mkdir -p -v /etc/davical
# /etc/davical/<domain>-conf.php
<?php
  $c->admin_email = 'admin@example.net';
  $c->system_name = "DAViCal CalDAV Store";
  $c->pg_connect[] = 'dbname=davical port=5432 user=general';


  • Yes, I connected from localhost and (my LAN) server1
# WARNING: the "-quotes are required 
ln -s "/etc/davical/<domain>-conf.php" localhost-conf.php
ln -s "/etc/davical/<domain>-conf.php" /etc/davical/server1-conf.php
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.