Caldav

From the official homepage of DAViCal: DAViCal is a server for calendar sharing. It is an implementation of the CalDAV protocol which is designed for storing calendaring resources (in iCalendar format) on a remote shared server.

An increasing number of calendar clients support the maintenance of shared remote calendars through CalDAV including Mozilla Calendar (Sunbird/Lightning), Evolution, Mulberry, Chandler, and various other closed-source products such as Apple's iCal and iPhone.

Prerequisites

 * Apache: 1.3.x or 2.x.x
 * PHP compiled with nls, xml, pcre, apache2 and postgres use flags.
 * PostgreSQL: 8.1 or greater
 * Sunrise Overlay

Install
At first, unmask the software in your package.keywords.

Install from sunrise Overlay. Package is called "davical".

if emerge error ('ImportError: No module named WebappConfig.config')

Database Stuff
Once all the package installations are done you start by making the DAViCal database in PostgreSQL. To this purpose you create 2 functional accounts in postgreSQL. Assuming you have root or sudo rights;

You will get asked about superusers, roles and databases, but "just say NO" to all questions, this functional ID needs only minimum rights.

Please note that in the main DAViCAL site installation page the user create at this step is "general". This account name is for older versions. DO NOT CREATE A USER NAMED "general."

Once these 2 functional IDs are created go to /var/lib/postgresql/"version"/data/ and open the file pg_hba.conf with an editor of choice. (You may want to back up the file before editing, just in case.) Add the following 3 lines to the file:

Then restart your postgreSQL server

Now you can run the script to create the DAViCal database. This is done as follows:

If the script ran correctly you should see something like this:

CREATE DATABASE Supported locales updated. CalDAV functions updated. RRULE functions updated. Database permissions updated. NOTE ====
 * The password for the 'admin' user has been set to '*********'"

Thanks for trying DAViCal! Check in /usr/share/doc/davical/examples/ for some configuration examples. For help, visit #davical on irc.oftc.net.

At the end of the script, the script will create and tell you the admin password. (I've blanked out the password above with '*********') Make note of it here, though it can be retrieved later on if you misplace or forget it.

Once the creation script has run correctly, go back to the pg_hba.conf file and remove the line

/var/lib/postgresql/"version"/data/pg_hba.conf

and restart the database daemon. (This step is not strictly necessary for the installation, but do you really want just anybody with a local account free access to all the databases? Thought not.)

Apache Configuration
Davical should have already been installed in /var/www/localhost if you haven't enabled the vhosts use. If vhosts was set, you have to install it in the chosen vhost using webapp-config.

webapp-config -d davical -I davical 

Be sure apache is php aware and vhost aware, if you are going to use vhost.

The basic apache configuration is rather straightforward:

Typically this line is put in the  stanza.

The administration pages should now be available at http://your_host/mycalendar

DAViCal Configuration
Next step is to actually configure DAViCal. Go to "/etc/davical/". The gentoo install creates a base template for the default site. Edit the configuration file; it should have the naming convention XXXX-conf.php, where "XXXX" is the hostname of the server running DAViCal. If you have a domain you will need to change this convention to XXXX.XXX-conf.php, where .XXX is the TLD for your site. When you actually start using DAViCal, the URL you browse too should be "http://xxxx.xxx/davical/htdocs/". Make sure the server name you will be using in the URL match name of the configuration file.

The content of the configuration file should be as follows;

* The "domain_name" should be same XXXX string as the beginning of the file name. * Note that the functional user "davical_app" is used here. * Only the last line for the DB connection is important, the other lines are optional and can be commented out with a double slash.

Using DAViCal
At this point all configuration is completed, and DAViCal should be ready to use.

1. In a browser go to "http://xxxx/cal/". 2. You will find a login screen. 3. Enter "admin" for username. 4. Enter the password obtained after running the database creation script.

Congratulations! You should now find yourself in the administration screen, with the ability to create new users. If you forgot the Admin Password

If at this point you are saying, "d*mn, where is that admin password I wrote down...", no sweat. Do the following;

Fixing PostgreSQL connection problem
When connecting to PostgreSQL from Apache via UNIX socket, Apache has to be in postgres group.

Symptoms: /var/log/apache2/error.log

Solution: