Intro
=====
These notes are relevant for installing DAViCal on Opensuse 42.3.
These installation notes are based on the official guide here:
https://www.davical.org/installation.php
The purpose here is to get a test system up and operational. For
production, you'd need to make extensive adjustments such as using a
separate database server.
For these notes I have used the domain example.net but you should
replace this with your own domain.
Packages
========
I normally start with a freshly built vm with Opensuse 42.3, using the
minimal server (no KDE, Gnome, etc). I use a vm with 1Gb memory and 20Gb
disc for testing.
Install these packages:
php5 php5-calendar php5-curl php5-gettext php5-openssl php5-pgsql
apache2 apache2-mod_php5 postgresql96-server postgresql96-contrib git
perl-DBD-Pg perl-YAML
Prepare davical
===============
As a non-root user in home folder
git clone https://gitlab.com/davical-project/davical.git
git clone https://gitlab.com/davical-project/awl.git
rm -rf davical/.git*
rm -rf awl/.git*
As root,
mv davical/ /usr/share/
mv awl/ /usr/share/
chown -R root:www /usr/share/davical
cd /usr/share/davical/
find ./ -type d -exec chmod u=rwx,g=rx,o= '{}' \;
find ./ -type f -exec chmod u=rw,g=r,o= '{}' \;
chown -R root:www /usr/share/awl
cd /usr/share/awl/
find ./ -type d -exec chmod u=rwx,g=rx,o= '{}' \;
find ./ -type f -exec chmod u=rw,g=r,o= '{}' \;
Create /etc/davical/config.php
mkdir /etc/davical
vi /etc/davical/config.php
<?php
$c->domain_name = "davical.example.net";
$c->sysabbr= 'DAViCal';
$c->admin_email = 'admin@example.net';
$c->system_name = "Example DAViCal Server";
$c->pg_connect[] = 'dbname=davical port=5432 user=davical_app';
$c->enable_auto_schedule = false;
Prepare postgres
================
su - postgres
initdb -D ~postgres/data
Edit /var/lib/pgsql/data/pg_hba.conf by adding two lines after
# TYPE DATABASE USER ADDRESS METHOD
localdavicaldavical_apptrust
localdavicaldavical_dbatrust
Start postgres
systemctl start postgresql
systemctl enable postgresql
To create the davical database:
As root
chmod ug+x /usr/share/davical/dba/create-database.sh
chmod ug+x /usr/share/davical/dba/update-davical-database
su postgres -g www /usr/share/davical/dba/create-database.sh
*** Note the admin password ***
A quick note on permissions. The script create-database.sh must be run
as a user that can create postgres databases. For us on Opensuse, that
means the user postgres, so that's why we su postgres. The problem is
that the postgres user does not have permission to execute this script.
However, the group www does have permission so that's why we add -g www
to the su command.
Prepare Apache
==============
a2enmod php5
Create a virtual host as root (use your own domain here):
vi /etc/apache2/vhosts.d/davical.example.net.conf
<VirtualHost *:80>
DocumentRoot /usr/share/davical/htdocs
ServerName davical.example.net
ServerAdmin admin@example.net
Alias /images/ /usr/share/davical/htdocs/images/
<Directory /usr/share/davical/htdocs>
AllowOverride None
Require all granted
DirectoryIndex index.php
</Directory>
</VirtualHost>
vi /etc/apache2/default-server.conf
# append these two linesat the end of the file
ServerName <hostname> # the hostname of your server
ServerAdmin admin@example.net
Start apache
systemctl start apache2
systemctl enable apache2
Network
=======
Make sure that you have a DNS entry for this server pointing to your vm e.g.
davicalIN A192.168.0.238
Go
==
Now you should be able to access the system with
http://davical.example.net/
Cheers,
gmac
=====
These notes are relevant for installing DAViCal on Opensuse 42.3.
These installation notes are based on the official guide here:
https://www.davical.org/installation.php
The purpose here is to get a test system up and operational. For
production, you'd need to make extensive adjustments such as using a
separate database server.
For these notes I have used the domain example.net but you should
replace this with your own domain.
Packages
========
I normally start with a freshly built vm with Opensuse 42.3, using the
minimal server (no KDE, Gnome, etc). I use a vm with 1Gb memory and 20Gb
disc for testing.
Install these packages:
php5 php5-calendar php5-curl php5-gettext php5-openssl php5-pgsql
apache2 apache2-mod_php5 postgresql96-server postgresql96-contrib git
perl-DBD-Pg perl-YAML
Prepare davical
===============
As a non-root user in home folder
git clone https://gitlab.com/davical-project/davical.git
git clone https://gitlab.com/davical-project/awl.git
rm -rf davical/.git*
rm -rf awl/.git*
As root,
mv davical/ /usr/share/
mv awl/ /usr/share/
chown -R root:www /usr/share/davical
cd /usr/share/davical/
find ./ -type d -exec chmod u=rwx,g=rx,o= '{}' \;
find ./ -type f -exec chmod u=rw,g=r,o= '{}' \;
chown -R root:www /usr/share/awl
cd /usr/share/awl/
find ./ -type d -exec chmod u=rwx,g=rx,o= '{}' \;
find ./ -type f -exec chmod u=rw,g=r,o= '{}' \;
Create /etc/davical/config.php
mkdir /etc/davical
vi /etc/davical/config.php
<?php
$c->domain_name = "davical.example.net";
$c->sysabbr= 'DAViCal';
$c->admin_email = 'admin@example.net';
$c->system_name = "Example DAViCal Server";
$c->pg_connect[] = 'dbname=davical port=5432 user=davical_app';
$c->enable_auto_schedule = false;
Prepare postgres
================
su - postgres
initdb -D ~postgres/data
Edit /var/lib/pgsql/data/pg_hba.conf by adding two lines after
# TYPE DATABASE USER ADDRESS METHOD
localdavicaldavical_apptrust
localdavicaldavical_dbatrust
Start postgres
systemctl start postgresql
systemctl enable postgresql
To create the davical database:
As root
chmod ug+x /usr/share/davical/dba/create-database.sh
chmod ug+x /usr/share/davical/dba/update-davical-database
su postgres -g www /usr/share/davical/dba/create-database.sh
*** Note the admin password ***
A quick note on permissions. The script create-database.sh must be run
as a user that can create postgres databases. For us on Opensuse, that
means the user postgres, so that's why we su postgres. The problem is
that the postgres user does not have permission to execute this script.
However, the group www does have permission so that's why we add -g www
to the su command.
Prepare Apache
==============
a2enmod php5
Create a virtual host as root (use your own domain here):
vi /etc/apache2/vhosts.d/davical.example.net.conf
<VirtualHost *:80>
DocumentRoot /usr/share/davical/htdocs
ServerName davical.example.net
ServerAdmin admin@example.net
Alias /images/ /usr/share/davical/htdocs/images/
<Directory /usr/share/davical/htdocs>
AllowOverride None
Require all granted
DirectoryIndex index.php
</Directory>
</VirtualHost>
vi /etc/apache2/default-server.conf
# append these two linesat the end of the file
ServerName <hostname> # the hostname of your server
ServerAdmin admin@example.net
Start apache
systemctl start apache2
systemctl enable apache2
Network
=======
Make sure that you have a DNS entry for this server pointing to your vm e.g.
davicalIN A192.168.0.238
Go
==
Now you should be able to access the system with
http://davical.example.net/
Cheers,
gmac