liens sites informatique

http://www.commentcamarche.net/

http://www.commentcamarche.net/download/

 

http://www.clubic.com/

http://www.clubic.com/telecharger/

 

http://www.developpez.com/

 

http://korben.info/

 

https://openclassrooms.com/

https://openclassrooms.com/courses

 

 

install GLPI sur ubuntu serveur 16.04

Installation de Glpi, Apache 2.4, PHP 7 and MariaDB sur Ubuntu 16.04 LTS

Introduction :

GLPI (GESTION LIBRE DE PARC INFORMATIQUE) http://glpi-project.org/

Step 1: Pré-requis

J’utilise une VM Ubuntu 16.04 LTS serveur avec juste le minimum d’installé.

sudo su

Step 2: Installation d’Apache Web Server

sudo apt-get install apache2 apache2-utils

Apache devrait être démarré automatiquement. Vérifiez son statut avec systemctl:

root@Glpi:/home/ritek# systemctl status apache2 

● apache2.service - LSB: Apache2 web server
 Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
 Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: active (running) since dim. 2016-06-19 21:10:09 CEST; 2min 44s ago
Docs: man:systemd-sysv-generator(8)      
 CGroup: /system.slice/apache2.service       
 ├─20559 /usr/sbin/apache2 -k start      
 ├─20562 /usr/sbin/apache2 -k start      
 └─20563 /usr/sbin/apache2 -k start      
juin 19 21:10:08 Glpi systemd[1]: Starting LSB: Apache2 web server...        
juin 19 21:10:08 Glpi apache2[20534]: * Starting Apache httpd web server apache2         
juin 19 21:10:09 Glpi apache2[20534]: *      
juin 19 21:10:09 Glpi systemd[1]: Started LSB: Apache2 web server. 

S’il n’est pas démarré, on utilise systemctl pour le lancer :

root@Glpi:/home/ritek# systemctl status apache2          
● apache2.service - LSB: Apache2 web server      
 Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)       
 Drop-In: /lib/systemd/system/apache2.service.d      
 └─apache2-systemd.conf      
 Active: active (running) since dim. 2016-06-19 21:10:09 CEST; 2min 44s ago      
 Docs: man:systemd-sysv-generator(8)         
 CGroup: /system.slice/apache2.service       
 ├─20559 /usr/sbin/apache2 -k start      
 ├─20562 /usr/sbin/apache2 -k start      
 └─20563 /usr/sbin/apache2 -k start      
juin 19 21:10:08 Glpi systemd[1]: Starting LSB: Apache2 web server...        
juin 19 21:10:08 Glpi apache2[20534]: * Starting Apache httpd web server apache2         
juin 19 21:10:09 Glpi apache2[20534]: *      
juin 19 21:10:09 Glpi systemd[1]: Started LSB: Apache2 web server.       

Par la même occasion on active le démarrage auto au reboot

root@Glpi:/home/ritek# systemctl enable apache2      
apache2.service is not a native service, redirecting to systemd-sysv-install         
Executing /lib/systemd/systemd-sysv-install enable apache2       

Step 3: Installation de MariaDB

apt-get install mariadb-server mariadb-client        
systemctl status mysql       
● mysql.service - LSB: Start and stop the mysql database server daemon       
 Loaded: loaded (/etc/init.d/mysql; bad; vendor preset: enabled)         
 Active: active (running) since dim. 2016-06-19 22:39:15 CEST; 3min 2s ago       
 Docs: man:systemd-sysv-generator(8)         
 CGroup: /system.slice/mysql.service         
 ├─22586 /bin/bash /usr/bin/mysqld_safe      
 ├─22587 logger -p daemon err -t /etc/init.d/mysql -i        
 ├─22731 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --skip-log-error --pid-fil         
 └─22732 logger -t mysqld -p daemon error        
juin 19 22:39:16 Glpi /etc/mysql/debian-start[22783]: mysql.column_stats OK      
juin 19 22:39:16 Glpi /etc/mysql/debian-start[22783]: mysql.columns_priv OK      
juin 19 22:39:16 Glpi /etc/mysql/debian-start[22783]: mysql.db OK        
juin 19 22:39:16 Glpi /etc/mysql/debian-start[22783]: mysql.event OK         
juin 19 22:39:16 Glpi /etc/mysql/debian-start[22783]: mysql.func OK      
juin 19 22:39:16 Glpi /etc/mysql/debian-start[22783]: mysql.gtid_slave_pos OK        
juin 19 22:39:16 Glpi /etc/mysql/debian-start[22783]: mysql.help_category OK         
juin 19 22:39:16 Glpi /etc/mysql/debian-start[22783]: mysql.help_keyword OK      
juin 19 22:39:16 Glpi /etc/mysql/debian-start[22783]: mysql.help_relation OK         
juin 19 22:39:16 Glpi /etc/mysql/debian-start[22837]: Triggering myisam-recover for all MyISAM tables and aria-recover for all Aria tables       

Pour activer le démarrage de MariaDB au boot :

root@Glpi:/home/ritek# systemctl enable mysql        
mysql.service is not a native service, redirecting to systemd-sysv-install       
Executing /lib/systemd/systemd-sysv-install enable mysql         
root@Glpi:/home/ritek# mysql -u root -p      
Enter password:          
Welcome to the MariaDB monitor. Commands end with ; or g.        
Your MariaDB connection id is 50         
Server version: 10.0.25-MariaDB-0ubuntu0.16.04.1 Ubuntu 16.04        
Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.         
Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.         
MariaDB [(none)]> create database glpi;      
MariaDB [(none)]> GRANT ALL PRIVILEGES ON `glpi` .* TO 'glpiuser'@'localhost' IDENTIFIED BY 'pwdglpiuser';       
MariaDB [(none)]> quit;      

Step 4: Installation PHP7

apt-get install php-common php7.0 php7.0-cli php7.0-common php7.0-fpm php7.0-json php7.0-opcache php7.0-readline php7.0-mysql php7.0-gd libapache2-mod-php7.0 php-mbstring php7.0-curl php7.0-ldap php7.0-imap php-xml   

On voit passer ca :

Creating config file /etc/php/7.0/apache2/php.ini with new version       
Module mpm_event disabled.       
Enabling module mpm_prefork.         
apache2_switch_mpm Switch to prefork         
apache2_invoke: Enable module php7.0         

qui rassure et qui évite l’erreur suivante :
Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe. You need to recompile PHP.
AH00013: Pre-configuration failed
httpd.service: control process exited, code=exited status=1
si vous avez cette erreur
sudo a2dismod mpm_event
et on active prefork
sudo a2enmod mpm_prefork

root@Glpi:/home/ritek# systemctl status php7.0-fpm       
● php7.0-fpm.service - The PHP 7.0 FastCGI Process Manager       
 Loaded: loaded (/lib/systemd/system/php7.0-fpm.service; enabled; vendor preset: enabled)        
 Active: active (running) since dim. 2016-06-19 23:13:47 CEST; 3min 43s ago     
 Process: 997 ExecStartPre=/usr/lib/php/php7.0-fpm-checkconf (code=exited, status=0/SUCCESS)         
 Main PID: 1006 (php-fpm7.0)         
 Status: "Processes active: 0, idle: 2, Requests: 0, slow: 0, Traffic: 0req/sec"         
 Tasks: 3        
 Memory: 24.3M       
 CPU: 128ms      
 CGroup: /system.slice/php7.0-fpm.service        
 ├─1006 php-fpm: master process (/etc/php/7.0/fpm/php-fpm.conf)          
 ├─1010 php-fpm: pool www        
 └─1011 php-fpm: pool www        
juin 19 23:13:47 Glpi systemd[1]: Stopped The PHP 7.0 FastCGI Process Manager.       
juin 19 23:13:47 Glpi systemd[1]: Starting The PHP 7.0 FastCGI Process Manager...        
juin 19 23:13:47 Glpi systemd[1]: Started The PHP 7.0 FastCGI Process Manager.       
root@Glpi:/home/ritek# php --version         
PHP 7.0.4-7ubuntu2.1 (cli) ( NTS )       
Copyright (c) 1997-2016 The PHP Group        
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies        
 with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies         
cd /var/www      
wget -c https://github.com/glpi-project/glpi/releases/download/0.90.3/glpi-0.90.3.tar.gz         
tar -xvzf glpi-0.90.3.tar.gz         
root@Glpi:/var/www# chown -R www-data:www-data /var/www/glpi         

root@Glpi:/var/www# cd /etc/apache2/sites-available
root@Glpi:/etc/apache2/sites-available# cp 000-default.conf glpi.conf
root@Glpi:/etc/apache2/sites-available# vim glpi.conf
et vous changez DocumentRoot /var/www/html par
DocumentRoot /var/www/

root@Glpi:/etc/apache2/sites-available# a2dissite 000-default.conf       
Site 000-default disabled.       
To activate the new configuration, you need to run:      
 service apache2 reload      
root@Glpi:/etc/apache2/sites-available# a2ensite glpi.conf       
Enabling site glpi.      
To activate the new configuration, you need to run:      
 service apache2 reload      
root@Glpi:/etc/apache2/sites-available# service apache2 reload       

Step 5: Le VirtualHost et SSL:

On fait un peu le ménage et on optimise quelques bricoles.
Pour des raisons de sécurité, veuillez supprimer le fichier : install/install.php

XIVO OVH

Aller directement à la fin des métadonnées

Aller au début des métadonnées

Préambule

Cet IPBX basé sur Asterisk permet de configurer votre serveur facilement et rapidement.

Prérequis

Pour suivre ce guide, il vous faut :


Installation

Votre serveur est déjà installé. Nous utilisons Debian 7 dans ce guide et partons du principe que vous avez déjà suivi et appliqué les recommandations de la partie sécurisation.

Pour installer Xivo :

Une fois l’installation terminée, l’interface web est accessible via : http://ip_de_votre_serveur/

Il faut effectuer la première partie de l’assistant afin de sécuriser l’accès à l’interface Web  :

  • Le premier écran vous propose de choisir votre langue. Cliquez sur « Suivant » pour aller à l’étape suivante.
  • L’étape suivante vous présente la licence. Lisez-la et acceptez.
  • Le formulaire suivant contient des informations de sécurité et de configuration de votre IPBX :
    • Hostname : Indiquez le nom d’hôte de votre serveur ;
    • Domain name : indiquez le domaine de votre serveur ;
    • Password / Re-enter password : Il s’agit de définir le mot de passe du compte root pour accéder à l’interface Web ;
    • Address : Adresse IP de votre serveur ;
    • Netmask Masque de votre réseau ;
    • Default gateway : la passerelle qui sera utilisée par votre serveur ;
    • DNS Servers : Entrez les serveurs DNS primaire et secondaire à utiliser ;
    • Cliquez sur « Suivant » pour aller à l’étape suivante.

  • Le formulaire suivant permet de définir le nom de la société ainsi que les paramètres des contextes :
    • Entity – Printed name : Le nom de votre société.
    • Internal Calls Context :
      • Printed name : Nom du contexte. Dans ce guide nous laissons les valeurs par défaut.
      • Numbers interval start : Plage de début des extensions. Dans ce guide, nous utilisons 100.
      • Numbers interval end : Plage de fin des extensions. Dans ce guide, nous utilisons 110.
    • Incalls Context :
      • Printed name : Nom du contexte. Dans ce guide, nous laissons les valeurs par défaut.
      • Numbers interval start : Entrez le numéro de votre trunk au format national. Par exemple, dans ce guide, nous mettons 0972320690.
      • Numbers interval end : Laissez ce champ vide.
      • DID length : Format du DDI envoyé via le trunk. Sur un trunk OVH, c’est au format national, il y a donc 10 chiffres.
    • Outcalls context : Nom du contexte pour les appels sortants.

Validez le dernier formulaire pour que la configuration soit effective.

Enregistrement de votre ligne

Pour enregistrer votre trunk sur Xivo :

  • Cliquez sur « Protocole SIP » dans le menu « Gestion des interconnexions« .
  • Cliquez sur l’icône  pour accéder au formulaire d’ajout.

Le formulaire est divisé en plusieurs onglets :

  • Dans l’onglet « Général » :
    • Nom : Mettez le numéro de votre trunk au format international.
    • Identifiant d’authentification : Mettez le numéro de votre trunk au format international.
    • Mot de passe : Le mot de passe du trunk.
    • Nombre d’appels simultanés : Choisissez le nombre d’appels simultanés de votre trunk.
    • Type de connexion : Sélectionnez « Peer« .
    • Type d’adressage IP : Sélectionnez Statique et entrez le domaine de la ligne. Dans notre guide, ce sera siptrunk.ovh.net.
    • Contexte : Sélectionnez le contexte « Appels entrants« .
    • Langue : Choisissez la langue de la ligne.
  • Dans l’onglet « Enregistrement » :
    • Enregistrement : Cochez la case.
    • Transport : Sélectionnez UDP.
    • Nom : Mettez le numéro de votre trunk au format international.
    • Identifiant d’authentification : Mettez le numéro de votre trunk au format international.
    • Mot de passe : Le mot de passe du trunk.
    • Serveur distant : Entrez le domaine de la ligne. Dans notre guide ce sera siptrunk.ovh.net.
    • Port : 5060.
    • Délai d’expiration : Sélectionnez 1800.
  • Dans l’onglet « Signalisation » :
    • DTMF : sélectionnez InBand.
    • Personnaliser les codecs : Cochez la case et sélectionnez les codecs G711 u-law et G711 a-law.
  • Cliquez sur le bouton « Sauvegarder » pour appliquer la configuration.

Pour vérifier que votre trunk est bien enregistré :

  • Entrez la commande sip show registry dans l’invite de commande Asterisk. (Pour lancer l’invite Asterisk, entrez rasterisk dans votre terminal)
vps123*CLI> sip show registry
Host                                    dnsmgr Username       Refresh State                Reg.Time                
siptrunk.ovh.net:5060                   N      003397232069      1785 Registered           Tue, 24 Mar 2015 09:20:24
1 SIP registrations.
  • Vous pouvez vérifiez également dans le Manager :
    • Connectez-vous à votre Espace Client OVH : https://www.ovhtelecom.fr/espaceclient/
    • Cliquez sur le lien « Accéder à l’ancienne interface« .
    • Cliquez sur l’icône « Téléphonie« .
    • Cliquez sur votre « Trunk« .
    • Cliquez sur « Gestion » dans le menu « Navigation« .
    • Cliquez sur « Informations générales« .

Vous obtenez alors l’information du REGISTER :


Création et configuration des utilisateurs

Dans ce guide, nous créons les extensions 100 et 110. Pour ce faire :

  • Cliquez sur « Utilisateurs » dans le menu « Paramètres IPBX« .
  • Cliquez sur  puis « Ajouter« .
  • Le formulaire se décompose en plusieurs onglets :
    • Général :
      • Prénom : Entrez le prénom de l’utilisateur.
      • Nom : Entrez le nom de l’utilisateur .
      • Nom d’appel sortant : Sélectionnez « Personnaliser » et entrez dans le champ le DDI que vous souhaitez présenter au format International.

    • Lignes :
      • Cliquez sur l’icône  pour accéder au formulaire.
      • Laissez les champs par défaut sauf pour Numéro où il faut choisir le numéro de l’extension.

Cliquez sur « Sauvegarder » pour confirmer la configuration.


Configuration du routage des appels entrants

Il faut dans un premier temps déclarer les SDA sur le contexte des appels entrants :

  • Rendez-vous dans le menu « Contextes » dans la catégorie « Configuration IPBX« .
  • Cliquez sur l’icône  sur le contexte « from-extern.
  • Cliquez sur l’onglet « Appels entrants« .
  • Le formulaire est très simple : vous devez indiquer vos DDI au format national et indiquer le début et la fin de la plage.

    Si vous ne possédez qu’un seul DDI, indiquez le uniquement dans le champ « Début de l’intervalle de numéros« .

  • Sélectionnez 10 sur l’onglet « Nb de chiffres reçus« .
  • Cliquez sur « Sauvegarder » pour confirmer la configuration.

La configuration du routage de l’appel sur un service ou une extension du DDI appelé se gère via ces étapes :

  • Cliquez sur « Appels entrants » dans le menu « Gestion des appels« .
  • Cliquez sur  puis « Ajouter« .
  • La configuration se gère dans l’onglet « Général » :
    • SDA : Entrez le DDI au format national.
    • Contexte : Sélectionnez « Appels entrants (from-extern).
    • Destination : Sélectionnez « Utilisateur« .
    • Renvoyez vers : Sélectionnez votre utilisateur.
    • Cliquez sur « Sauvegarder » pour confirmer la configuration.


Configuration des appels sortants

La règle pour les appels sortants permet de définir le dialplan pour utiliser le trunk :

  • Dans le menu « Gestion des appels« , cliquez sur « Appels sortants« .
  • Cliquez sur  pour accéder au formulaire de création.
  • Dans l’onglet « Général » :
    • Nom : Indiquez le nom du dialplan.
    • Contexte : Sélectionnez le contexte « Appels sortants (to extern)« .
    • Interconnexions : Sélectionnez votre trunk.
  • Dans l’onglet « Extensions » : Il y a deux règles à créer, une première pour autoriser les appels sur les numéros de 01 à 07 et une seconde pour les appels sur les numéros 09.
    • Cliquez sur l’icône .
    • Dans le champ extensions, indiquez la macro de la règle.
    • Dans la liste « Stripnum« , sélectionnez 0.
    • Cliquez sur le bouton « Sauvegarder » pour confirmer la création de la règle.
Extension
Description
0[1-7]XXXXXXXX Autorise les appels sur les numéros de 10 chiffres où les deux premiers chiffres sont entre 01 et 07.
09XXXXXXXX Autoriser les appels sur les numéros de 10 chiffres où les deux premiers chiffres sont 09.

XIVO purge db

Purge Logs

Keeping records of personal communications for long periods may be subject to local legislation, to avoid personal data retention. Also, keeping too many records may become resource intensive for the server. To ease the removal of such records, xivo-purge-db is a process that removes old log entries from the database. This allows keeping records for a maximum period and deleting older ones.

By default, xivo-purge-db removes all logs older than a year (365 days). xivo-purge-db is run nightly.

Note

Please check the laws applicable to your country and modify days_to_keep (see below) in the configuration file accordingly.

Tables Purged

The following features are impacted by xivo-purge-db:

More technically, the tables purged by xivo-purge-db are:

  • call_log
  • cel
  • queue_log
  • stat_agent_periodic
  • stat_call_on_queue
  • stat_queue_periodic
  • stat_switchboard_queue

Configuration File

We recommend to override the setting days_to_keep from /etc/xivo-purge-db/config.yml in a new file in /etc/xivo-purge-db/conf.d/.

Warning

Setting days_to_keep to 0 will NOT disable xivo-purge-db, and will remove ALL logs from your system.

See Configuration priority and /etc/xivo-purge-db/config.yml for more details.

Manual Purge

It is possible to purge logs manually. To do so, log on to the target XiVO server and run:

xivo-purge-db

You can specify the number of days of logs to keep. For example, to purge entries older than 365 days:

xivo-purge-db -d 365

Usage of xivo-purge-db:

usage: xivo-purge-db [-h] [-d DAYS_TO_KEEP]

optional arguments:
  -h, --help            show this help message and exit
  -d DAYS_TO_KEEP, --days_to_keep DAYS_TO_KEEP
                        Number of days data will be kept in tables

Maintenance

After an execution of xivo-purge-db, postgresql’s Autovacuum Daemon should perform a VACUUM ANALYZE automatically (after 1 minute). This command marks memory as reusable but does not actually free disk space, which is fine if your disk is not getting full. In the case when xivo-purge-db hasn’t run for a long time (e.g. upgrading to 15.11 or when days_to_keep is decreased), some administrator may want to perform a VACUUM FULL to recover disk space.

Warning

VACUUM FULL will require a service interruption. This may take several hours depending on the size of purged database.

You need to:

$ xivo-service stop
$ sudo -u postgres psql asterisk -c "VACUUM (FULL)"
$ xivo-service start

Archive Plugins

In the case you want to keep archives of the logs removed by xivo-purge-db, you may install plugins to xivo-purge-db that will be run before the purge.

XiVO does not provide any archive plugin. You will need to develop plugins for your own need. If you want to share your plugins, please open a pull request.

Archive Plugins (for Developers)

Each plugin is a Python callable (function or class constructor), that takes a dictionary of configuration as argument. The keys of this dictionary are the keys taken from the configuration file. This allows you to add plugin-specific configuration in /etc/xivo-purge-db/conf.d/.

There is an example plugin in the xivo-purge-db git repo.

Example

Archive name: sample

Purpose: demonstrate how to create your own archive plugin.

Activate Plugin

Each plugin needs to be explicitly enabled in the configuration of xivo-purge-db. Here is an example of file added in /etc/xivo-purge-db/conf.d/:

1
2
3
enabled_plugins:
    archives:
        - sample

sample.py

The following example will be save a file in /tmp/xivo_purge_db.sample with the following content:

Save tables before purge. 365 days to keep!
1
2
3
4
5
 sample_file = '/tmp/xivo_purge_db.sample'

def sample_plugin(config):
    with open(sample_file, 'w') as output:
        output.write('Save tables before purge. {0} days to keep!'.format(config['days_to_keep']))

Install sample plugin

The following setup.py shows an example of a python library that adds a plugin to xivo-purge-db:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
 #!/usr/bin/env python
 # -*- coding: utf-8 -*-

 from setuptools import setup
 from setuptools import find_packages


 setup(
     name='xivo-purge-db-sample-plugin',
     version='0.0.1',

     description='An example program',
     packages=find_packages(),
     entry_points={
         'xivo_purge_db.archives': [
             'sample = xivo_purge_db_sample.sample:sample_plugin',
         ],
     }
 )

XIVO sysconfd

XiVO sysconfd

xivo-sysconfd is the system configuration server for XiVO. It does quite a few different things; here’s a non exhaustive list:

  • configuring network (interfaces, hostname, DNS)
  • configuring high availability
  • staring/stopping/restarting services
  • reloading asterisk configuration
  • sending some events to components (xivo-agentd, xivo-agid and xivo-ctid)

Configuration File

Default location: /etc/xivo/sysconfd.conf. Format: INI.

The default location may be overwritten by the command line options.

Here’s an example of the configuration file:

[general]
xivo_config_path = /etc/xivo
templates_path = /usr/share/xivo-sysconfd/templates
custom_templates_path = /etc/xivo/sysconfd/custom-templates
backup_path = /var/backups/xivo-sysconfd

[resolvconf]
hostname_file = /etc/hostname
hostname_update_cmd = /etc/init.d/hostname.sh start
hosts_file = /etc/hosts
resolvconf_file = /etc/resolv.conf

[network]
interfaces_file = /etc/network/interfaces

[wizard]
templates_path = /usr/share/xivo-config/templates
custom_templates_path = /etc/xivo/custom-templates

[commonconf]
commonconf_file = /etc/xivo/common.conf
commonconf_cmd = /usr/sbin/xivo-update-config
commonconf_monit = /usr/sbin/xivo-monitoring-update

[openssl]
certsdir = /var/lib/xivo/certificates

[monit]
monit_checks_dir = /usr/share/xivo-monitoring/checks
monit_conf_dir = /etc/monit/conf.d

[request_handlers]
synchronous = true

[bus]
username = guest
password = guest
host = localhost
port = 5672
exchange_name = xivo
exchange_type = topic
exchange_durable = true

request_handlers section

synchronous

If this option is true, when xivo-sysconfd receives a request to reload the dialplan for example, it will wait for the dialplan reload to complete before replying to the request.

When this option is false, xivo-sysconfd reply to the request immediately.

Setting this option to false will speed up some operation (for example, editing a user from the web interface or from xivo-confd), but this means that there will be a small delay (up to a few seconds in the worst case) between the time you create your user and the time you can dial successfully its extension.

XIVO service

XiVO service

XiVO has many running services. To restart the whole stack, the xivo-service command can be used to make sure the service is restarted in the right order.

Usage

Show all services status:

xivo-service status

Stop XiVO services:

xivo-service stop

Start XiVO services:

xivo-service start

Restart XiVO services:

xivo-service restart

The commands above will only act upon XiVO services. Appending an argument all will also act upon nginx and postgresql. Example:

xivo-service restart all

UDP port 5060 will be closed while services are restarting.

XIVO proxy

Proxy Configuration

If you use XiVO behind an HTTP proxy, you must do a couple of manipulations for it to work correctly.

apt

Create the /etc/apt/apt.conf.d/90proxy file with the following content:

Acquire::http::Proxy "http://domain\username:password@proxyip:proxyport";

provd

Proxy information is set via the Configuration ‣ Provisioning ‣ General page.

dhcp-update

This step is needed if you use the DHCP server of the XiVO. Otherwise the DHCP configuration won’t be correct.

Proxy information is set via the /etc/xivo/dhcpd-update.conf file.

Edit the file and look for the [proxy] section.

xivo-fetchfw

This step is not needed if you don’t use xivo-fetchfw.

Proxy information is set via the /etc/xivo/xivo-fetchfw.conf file.

Edit the file and look for the [proxy] section.

XIVO ntp

NTP

XiVO has a NTP server, that must be synchronized to a reference server. This can be a public one or customized for specific target networking architecture. XiVO’s NTP server is used by default as NTP server for the devices time reference.

Usage

Show NTP service status:

service ntp status

Stop NTP service:

service ntp stop

Start NTP service:

service ntp start

Restart NTP service:

service ntp restart

Show NTP synchronization status:

ntpq -p

Configuring NTP service

  1. Edit /etc/ntp.conf

  2. Give your NTP reference servers:

    server 192.168.0.1                           # LAN existing NTP Server
    server 0.debian.pool.ntp.org iburst dynamic  # default in ntp.conf
    server 1.debian.pool.ntp.org iburst dynamic  # default in ntp.conf
    
  3. If no reference server to synchronize to, add this to synchronize locally:

    server 127.127.1.0              # local clock (LCL)
    fudge 127.127.1.0 stratum 10    # LCL is not very reliable
    
  4. Restart NTP service

  5. Check NTP synchronization status.

Warning

If #5 shows that NTP doesn’t use NTP configuration in /etc/ntp.conf, maybe have you done a dhclient for one of your network interface and the dhcp server that gave the IP address also gave a NTP server address. Thus you might check if the file /var/lib/ntp/ntp.conf.dhcp exists, if yes, this is used for NTP configuration prior to /etc/ntp.conf. Remove it and restart NTP, check NTP synchronization status, then it should work.

XIVO logs

Log Files

Every XiVO service has its own log file, placed in /var/log.

asterisk

The Asterisk log files are managed by logrotate.

It’s configuration files /etc/logrotate.d/asterisk and /etc/asterisk/logger.conf

The message log level is enabled by default in logger.conf and contains notices, warnings and errors. The full log entry is commented in logger.conf and should only be enabled when verbose debugging is required. Using this option in production would produce VERY large log files.

  • Files location: /var/log/asterisk/*
  • Number of archived files: 15
  • Rotation frequence: Daily

xivo-agentd

  • File location: /var/log/xivo-agentd.log
  • Rotate configuration: /etc/logrotate.d/xivo-agentd
  • Number of archived files: 15
  • Rotation frequence: Daily

xivo-agid

  • File location: /var/log/xivo-agid.log
  • Rotate configuration: /etc/logrotate.d/xivo-agid
  • Number of archived files: 15
  • Rotation frequence: Daily

xivo-amid

  • File location: /var/log/xivo-amid.log
  • Rotate configuration: /etc/logrotate.d/xivo-amid
  • Number of archived files: 15
  • Rotation frequence: Daily

xivo-auth

  • File location: /var/log/xivo-auth.log
  • Rotate configuration: /etc/logrotate.d/xivo-auth
  • Number of archived files: 15
  • Rotation frequence: Daily

xivo-call-logd

  • File location: /var/log/xivo-call-logd.log
  • Rotate configuration: /etc/logrotate.d/xivo-call-logd
  • Number of archived files: 15
  • Rotation frequence: Daily

xivo-confd

  • File location: /var/log/xivo-confd.log
  • Rotate configuration: /etc/logrotate.d/xivo-confd
  • Number of archived files: 15
  • Rotation frequence: Daily

xivo-confgend

The xivo-confgend daemon output is sent to the file specified with the --logfile parameter when launched with twistd.

The file location can be changed by customizing the xivo-confgend.service unit file.

  • File location: /var/log/xivo-confgend.log
  • Rotate configuration: /etc/logrotate.d/xivo-confgend
  • Number of archived files: 15
  • Rotation frequence: Daily

xivo-ctid

  • File location: /var/log/xivo-ctid.log
  • Rotate configuration: /etc/logrotate.d/xivo-ctid
  • Number of archived log files: 15
  • Rotation frequence: Daily

xivo-ctid-ng

  • File location: /var/log/xivo-ctid-ng.log
  • Rotate configuration: /etc/logrotate.d/xivo-ctid-ng
  • Number of archived files: 15
  • Rotation frequence: Daily

xivo-dird

  • File location: /var/log/xivo-dird.log
  • Rotate configuration: /etc/logrotate.d/xivo-dird
  • Number of archived files: 15
  • Rotation frequence: Daily

xivo-dird-phoned

  • File location: /var/log/xivo-dird-phoned.log
  • Rotate configuration: /etc/logrotate.d/xivo-dird-phoned
  • Number of archived files: 15
  • Rotation frequence: Daily

xivo-dxtora

  • File location: /var/log/xivo-dxtora.log
  • Rotate configuration: /etc/logrotate.d/xivo-dxtora
  • Number of archived files: 15
  • Rotation frequence: Daily

xivo-provd

  • File location: /var/log/xivo-provd.log
  • Rotate configuration: /etc/logrotate.d/xivo-provd
  • Number of archived files: 15
  • Rotation frequence: Daily

xivo-purge-db

  • File location: /var/log/xivo-purge-db.log
  • Rotate configuration: /etc/logrotate.d/xivo-purge-db
  • Number of archived files: 15
  • Rotation frequence: Daily

xivo-stat

  • File location: /var/log/xivo-stat.log
  • Rotate configuration: /etc/logrotate.d/xivo-stat
  • Number of archived files: 15
  • Rotation frequence: Daily

xivo-sysconfd

  • File location: /var/log/xivo-sysconfd.log
  • Rotate configuration: /etc/logrotate.d/xivo-sysconfd
  • Number of archived files: 15
  • Rotation frequence: Daily

xivo-upgrade

  • File location: /var/log/xivo-upgrade.log
  • Rotate configuration: /etc/logrotate.d/xivo-upgrade
  • Number of archived files: 15
  • Rotation frequence: Daily

xivo-web-interface

  • File location: /var/log/xivo-web-interface/*.log
  • Rotate configuration: /etc/logrotate.d/xivo-web-interface
  • Number of archived files: 21
  • Rotation frequence: Daily

xivo-websocketd

  • File location: /var/log/xivo-websocketd.log
  • Rotate configuration: /etc/logrotate.d/xivo-websocketd
  • Number of archived files: 15
  • Rotation frequence: Daily

xivo backup and restore

https://documentation.xivo.solutions/en/2017.03/xivo/system/backup_restore.html

Backup

Periodic backup

A backup of the database and the data are launched every day with a logrotate task. It is run at 06:25 a.m. and backups are kept for 7 days.

Logrotate task:

/etc/logrotate.d/xivo-backup

Logrotate cron:

/etc/cron.daily/logrotate

Retrieve the backup

You can retrieve the backup from the web-interface in Services ‣ IPBX ‣ IPBX Configuration ‣ Backup Files page.

Otherwise, with shell access, you can retrieve them in /var/backups/xivo. In this directory you will find db.tgz and data.tgz files for the database and data backups.

Backup scripts:

/usr/sbin/xivo-backup

Backup location:

/var/backups/xivo

What is actually backed-up?

Data

Here is the list of folders and files that are backed-up:

  • /etc/asterisk/
  • /etc/consul/
  • /etc/crontab
  • /etc/dahdi/
  • /etc/dhcp/
  • /etc/hostname
  • /etc/hosts
  • /etc/ldap/
  • /etc/network/if-up.d/xivo-routes
  • /etc/network/interfaces
  • /etc/ntp.conf
  • /etc/profile.d/xivo_uuid.sh
  • /etc/resolv.conf
  • /etc/ssl/
  • /etc/systemd/
  • /etc/wanpipe/
  • /etc/xivo-agentd/
  • /etc/xivo-agid/
  • /etc/xivo-amid/
  • /etc/xivo-auth/
  • /etc/xivo-call-logd/
  • /etc/xivo-confd/
  • /etc/xivo-confgend-client/
  • /etc/xivo-ctid/
  • /etc/xivo-ctid-ng/
  • /etc/xivo-dird/
  • /etc/xivo-dird-phoned/
  • /etc/xivo-dxtora/
  • /etc/xivo-purge-db/
  • /etc/xivo-websocketd/
  • /etc/xivo/
  • /usr/local/bin/
  • /usr/local/sbin/
  • /usr/share/xivo/XIVO-VERSION
  • /var/lib/asterisk/
  • /var/lib/consul/
  • /var/lib/xivo-provd/
  • /var/lib/xivo/
  • /var/log/asterisk/
  • /var/spool/asterisk/
  • /var/spool/cron/crontabs/

The following files/folders are excluded from this backup:

  • folders:
    • /var/lib/consul/checks
    • /var/lib/consul/raft
    • /var/lib/consul/serf
    • /var/lib/consul/services
    • /var/lib/xivo-provd/plugins/*/var/cache/*
    • /var/spool/asterisk/monitor/
    • /var/spool/asterisk/meetme/
  • files
    • /var/lib/xivo-provd/plugins/xivo-polycom*/var/tftpboot/*.ld
  • log files, coredump files
  • audio recordings
  • and, files greater than 10 MiB or folders containing more than 100 files if they belong to one of these folders:
    • /var/lib/xivo/sounds/
    • /var/lib/asterisk/sounds/custom/
    • /var/lib/asterisk/moh/
    • /var/spool/asterisk/voicemail/
    • /var/spool/asterisk/monitor/

Database

The database asterisk from PostgreSQL is backed up. This include almost everything that is configured via the web interface.

Creating backup files manually

Warning

A backup file may take a lot of space on the disk. You should check the free space on the partition before creating one.

Database

You can manually create a database backup file named db-manual.tgz in /var/tmp by issuing the following commands:

xivo-backup db /var/tmp/db-manual

Files

You can manually create a data backup file named data-manual.tgz in /var/tmp by issuing the following commands:

xivo-backup data /var/tmp/data-manual

Restore

Introduction

A backup of both the configuration files and the database used by a XiVO installation is done automatically every day. These backups are created in the /var/backups/xivo directory and are kept for 7 days.

Limitations

  • You must restore a backup on the same version of XiVO that was backed up (though the architecture – i386 or amd64 – may differ)
  • You must restore a backup on a machine with the same hostname and IP address
  • Be aware that this procedure applies only to XiVO >= 14.08 (see 14.08).
  • XiVO CC configuration files are not backed up. Follow Manual XiVO PBX configuration to restore them.

Before Restoring the System

Warning

Before restoring a XiVO on a fresh install you have to setup XiVO using the wizard (see Running the Wizard section).

Stop monit and all the xivo services:

xivo-service stop

If you want to restore XiVO < 2017.06 that was configured for XiVO CC, you must create PostgreSQL user stats before restoring the database. See Creating user stats.

Restoring System Files

System files are stored in the data.tgz file located in the /var/backups/xivo directory.

This file contains for example, voicemail files, musics, voice guides, phone sets firmwares, provisioning server configuration database.

To restore the file

tar xvfp /var/backups/xivo/data.tgz -C /

Restoring the Database

Warning

  • This will destroy all the current data in your database.
  • You have to check the free space on your system partition before extracting the backups.

Database backups are created as db.tgz files in the /var/backups/xivo directory. These tarballs contains a dump of the database used in XiVO.

In this example, we’ll restore the database from a backup file named db.tgz placed in the home directory of root.

First, extract the content of the db.tgz file into the /var/tmp directory and go inside the newly created directory:

tar xvf db.tgz -C /var/tmp
cd /var/tmp/pg-backup

Drop the asterisk database and restore it with the one from the backup:

sudo -u postgres dropdb asterisk
sudo -u postgres pg_restore -C -d postgres asterisk-*.dump

To finalize the restore, see After Restoring The System.

Troubleshooting

When restoring the database, if you encounter problems related to the system locale, see PostgreSQL localization errors.

Alternative: Restoring and Keeping System Configuration

System configuration like network interfaces is stored in the database. It is possible to keep this configuration and only restore xivo data.

Rename the asterisk database to asterisk_previous:

sudo -u postgres psql -c 'ALTER DATABASE asterisk RENAME TO asterisk_previous'

Restore the asterisk database from the backup:

sudo -u postgres pg_restore -C -d postgres asterisk-*.dump

Restore the system configuration tables from the asterisk_previous database:

sudo -u postgres pg_dump -c -t dhcp -t netiface -t resolvconf asterisk_previous | sudo -u postgres psql asterisk

Drop the asterisk_previous database:

sudo -u postgres dropdb asterisk_previous

Warning

Restoring the data.tgz file also restores system files such as host hostname, network interfaces, etc. You will need to reapply the network configuration if you restore the data.tgz file.

After Restoring The System

Resynchronize the xivo-auth keys:

xivo-update-keys

Update systemd runtime configuration:

source /etc/profile.d/xivo_uuid.sh
systemctl set-environment XIVO_UUID=$XIVO_UUID
systemctl daemon-reload

Restart the services you stopped in the first step:

xivo-service start

You may also reboot the system.

 

 


 

Tuto de forum:

 

#Sauvegarde manuel
xivo-backup db /var/backups/xivo/db-manual
xivo-backup data /var/backups/xivo/data-manual

#Restore

avec Fillezilla:
hote:adresse duxivo
identifiant: root
MdP: celui mis lorsde l’installation
port: 22

#deposer les fichier de restore dans:
/var/backups/xivo/

#stoper les services:
xivo-service stop

#restorer les fichiers:
tar zxvfp /var/backups/xivo/data-type.tgz -C /

#restorer les bases de données
tar xvf /var/backups/xivo/db-type.tgz -C /tmp
cd /tmp/pg-backup

#La base asterisk (le nom du *.dump change en fonction de la version de la sauvegarde)
sudo -u postgres dropdb asterisk
sudo -u postgres pg_restore -C -d postgres asterisk-13.12.dump

#La base Xivo (le nom du *.dump change en fonction de la version de la sauvegarde)
sudo -u postgres dropdb xivo
sudo -u postgres pg_restore -C -d postgres xivo-13.12.dump

#Redemarrer les services
xivo-service start

 

 

backup manuel dans le bon dossier:

/usr/sbin/xivo-backup data /var/backups/xivo/data
/usr/sbin/xivo-backup db /var/backups/xivo/db