Mailing List Archive

Installation notes for Opensuse 42.3
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
Re: Installation notes for Opensuse 42.3 [ In reply to ]
Dear Graham

Thanks for the great summary!

Since I have been running Davical on Debian oldstable now for quite a
while, do you also have a recommendation on how to migrate the content
of the database from that version there?

Thanks in advance

Lukas

On 14.12.2017 10:13, Graham McAlister wrote:
> 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
> local   davical    davical_app   trust
> local   davical    davical_dba   trust
>
> 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.
> davical                 IN A            192.168.0.238
>
>
> Go
> ==
>
> Now you should be able to access the system with
> http://davical.example.net/
>
> Cheers,
> gmac
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>
>
> _______________________________________________
> Davical-general mailing list
> Davical-general@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/davical-general
Re: Installation notes for Opensuse 42.3 [ In reply to ]
Hi Lukas,

The short answer is no, I'm sorry to say.

If I understand correctly, you are considering migrating your Davical
from Debian oldstable to Opensuse? If I were tackling that, I would
build the new Davical platform on Opensuse following my template and
then to migrate the database, I would use pg_dump (see
https://www.postgresql.org/docs/9.0/static/migration.html). Personally,
I have never done this so I cannot comment but I'm sure that many people
have.

Good luck.
Graham.

On 14/12/2017 18:33, Lukas Ruf wrote:
>
> Dear Graham
>
> Thanks for the great summary!
>
> Since I have been running Davical on Debian oldstable now for quite a
> while, do you also have a recommendation on how to migrate the content
> of the database from that version there?
>
> Thanks in advance
>
> Lukas
>
>
Re: Installation notes for Opensuse 42.3 [ In reply to ]
Hi Graham

On 15.12.2017 10:58, Graham McAlister wrote:
> If I understand correctly, you are considering migrating your Davical
> from Debian oldstable to Opensuse? If I were tackling that, I would
> build the new Davical platform on Opensuse following my template and
> then to migrate the database, I would use pg_dump (see
> https://www.postgresql.org/docs/9.0/static/migration.html).
> Personally, I have never done this so I cannot comment but I'm sure
> that many people have.
>

Yes, that's basically what I plan to do: migrate my Davical data from
Debian oldstable to the latest Davical/Postgres platform.   While I know
pg_dump very well, I am uncertain what to consider regarding DB schema
adaptations and, hence, what to consider when "restoring" the postgres dump.

Thanks

Lukas
Re: Installation notes for Opensuse 42.3 [ In reply to ]
Hi,

On Fri, 15 Dec 2017, Lukas Ruf wrote:
> On 15.12.2017 10:58, Graham McAlister wrote:
>> If I understand correctly, you are considering migrating your Davical
>> from Debian oldstable to Opensuse? If I were tackling that, I would
>> build the new Davical platform on Opensuse following my template and
>> then to migrate the database, I would use pg_dump (see
>> https://www.postgresql.org/docs/9.0/static/migration.html). Personally,
>> I have never done this so I cannot comment but I'm sure that many
>> people have.
>
> Yes, that's basically what I plan to do: migrate my Davical data from
> Debian oldstable to the latest Davical/Postgres platform. While I know
> pg_dump very well, I am uncertain what to consider regarding DB schema
> adaptations and, hence, what to consider when "restoring" the postgres
> dump.

I did this recently while migrating my DAViCal installation from CentOS 6
to 7 and DAViCal/awl 1.1.1/0.53 to 1.1.6/0.58.

It's basically

- old: pg_dump -Fc davical > davical-data.sql
- new: install DAViCal/awl as described in [1]
- new: pg_restore -C -d postgres davical-data.sql
- new: check your database tables for ownership, i had to fix some to be
owned by davical_dba
- new: run update-davical-database as postgres-user

[1] https://www.davical.org/installation.php


Mit freundlichen Gruessen/With best regards,

--Daniel.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Davical-general mailing list
Davical-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/davical-general
Re: Installation notes for Opensuse 42.3 [ In reply to ]
Salut Daniel

On 17.12.2017 14:02, dbischof@hrz.uni-kassel.de wrote:
>
> On Fri, 15 Dec 2017, Lukas Ruf wrote:
>> On 15.12.2017 10:58, Graham McAlister wrote:
>>> If I understand correctly, you are considering migrating your
>>> Davical from Debian oldstable to Opensuse? If I were tackling that,
>>> I would build the new Davical platform on Opensuse following my
>>> template and then to migrate the database, I would use pg_dump (see
>>> https://www.postgresql.org/docs/9.0/static/migration.html).
>>> Personally, I have never done this so I cannot comment but I'm sure
>>> that many people have.
>>
>> Yes, that's basically what I plan to do: migrate my Davical data from
>> Debian oldstable to the latest Davical/Postgres platform.  While I
>> know pg_dump very well, I am uncertain what to consider regarding DB
>> schema adaptations and, hence, what to consider when "restoring" the
>> postgres dump.
>
> I did this recently while migrating my DAViCal installation from
> CentOS 6 to 7 and DAViCal/awl 1.1.1/0.53 to 1.1.6/0.58.
>
> It's basically
>
> - old: pg_dump -Fc davical > davical-data.sql
> - new: install DAViCal/awl as described in [1]
> - new: pg_restore -C -d postgres davical-data.sql
> - new: check your database tables for ownership, i had to fix some to be
>   owned by davical_dba
> - new: run update-davical-database as postgres-user
>
> [1] https://www.davical.org/installation.php
>
Thanks for your hints

I'll give it a try during Xmas break and will report.....

Best regards
Lukas