First you have to install mercurial:
$ aptitude install mercurial
and the apache webserver with wsgi:
$ aptitude install apache2 libapache2-mod-wsgi
Make sure, your apache is installed and running before continuing. Now clone the candiwi repository to your desired location:
$ hg clone https://bitbucket.org/candiwi/candiwi/
Next, run setup_dev_environment from the newly generated candiwi directory. This script will install all the necessary packages to run candiwi and prepares some configuration files.
$ ./setup_dev_environment
Then copy the contents of the file candiwi/apache/httpd.conf into /etc/apache2/httpd.conf . This points apache to the directory you installed candiwi in.
Make sure apache can read and write to your candiwi repositories
$ chown -R www-data:www-data /path/to/your/candiwi
Restart apache:
$ /etc/init.d/apache2 restart