install postgress:
sudo apt-get install postgresql
sudo -u postgres psql postgres
Set a password for the postgres superuser:
\password postgres
(You may need to quit using \q when you are done). (Note: You could also generate a random password and use it here. Just be sure to record it in an accessible location.) Create the first database:
sudo -u postgres createdb mydb
Install the newest version (> 0.9.8) from the DAViCal repositories:
sudo apt-key advanced --keyserver pgp.net.nz --recv-keys F6E0FA5CF0307507BB23A512EAFCFEBF8FEB8EBF
echo "deb http://debian.mcmillan.net.nz/debian lenny awm " | sudo tee /etc/apt/sources.list.d/davical.list
sudo apt-get update 
sudo apt-get install davical
Note: Port 11371 must be open in the firewall to allow the keyserver. Set up DaviCal PostgreSQL users Create the DaviCal users (first becoming the the system root superuser, using sudo su, then becoming the database superuser, postgres):
sudo su
su postgres -c "createuser davical_app"
You will get asked about superusers, roles and databases, but just say "No" to all questions. This functional ID needs only minimum rights. Repeat the process to create one more user, "davical_dba":
sudo su
su postgres -c "createuser davical_dba"
Edit the configuration file pg_hba.conf:
sudo nano /etc/postgresql/8.4/main/pg_hba.conf
Add the following 4 lines near (or at) the top;
local all all trust
local davical davical_dba trust
local davical davical_app trust
host davical davical_app trust
(The last line is for accessing the database over TCP/IP, assuming the database and the apache2 server are on the same computer. See here under "Connecting to the Database" for more details.) Restart the postgreSQL server:
sudo /etc/init.d/postgresql-8.4 restart
Setup the DaviCal database Run the database creation/installation script:
sudo su
su postgres -c /usr/share/davical/dba/create-database.sh
Write down the admin password when it is displayed. You will need it later. Once the creation script has run correctly, again edit the pg_hba.conf file:
sudo nano /etc/postgresql/8.4/main/pg_hba.conf
and remove the line local all all trust (This step is not strictly necessary for the installation, but do you really want anybody with a local account to have free access to all the databases?) Restart the database daemon:
sudo /etc/init.d/postgresql-8.4 restart
Test that your database creation was successful
sudo su
su postgres
psql davical
davical=# \z
davical=# \q
You should see a table with a list of access permissions to "davical_dba". (Typing "\q" exits pqsl.) Set up Apache2
Install the Apache2 webserver, if you have not done so already. See the Ubuntu documentation for help.
sudo apt-get install apache2
In your router settings (assuming you have one), set your port forwarding so that your port 80 (http) and 443 (https) is forwarded to your server. Make sure your server firewall (if you have one) allows incoming ports 80 and 443.
sudo nano /etc/apache2/sites-available/mydavicalsite
so that these lines were used (instead of the original ones):
# Virtual Host def for Debian package DAViCal
<VirtualHost *:80>
 DocumentRoot /usr/share/davical/htdocs
 DirectoryIndex index.php index.html
 ServerName mydavicalsite.dyndns.org
 ServerAlias calendar.mydavicalsite.dyndns.org
 Alias /images/ /usr/share/davical/htdocs/images/
 <Directory /usr/share/davical/htdocs/>
     AllowOverride None
     Order allow,deny
     Allow from all
 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"
To then make the virtualhost file active, I made a symbolic link from the virtualhost configuration file in the apache2 "sites-available" folder to the apache2 "sites-enabled" folder:
sudo ln -s /etc/apache2/sites-available/mydavicalsite /etc/apache2/sites-enabled/mydavicalsite
better sudo a2ensite site_name
Then restart apache2:
sudo /etc/init.d/apache2 restart
Create your configuration file Use admin as your initial login, and the password assigned to you at installation (you did write it down, didn't you?) (See here if you forgot your password. In brief:
sudo su
su postgres
psql davical -c 'select username, password from usr;'
Only the initial "admin" password is stored in plain text. All subsequent users have their password stored in an encrypted state. If you change the admin password through the web interface it will also be encrypted from that point forward.)
sudo ln -s /usr/share/davical/htdocs /var/www/davical
Then you can also log through localhost using your browser: http://localhost/davical source: http://wiki.davical.org/w/Ubuntu/Lucid


Hessen Kasselstraat 8
5615 SM Eindhoven
phone: +316-81888456