By Shay Anderson on December 2013
Here are simple instructions on setting up a DAViCal service using Apache on a Ubuntu 12.04 server.
Install Apache and PHP
If you haven't already done so, install Apache using command line:
# apt-get install apache2 libapache2-mod-php5
Install PHP:
# apt-get install php5 php5-cli php5-common php5-pgsql
Install PostgreSQL
Install PostgreSQL next:
# apt-get install postgresql
Edit PostgreSQL config file, the config file is located here on my system:
# nano /etc/postgresql/9.1/main/pg_hba.conf
Then add the following lines towards the top of the file (place before other rules):
local davical davical_app trust
local davical davical_dba trust
Restart the PostgreSQL server:
# service postgresql restart
Install DAViCal
Install DAViCal using command line:
# apt-get install davical
Install and setup DAViCal database in PostgreSQL:
# su postgres -c /usr/share/davical/dba/create-database.sh
Note: the database script will output the admin password, copy the password for future admin use
Setup DAViCal Service using Apache
Next use Apache to serve DAViCal requests by setting default site:
# nano /etc/apache2/sites-available/default
And add config settings like:
<VirtualHost *:80>
ServerAdmin webmaster@somewhere.com
DocumentRoot /usr/share/davical/htdocs
DirectoryIndex index.php index.html
Alias /images/ /usr/share/davical/htdocs/images/
<Directory /usr/share/davical/htdocs/>
AllowOverride None
Order allow,deny
Allow from all
</Directory>
AcceptPathInfo On
# dont use following lines unless using older PHP versions
# php_value include_path /usr/share/awl/inc
# php_value magic_quotes_gpc 0
# php_value register_globals 0
# php_value error_reporting "E_ALL & ~E_NOTICE"
# php_value default_charset "utf-8"
</VirtualHost>
Restart Apache:
# service apache2 restart
DAViCal Configuration File
Next, create the DAViCal configuration file:
# nano /etc/davical/config.php
And add something like:
<?php
$c->sysabbr = 'davical';
$c->system_name = 'My Server - DAViCal Server';
$c->admin_email = 'someone@somewhere.com';
$c->pg_connect[] = 'dbname=davical user=davical_app';
The DAViCal service should now be running. Simply visit the IP address / domain name of the server to view the DAViCal admin log in page.