Default type to 'resource' for privileges display.
[davical.git] / INSTALL
blob761254cec9b31608fb60c20c0a4f4a0d4d88a140
1 Installation
2 ============
4 Debian Users
5 ------------
7 DAViCal is in Debian Sid so you should be able to simply:
9 apt-get install davical
11 Or synaptic or some other equivalent package manager to fetch and install
12 DAViCal and all the dependencies.
14 Skip to the "Database Setup" part if you have done that already.
17 Gentoo Users
18 ------------
20 DAVical is in the Sunrise overlay. You will have to add this overlay,
21 following the instructions on http://overlays.gentoo.org/proj/sunrise.
23 You can then use emerge to install DAVical and its dependencies.
25 emerge davical
28 Other Linux Users
29 -----------------
31 You will need to download the latest versions of the davical and awl packages
32 from the sourceforge download page for davical (the sf.net project is 'rscds').
34 You will need to untar these. Preferably you will untar them from within
35 the "/usr/share" directory and everything will be in it's expected location
36 (well, except the docs, but it will at least be tidy and everything will be
37 in one place).
39 I would like to hear from non-Debian users regarding things I might have
40 missed, or things you have learned about the system, so please tell us on
41 IRC, or post to the mailing list or forums.
44 Non-Linux Users
45 ---------------
47 I would really like to hear from you. As far as I can see there is no
48 reason why this can't all work on FreeBSD, Microsoft Windows, VMS, Mac OS
49 or whatever else, as long as the pre-requisites are able to be installed.
51 For Unix and unix-like operating systems the "Other Linux Users"
52 instructions are likely to be reasonably close to what you need. For other
53 systems everything will need some adjustment, and in particular some of
54 the path name and shell expectations coded into the database creation
55 scripts are likely to need love.
57 I'm available to answer questions, anyway :-)
59 Getting Help
60 ------------
62 The best place to get help is on IRC.  The official DAViCal
63 IRC channel is #davical on irc.oftc.net
65 There is also a mailing list, and forums on Sourceforge.
68 Pre-requisites
69 ==============
71 DAViCal depends on a number of things.  Firstly, it depends
72 on Andrew's Web Libraries (AWL) which is a set of useful
73 PHP functions and objects written by Andrew McMillan over
74 a number of years.
76 The following other software is also needed:
77   Apache: 1.3.x or 2.x.x
78   PHP: 5.1 or greater (along with the PDO and PostgreSQL extensions)
79   PostgreSQL: 8.2 or greater
81 The PostgreSQL database may be installed on a server other
82 than the web server, and that kind of situation is recommended
83 if you want to increase the security or scalability of your
84 installation.
86 Since the CalDAV store takes over a significant amount of path
87 hierarchy, it is designed to be installed in it's own virtual
88 host.  If you want it to operate within the web root of some
89 other application I will happily accept patches to make it do
90 that, but I am pretty sure it won't work that way out of the
91 box.
93 Several helper programs are needed to setup and upgrade davical:
94   Perl with DBI and DBD-Pg
95     Debian: aptitude install libdbi-perl libdbd-pg-perl
96     Gentoo: emerge dev-perl/DBI dev-perl/DBD-Pg
98   Yaml
99     Debian: aptitude install libyaml-perl
100     Gentoo: emerge dev-perl/yaml
102   pwgen (not mandatory)
103     Debian: aptitude install pwgen
104     Gentoo: app-admin/pwgen
106 Database Setup
107 ==============
109 On your database server you will need to create a user called
110 'general' which should not be able to create databases or users,
111 and which will be granted minimum privileges for the application.
113 To create the database itself, run the script:
115 dba/create-database.sh
117 Note that this script calls the AWL database scripts as part
118 of itself and it expects them to be located in /usr/share/awl/dba
119 which might be a reasonable place, but it might not be where you
120 have put them.
122 This script also expects to be running as a user who has rights
123 to create a new database.
128 Apache VHost Configuration
129 ==========================
131 Your Apache instance needs to be configured for Virtual Hosts.  If
132 this is not already the case you may want to read some documentation
133 about that, and you most likely will want to ensure that any existing
134 site becomes the **default** virtual host, with DAViCal only being a
135 single virtual host.
137 I use a Virtual Host stanza like this:
140 # Virtual Host def for Debian packaged DAViCal
141 <VirtualHost 123.4.56.78 >
142   DocumentRoot /usr/share/davical/htdocs
143   DirectoryIndex index.php index.html
144   ServerName davical.example.net
145   ServerAlias calendar.example.net
146   Alias /images/ /usr/share/davical/htdocs/images/
147   php_value include_path /usr/share/davical/inc:/usr/share/awl/inc
148   php_value magic_quotes_gpc 0
149   php_value register_globals 0
150   php_value error_reporting "E_ALL & ~E_NOTICE"
151   php_value default_charset "utf-8"
152 </VirtualHost>
154 Replace 123.4.56.78 with your own IP address, of course (you can
155 use a name, but your webserver may fail on restart if DNS happens
156 to be borked at that time).
158 At this point it is necessary to have register_globals enabled. All
159 variables are sanitised before use, but some routines do assume
160 this is turned on.
162 The various paths and names need to be changed to reflect your
163 own installation, although those are the recommended locations
164 for the various pieces of the code (and are standard if you
165 installed from a package.
167 Once your VHost is installed an working correctly, you should be
168 able to browse to that address and see a page telling you that
169 you need to configure DAViCal.
173 DAViCal Configuration
174 =====================
176 The DAViCal configuration generally resides in /etc/davical/<domain>-conf.php
177 and is a regular PHP file which sets (or overrides) some specific variables.
179 <?php
180 //  $c->domainname = "calendar.example.net";
181 //  $c->sysabbr     = 'davical';
182 //  $c->admin_email = 'admin@example.net';
183 //  $c->system_name = "DAViCal CalDAV Server";
184 //  $c->collections_always_exist = false;
186   $c->pg_connect[] = 'dbname=davical port=5432 user=general';
190 Multiple values may be specified for the PostgreSQL connect string,
191 so that you can (e.g.) use PGPool to cache the database connection
192 but fall back to a raw database connection if it is not running.
194 The "collections_always_exist" value defines whether a MKCALENDAR
195 command is needed to create a calendar collection before calendar
196 resources can be stored in it.  You will want to leave this to the
197 default (true) if people will be using Evolution or Sunbird /
198 Lightning against this because that software does not support the
199 creation of calendar collections.
201 You should set the 'domainname' and 'admin_email' as they are used
202 within the system for constructing URLs, and for notifying some
203 kinds of events.
206 Completed?
207 ==========
209 If all is going well you should now be able to browse to the admin
210 pages and log in as 'admin' (the password is the bit after the '**'
211 in the 'password' field of the 'usr' table so:
213 psql davical -c 'select username, password from usr;'
215 should show you a list.  Note that once you change a password it
216 won't be readable in this way - only the initial configuration
217 leaves passwords readable like this for security reasons.
219 If all is working then you should be ready to configure a client
220 to use this, and the docs for that are elsewhere.
222 See:
224 http://wiki.davical.org/
226 Which is the place where documentation will generally be kept up to
227 date the most.