Difference between revisions of "Installation Experiences/Feb 2008: Ubuntu 6.10"
m (→If you forgot the Admin Password)
|Line 138:||Line 138:|
>psql davical -c 'select username, password from usr;'
>psql davical -c 'select username, password from usr;'
the initial "admin" password is stored in plain text. All subsequent users have their password stored in an encrypted state.
Revision as of 03:00, 19 February 2008
Updated Installation Guide
There is a lot of information on the installation but I found doing a clean install of the latest 0.9.4 that some minor but crucial points had been changed or omitted. So here's my guide to doing a clean install.
My Build Environment
- Ubuntu 6.10 Edgy Server
- Apache2 (LAMP Installation of Ubuntu so default installed)
- DAViCal 0.9.4
- PostgreSQL 8.1
Getting DAViCal for Ubuntu should be easy as you can get and install it using "apt-get". But there where some hitches.
- You need to add "deb http://debian.mcmillan.net.nz/debian unstable awm" to your "/etc/apt/source.list". (As documented in the main installation guide)
- You need to edit your "/etc/apt/source.list" to include "edgy universe" as DAViCal depends on "libclass-dbi-pg-perl" and this is not included in "edgy main". (note: Ubuntu 7.10 does not seem to have this missing dependency)
Once these 2 things are done "apt-get install rscds" will run fine.
PHP5 and PostgreSQL install work fine "out of the box" with apt-get, but make sure to install PostgreSQL client as well as server.
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;
>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".
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". (note: I followed this exact procedure, but when running the create-database.sh below the missing general user does give errors (for example, line 73). Don't know how serious?)
Once these 2 functional IDs are created go to "/etc/postgresql/8.1/main/" 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 near or at the top;
local all all trust local davical davical_dba trust local davical davical_app trust
Then restart your postgreSQL server by;
Now you can run the script to create the DAViCal database. This is done as follows;
>su postgres -c /usr/share/rscds/dba/create-database.sh (previously I had ">su postgres -c /usr/share/davical/dba/create-database.sh" but that was a mistake due to me doing a cut'n'paste from an older document. Someone was kind enough to point that out in an edit.)
Please note that you must create the functional IDs then give them access rights in postgreSQL by editing the pg_hba.conf and restarting the database daemon before running the database creation script or you will get a very annoying error;
psql: FATAL: Ident authentication failed for user "davical_dba"
At the end of the script, the script will create and tell you the admin password. 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
local all all trust
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.)
The DAViCal main site describes how to setup a virtual host but I was lazy and used the follow approach described in the Wiki "Installation Guide Update".
Go to /etc/apache2/sites-available/default and add the following line;
Alias /cal/ /usr/share/rscds/htdocs/
Once added restart your apache daemon by;
Next step is to actually configure DAViCal. Go to "/etc/davical/". Currently it should be an empty directory. Create a configuration file with the naming convention XXXX-conf.php, where "XXXX" is the hostname of the server running DAViCal. When you actually start using DAViCal, the URL you browse too should be "http://xxxx/cal/". 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;
<?php // $c->domain_name = "calendar.example.net"; // $c->sysabbr = 'rscds'; $c->admin_email = 'email@example.com'; $c->system_name = "Really Simple CalDAV Store"; // $c->collections_always_exist = true; // $c->enable_row_linking = true; $c->default_locale = en_US.UTF-8; $c->pg_connect = 'dbname=davical port=5432 user=davical_app'; ?>
- 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.
- In the DAViCal main site installation page, the conf file has 2 entries for ports (the last line in the conf file), these is not necessary in a standard installation and you need only configure port 5432.
- Apparently only the last line for the DB connection is important, the other lines are optional and can/are commented out with a double slash.
Creating a symbolic link to localhost-conf.php helps when you want to test or administer the installation from the server locally.
cd /etc/rscds/ ln -s XXXX-conf.php localhost-conf.php
If you have set up your Apache with a virtual host for DAViCal, then it seems the AWL stuff will be configured in the virtual host setup (see http://rscds.sourceforge.net/installation.php for details).
Since I just created a sub folder for DAViCal using an alias I once again turned to the solution offered by the Installation Guide Update
cd /usr/share/rscds/inc ln -s /usr/share/awl/inc/* .
At this point all configuration is completed, and DAViCal should be ready to use.
- In a browser go to "http://xxxx/cal/".
- You will find a login screen.
- Enter "admin" for username.
- 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;
>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.