Skip to content

Créer le serveur de documentation

Guillaume Lelarge edited this page Aug 11, 2021 · 4 revisions

Voici les différentes étapes pour mettre en place un serveur web proposant la documentation et son moteur de recherche.

Les étapes fonctionnent sur un CentOS 8, installation minimale.

Installation des logiciels divers

dnf install -y epel-release
dnf install -y vim git tar bzip2 tidy

Installation de PostgreSQL

dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm
dnf -qy module disable postgresql
dnf install -y postgresql13-server postgresql13-contrib
systemctl enable postgresql-13
/usr/pgsql-13/bin/postgresql-13-setup initdb
systemctl start postgresql-13

Installation de nginx

dnf -y install nginx php php-pgsql php-fpm
setsebool -P httpd_can_network_connect_db 1
cd /etc/nginx
cp nginx.conf{,.orig}
diff nginx.conf.orig nginx.conf
42c42
<         root         /usr/share/nginx/html;
---
>         root         /var/www/html;
cd /etc/php-fpm.d
cp www.conf{,.orig}
diff www.conf{.orig,}
24c24
< user = apache
---
> user = nginx
26c26
< group = apache
---
> group = nginx
systemctl start php-fpm
systemctl start nginx
firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --list-all
firewall-cmd --reload

Installation du site web

cd /home/guillaume
git clone https://github.com/gleu/pgdocs_fr.git
cd /var/www/html
cp -r ~guillaume/pgdocs_fr/www-docs.postgresql.fr/* .
echo "<?php
\$DSN = \"host=localhost dbname=docspgfr user=docspgfr password=XXXXXXXX\";
?>" > lib/config.php
chown -R nginx:nginx .
chcon -Rt httpd_sys_content_t .

Installation de la base de données

createuser docspgfr
createdb -O docspgfr docspgfr
psql -c "\password docspgfr"
psql -f ~guillaume/pgdocs_fr/www-docs.postgresql.fr/tools/docspgfr_schema.dump -h localhost -U docspgfr docspgfr

Intégration des versions

./tools/addrelease.php -d docspgfr -h localhost -U docspgfr -W 9.5 9.5
./tools/addrelease.php -d docspgfr -h localhost -U docspgfr -W 9.6 9.6
./tools/addrelease.php -d docspgfr -h localhost -U docspgfr -W 10 10
./tools/addrelease.php -d docspgfr -h localhost -U docspgfr -W 11 11
./tools/addrelease.php -d docspgfr -h localhost -U docspgfr -W 12 12
./tools/addrelease.php -d docspgfr -h localhost -U docspgfr -W 13 13

Ne pas oublier d'ajouter l'ordre de chaque version :

UPDATE versions SET ordre=X WHERE version='Y';