Difference between revisions of "OwnCloud"

From Wikislax
Jump to: navigation, search
(Created page with "{{RightTOC}} == What is OwnCloud ? == [http://owncloud.com/ OwnCloud] is a file synchronization server. It affords keeping a hierarchy of files synchronized on different cli...")
(No difference)

Revision as of 15:13, 18 January 2025

What is OwnCloud ?

OwnCloud is a file synchronization server. It affords keeping a hierarchy of files synchronized on different clients and operating systems.

Installing OwnCloud

OwnCloud is available as a PHP application relying on various databases. See the OwnCloud documentation for details. We will be using MySQL. download tarball then untar and install.

# tar -C /usr/local -xvf owncloud-complete-20240724.tar.bz2
# chown -R apache:apache owncloud
# cd /var/www/htdocs
# ln -s /usr/local/owncloud owncloud
# cd ..
# chown -R apache:apache owncloud

That's it. Note : the other package Dahdi-tools is not required. Other note : Dahdi requires a kernel compiled with CONFIG_CRC_CCITT=y.

Installing Jansson

Jansson is a required Json development library. Download then untar and install.

# tar -C /usr/local -xvf jansson-x.y.z.tar.gz
# cd /usr/local/jansson-linux-x.y.z
# ./configure --prefix=/usr/local --libdir=/usr/local/lib64
# make
# make install
# make clean

Installing c-client

The asterisk imap option requires presence of library c-lient.a, which is part of Imap-uw, by the University of Washington. The University of Washington seems to be no longer distributing the software so we keep a copy for your convenience. Download then untar and install :

# gunzip c-client.tar.Z
# tar -C /usr/local -xvf c-client.tar
# cd /usr/local
# chown -R root:root imap-2007f
# chmod -R o-w imap-2007f
# cd imap2007f
# make slx EXTRACFLAGS="-I/usr/include/openssl -g -O2 -fPIC" SSLCERTS=/etc/ssl/certs SSLKEYS=/etc/ssl/private

Installing Speex

Speex is a required free codec. Download speex source code then untar and install.

# tar -C /usr/local -xvf speex-x.y.z.tar.gz
# cd /usr/local/speex-x.y.z
# ./configure --prefix=/usr/local --libdir=/usr/local/lib64
# make
# make install
# make clean

Installing Asterisk

Download Asterisk then untar and install. Make menuselect affords choosing which components to use. If using mysql, be sure to read the next paragraph before invoking make. Otherwise proceed. make samples affords creating the configuration files in /usr/local/etc/asterisk.

# groupadd asterisk
# useradd -g asterisk asterisk
# tar -C /usr/local --no-same-permissions --no-same-owner -xvf asterisk-x.y.z.t.tar.gz
# cd /usr/local/asterisk-x.y.z.t
# ./configure --prefix=/usr/local --libdir=/usr/local/lib64 --mandir=/usr/local/man \
--with-asound --with-crypto --with-iconv --with-imap=/usr/local/imap-2007f \
--with-jansson --with-ldap --with-speex --with-ssl
# make menuselect
# make
# make install
# make install-logrotate
# make samples
# make clean
# chown -R asterisk:asterisk /usr/local/lib64/asterisk
# chown -R asterisk:asterisk /usr/local/var/lib/asterisk
# chown -R asterisk:asterisk /usr/local/var/log/asterisk
# chown -R asterisk:asterisk /usr/local/var/run/asterisk
# chown -R asterisk:asterisk /usr/local/var/spool/asterisk
# chmod o+x /usr/local/etc/asterisk
# chmod o-x /usr/local/lib64/asterisk
# chmod o-x /usr/local/var/lib/asterisk
# chmod o-x /usr/local/var/log/asterisk
# chmod o-x /usr/local/var/run/asterisk
# chmod o-x /usr/local/var/spool/asterisk

If using mysql modules, there might be a glitch with the mysql include path. Replace in the files below the lines with "#include <mysql/mysql.h>" by lines with "#include <mysql.h>" (removing the directory) :

addons/app_mysql.c
addons/cdr_mysql.c
addons/res_config_mysql.c

It is then possible to launch asterisk in the foreground with various levels of verbosity (depending on the number of v's). However the default configuration files include a number of options that we don't want, so we'll rename them first and start with empty files. Asterisk includes a console and then proposes a shell  :

# cd /usr/local/etc/asterisk
# mv extensions.conf extensions.conf.sample
# mv extensions.ael extensions.ael.sample
# mv sip.conf sip.conf.sample
# sudo -u asterisk asterisk -vvvc
. . .
*CLI> 

Type help to view the available commands, however before doing anything useful we'll need to modify the configuration files so let's just core stop gracefully here.

Running asterisk

Asterisk runs as a daemon so must be launched at startup and stopped at shutdown. Update /etc/rc.d/rc.local and /etc/rc.d/rc.local_shutdown accordingly :

# vi /etc/rc.d/rc.local
. . .
# start asterisk
if [ -x /usr/local/sbin/safe_asterisk ]; then
        echo "Starting asterisk: /usr/local/sbin/safe_asterisk -G asterisk -U asterisk -p"
        /usr/local/sbin/safe_asterisk -G asterisk -U asterisk -p
fi
<esc>
:x
# vi /etc/rc.d/rc.local_shutdown
. . .
# stop asterisk
if [ -r /usr/local/var/run/asterisk/asterisk.pid ]; then
        echo "Stopping asterisk: kill -INT `cat /usr/local/var/run/asterisk/asterisk.pid`"
        kill -INT `cat /usr/local/var/run/asterisk/asterisk.pid`
fi
<esc>
:x

Configuring Asterisk

Asterisk running in the backgroung, it's possible to attach to the process using asterisk -r and to exit the asterisk shell by typing exit. Most of the configuration files can be modified externally then reloaded using commands such as dialplan reload, sip reload, or voicemail reload. A few files however cannot (example confbridge.conf), and require restarting using core restart now. Type help to get a complete list of commands.

The configuration files are created under EPREFIX/etc and there are many of them (112 in version 1.15.0.0 !). The bad news is that they must be all reviewed and modified to remove unneeded configuration options. When done though, modifying only a few will afford getting a working system with a reasonnable set of features. We decided to use LDAP to configure our users so this is what is detailed below.

Note : the asterisk configuration files are organized in contexts whose names are enclosed in square brackets on a line of its own. Definitions in these contexts - otherwise mentionned - are valid inside these contexts only.

Configuration file Usage
sip.conf to configure sip accounts
res_ldap.conf to configure LDAP users
confbridge.conf to configure conferences
voicemail.conf to configure voicemail boxes
extensions.conf to configure the dialplan


Documentation

Asterisk Wiki

Asterisk Book


Sucknews Main Page Sip.conf