Installation Experiences/Sep 2009: Install on a Hosted Server
Install on a Hosted Server
These notes describe how to install davical on a hosted server, that is, a server which does not provide root access and possibly, shell access. This typically prevents using virtual hosting which is the standard method of operation of davical. Likewise writing to /etc/davical isn't usually possible and the installation scripts may not be able to run. Additional issues can include that the name of the postgresql database and users may be enforced to be a particular format, when the server is hosting multiple sites.
There are two steps to the installation, setting up the PostgreSQL database and installing the PHP files.
Setting up the PostgreSQL database
Usually the standard davical installation script dba/create-database.sh creates and populates the required PostgreSQL databases. However, the server may not provide full access to all the PostgreSQL administration tools, or allow scripts to be run.
On some hosted servers, PostgreSQL database and user naming must meet a certain format, for example, no underscores are allowed in the username after the unix username, so username_davical and username_davicalapp respectively are required. You will need to edit the dba/create-database.sh script or run the commands in the script individually. Often the PostgreSQL databases may need to be created using a web admin application (e.g phpPgAdmin), not using the shell script. The new names of the database and database user will need to be changed in the config.php file (described below).
Installing the PHP files
On systems such as cPanel controlled servers, it is possible to define a subdomain. For example, calendar.example.com can be defined to refer to a directory path differing from www.example.com. Assuming the server has a directory structure similar to:
- /home/example/ # Where the hosted site user account resides (referred to as "~" below).
- ~/public_html # Where the web pages reside.
It is recommended to create the following directories
Upload all the files from the htdocs, inc and dba directories in the davical distribution into ~/calendar/htdocs, ~/calendar/inc and ~/calendar/dba directories on the server respectively.
If you cannot set the PHP include path, you may need to copy all of the AWL include files into the ~/calendar/inc directory, but this can make upgrading your installation problematic. It is better, if possible, to put them into ~/awl/inc and add that directory to the include path. Newer versions of DAViCal will find ~/awl/inc automatically, relative to ~/calendar/htdocs and no include path setting will be needed from version 0.9.9.1 (not yet released on 30th June 2010).
You need to copy example.com-conf.php and edit the file to match your previously defined database location and users for the
variable, then upload the file as ~/calendar/config/config.php.
Define the subdomain calendar.example.com using the appropriate web application supplied by your hosting company. Define calendar.example.com to access files in ~/calendar/htdocs.
You will need to be super user to create the plpgsql procedural language. In my case, I had to beg my sysadmin to set the procedural language on my database.
You will need Perl in order to run the configuration scripts. The scripts require the Perl libraries DBD::Pg and DBD::YAML. Most systems should have these, but on the cPanel server I was working with, it doesn't come installed (for security), requiring begging the sysadmin to install it for you. However, other than the initial configuration, Perl isn't required for normal running of the system. However the update script update-davical-database requires Perl in order to run.