|Newer page:||version 8||Last edited on March 1, 2012 11:03 pm||by PhilHollenback|
|Older page:||version 7||Last edited on February 29, 2012 11:28 am||by PhilHollenback||Revert|
The WebCalendar System Administration Guide does not adequately explain how to set up WebCalendar to use the Postgresql database. Here's some further info.
This is on Fedora Core 1 linux with Postgresql 7.3.4 and WebCalendar 0.9.45.
I assume you have the postgresql rpms installed. Firs, run the following (as root) to start postgres and enable it on boot:
# /sbin/chkconfig postgresql on # /etc/init.d/postgresql start
Now su to the postgres user to edit a few configuration files and load up the database tables. Generally you need to perform database maintenance tasks as user postgres.
Edit the file /var/lib/pgsql/data/postgresql.conf and add the line
Edit /var/lib/pgsql/data/pg_hba.conf and make it look like this:
# TYPE DATABASE USER IP-ADDRESS IP-MASK METHOD local all all trust host all all 127.0.0.1 255.255.255.255 trust # Using sockets credentials for improved security. Not available everywhere, # but works on Linux, *BSD (and probably some others) #local all all ident sameuser
(i.e. comment out the 'ident' line' and uncomment the two lines that don't use 'ident')
Reload postgresql (still as user postgres):
$ /usr/bin/pg_ctl -D /var/lib/pgsql/data/ restart
Create a postgres user for the webcalendar database, and create the webcalendar database.
$ createuser -A -D -P webcal <type in a password for the webcal user> $ createdb -O webcal webcal
Load the tables into the database:
$ psql -U webcal webcal Welcome to psql 7.3.4-RH, the PostgreSQL interactive terminal. Type: \copyright for distribution terms \h for help with SQL commands \? for help on internal slash commands \g or terminate with semicolon to execute query \q to quit webcalendar=> \i /var/www/html/webcal/tables-postgres.sql (actually loads the tables) webcalendar=> \d (will list all the tables) webcalendar=> \q (quit psql)
That's it, the database is now set up for webcalendar. Use the admin web interface as described in the docs to point webcalendar at your database using the database name, username, and password you created above.
Note that this is probably not the most secure way to configure postgresql.