Skip to content

Installation de Geonature sur CentOS 7

patricklbs edited this page May 2, 2019 · 8 revisions
	#systemctl disable iptables
	#systemctl stop iptables
	#systemctl stop firewalld
	#systemctl disable firewalld
	#setenforce 0

Préparation de l'environnament

	#useradd geonuser
	#yum install httpd -y
	#usermod -g apache geonuser
	#usermod -a -G root geonuser

IMPORTANT il faut donner les droits de "traverser" à Apache et psql

	$sudo chmod go+rx /home/geonuser

Sudoers

	visudo
	User_Alias ADMINS = geonuser
	ADMINS ALL=(ALL) NOPASSWD: ALL
	#ADMINS ALL=(ALL) ALL

Installation des outils tiers pour la compilation

	sudo yum group install "Development Tools"

Installation de Python 3 et PostgreSQL 11

	sudo yum install -y  rh-python36 rh-python36-python \
rh-python36-python-virtualenv rh-python36-python-setuptools \
rh-python36-python-pip rh-python36-python-devel \
gdal-python gdal-libs gdal-devel
	sudo yum install postgresql11 postgresql11-server postgis25_11 postgresql11-devel gdal-devel -y

Pour raster2pgsql

	sudo yum install -y postgis25_11-client

Configuration PostgreSQL

	sudo /usr/pgsql-11/bin/postgresql-11-setup initdb
	$sudo vi /var/lib/pgsql/11/data/pg_hba.conf
	# TYPE  DATABASE        USER            ADDRESS                 METHOD
	host    all         all         0.0.0.0/0            md5
	# "local" is for Unix domain socket connections only
	local   all             all                                     peer
	$sudo vi /var/lib/pgsql/11/data/postgresql.conf
	# - Connection Settings -
	listen_addresses = '*'          # what IP address(es) to listen on;
	$sudo yum install -y npm supervisor
	
	$sudo systemctl enable supervisord
	$sudo vi /etc/supervisord.conf
	
	[include]
	+files = supervisord.d/*.conf
	-files = supervisord.d/*.ini
	$sudo systemctl start supervisord

Mise à jour des éléments python

IMPORTANT à chaque fois qu'on aura besoin de python 3 il faut rooter l'environnement avec scl

	$scl enable rh-python36 bash
	$ python -V
	Python 3.6.3
	$ sudo /opt/rh/rh-python36/root/usr/bin/pip install --upgrade pip virtualenv virtualenvwrapper

Installation de Geonature

	$sudo yum install wget unzip -y
	geonuser$
	$wget https://github.com/PnX-SI/GeoNature/archive/2.0.1.zip
	$unzip 2.0.1.zip
	$cp -r GeoNature-2.0.1/ geonature

Configuration des settings

	$cp geonature/config/{settings.ini.sample,settings.ini}
	$vi geonature/config/settings.ini