« Plate-forme StNizier E6320 » : différence entre les versions
Ligne 25 : | Ligne 25 : | ||
ServerAdmin webmaster@localhost | ServerAdmin webmaster@localhost | ||
DocumentRoot /var/www/html | DocumentRoot /var/www/html | ||
ErrorLog ${APACHE_LOG_DIR}/error-http-8345.log | ErrorLog ${APACHE_LOG_DIR}/error-http-8345.log | ||
CustomLog ${APACHE_LOG_DIR}/access-http-8345.log combined | CustomLog ${APACHE_LOG_DIR}/access-http-8345.log combined | ||
RewriteEngine off | RewriteEngine off | ||
</VirtualHost> | </VirtualHost> | ||
<VirtualHost *:8345> | <VirtualHost *:8345> | ||
ServerAdmin webmaster@localhost | ServerAdmin webmaster@localhost | ||
DocumentRoot /var/www/html | DocumentRoot /var/www/html | ||
SSLEngine on | SSLEngine on | ||
# SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem | # SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem | ||
Ligne 42 : | Ligne 41 : | ||
SSLCertificateFile /etc/letsencrypt/live/stnizier.bernigaud.eu/fullchain.pem | SSLCertificateFile /etc/letsencrypt/live/stnizier.bernigaud.eu/fullchain.pem | ||
SSLCertificateKeyFile /etc/letsencrypt/live/stnizier.bernigaud.eu/privkey.pem | SSLCertificateKeyFile /etc/letsencrypt/live/stnizier.bernigaud.eu/privkey.pem | ||
ErrorLog ${APACHE_LOG_DIR}/error-https-8345.log | ErrorLog ${APACHE_LOG_DIR}/error-https-8345.log | ||
CustomLog ${APACHE_LOG_DIR}/access-https-8345.log combined | CustomLog ${APACHE_LOG_DIR}/access-https-8345.log combined |
Version du 3 septembre 2025 à 18:04
Configuration du réseau
Suite au changement de box.
Fichiers
sudo nano /etc/ssh/sshd_config
port d'écoute 8345 remplacé par 2222
#Port 8345 Port 2222
les commandes fonctionnent :
ssh -p 2222 192.168.1.20 sftp://francois@192.168.1.20:2222/etc/ssh
En attendant que l'on ait reparamétré le lien entre le nom de domaine et l'ip de la box, j'ai besoin d'accéder à mon wiki, donc j'essaie d'avoir un accès uniquement sur le réseau local.
Pour cela je crée un site-available sur le port 8345 du serveur apache (en me basant sur stnizier.bernigaud.eu.conf
sudo nano /etc/apache2/sites-available/local-8345.conf
<VirtualHost *:8345> ServerAdmin webmaster@localhost DocumentRoot /var/www/html ErrorLog ${APACHE_LOG_DIR}/error-http-8345.log CustomLog ${APACHE_LOG_DIR}/access-http-8345.log combined RewriteEngine off </VirtualHost> <VirtualHost *:8345> ServerAdmin webmaster@localhost DocumentRoot /var/www/html SSLEngine on # SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem # SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key Include /etc/letsencrypt/options-ssl-apache.conf SSLCertificateFile /etc/letsencrypt/live/stnizier.bernigaud.eu/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/stnizier.bernigaud.eu/privkey.pem ErrorLog ${APACHE_LOG_DIR}/error-https-8345.log CustomLog ${APACHE_LOG_DIR}/access-https-8345.log combined RewriteEngine off </VirtualHost>
sudo nano /etc/apache2/ports.conf
Ce que j'ai appris :
Ne pas confondre les ports de la box et ceux du serveur.
Auparavant le port 8345 de la box SFR redirigeait ver le serveur apach sur le port par défaut.
Le port 8345 sur serveur était celui sur lequel ssh écoutait.
Dolibarr
Installation Dolibarr
Gestion des données à StNizier
Serveur NextCloud StNizier
Restauration des bases MySql
Restauration à partir des fichiers de données
A chaque base correspond un répertoire dans /var/lib/mysql
L'utilitaire mysqlcheck permet de vérifier [et corriger ?] le répertoire d'une base dans /var/lib
Restauration des bases du serveur NetInvaders
Depuis le fichier de la VM : /home/francois/Téléchargements/vzdump-lxc-103-2020_07_08-12_12_42
Des exports SQL se trouvent dans /home/francois/Téléchargements/vzdump-lxc-103-2020_07_08-12_12_42/root/
Et également /home/francois/Téléchargements/vzdump-lxc-103-2020_07_08-12_12_42/home/ticsit.sql
Voir aussi tout ce qui se trouve dans /home/
Tester la charge du serveur (si vous avez un accès local ou direct via SSH)
Une fois connecté (même lentement), examinez :
Charge système :
uptime top
Si les valeurs de charge (load average) sont très élevées, cela peut expliquer la lenteur.
Utilisation des ressources :
free -h df -h iostat 1 5
Vérifiez si la mémoire, le disque ou le CPU sont saturés.
Journal système :
journalctl -b dmesg
Regardez si des erreurs de disque, réseau ou autres sont signalées.
Problèmes de réseau
Saturation réseau : Vérifiez si des processus utilisent excessivement la bande passante sur le serveur :
iftop nload
Interfaces réseau :
ip addr ip route
Vérifiez si l'interface principale est configurée correctement et si des changements ont eu lieu.
Firewall ou fail2ban : Des règles peuvent bloquer des connexions ou ralentir leur traitement.
sudo iptables -L sudo systemctl status fail2ban
Désactivation permanente de l'IPv6
Si vous n'avez pas besoin de l'IPv6, désactivez-le de manière permanente en modifiant le fichier de configuration :
sudo nano /etc/sysctl.conf
Ajoutez ces lignes à la fin :
net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1
Appliquez les changements :
sudo sysctl -p
Mise à jour du système le 15-11-2020
Création du fichier de configuration GRUB…
Image Linux trouvée : /boot/vmlinuz-4.15.0-123-generic Image mémoire initiale trouvée : /boot/initrd.img-4.15.0-123-generic Image Linux trouvée : /boot/vmlinuz-4.15.0-122-generic Image mémoire initiale trouvée : /boot/initrd.img-4.15.0-122-generic Image Linux trouvée : /boot/vmlinuz-4.15.0-45-generic Image mémoire initiale trouvée : /boot/initrd.img-4.15.0-45-generic
Found memtest86+ image: /boot/memtest86+.elf Found memtest86+ image: /boot/memtest86+.bin
Ubuntu 16.04.1 LTS (16.04) trouvé sur /dev/sdb5 Ubuntu 18.04.3 LTS (18.04) trouvé sur /dev/sdb7
Administration
Serveur SMTP
Certificat
25 juin 2023 - Expiration du certificat SSL fourni pat let’s encrypt.
Lancement de la commande certbot pour le renouveler.
https://doc.ubuntu-fr.org/tutoriel/securiser_apache2_avec_ssl
francois@E6320:~$ sudo certbot -v --apache
J'ai du ouvrir le port 80 sur la box.
Log :
francois@E6320:~$ sudo certbot
[sudo] Mot de passe de francois :
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Which names would you like to activate HTTPS for?
We recommend selecting either all domains, or all domains in a VirtualHost/server block.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: stnizier.bernigaud.eu
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel): 1
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
An RSA certificate named stnizier.bernigaud.eu already exists. Do you want to
update its key type to ECDSA?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(U)pdate key type/(K)eep existing key type: K
Renewing an existing certificate for stnizier.bernigaud.eu
Certbot failed to authenticate some domains (authenticator: apache). The Certificate Authority reported these problems:
Domain: stnizier.bernigaud.eu
Type: connection
Detail: 78.126.208.45: Fetching http://stnizier.bernigaud.eu/.well-known/acme-challenge/OKeN-Gf0jatYX4q6ch0is3QTerWpg4Gg5W9vIq55jJU: Timeout during connect (likely firewall problem)
Hint: The Certificate Authority failed to verify the temporary Apache configuration changes made by Certbot. Ensure that the listed domains point to this Apache server and that it is accessible from the internet.
Après avoir ouvert le port 80 :
francois@E6320:~$ sudo certbot -v --apache
[sudo] Mot de passe de francois :
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
Which names would you like to activate HTTPS for?
We recommend selecting either all domains, or all domains in a VirtualHost/server block.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: stnizier.bernigaud.eu
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel): 1
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
An RSA certificate named stnizier.bernigaud.eu already exists. Do you want to update its key type to ECDSA?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(U)pdate key type/(K)eep existing key type: K
Certificate is due for renewal, auto-renewing...
Renewing an existing certificate for stnizier.bernigaud.eu
Performing the following challenges:
http-01 challenge for stnizier.bernigaud.eu
Waiting for verification...
Cleaning up challenges
Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/stnizier.bernigaud.eu/fullchain.pem
Key is saved at: /etc/letsencrypt/live/stnizier.bernigaud.eu/privkey.pem
This certificate expires on 2023-09-24.
These files will be updated when the certificate renews.
Certbot has set up a scheduled task to automatically renew this certificate in the background.
Deploying certificate
Deploying Certificate to VirtualHost /etc/apache2/sites-enabled/stnizier.bernigaud.eu-le-ssl.conf
Successfully deployed certificate for stnizier.bernigaud.eu to /etc/apache2/sites-enabled/stnizier.bernigaud.eu-le-ssl.conf
Enhancement redirect was already set.
Your existing certificate has been successfully renewed, and the new certificate has been installed.
Installation SuiteCRM
LemonLDAP
La doc est là :
https://lemonldap-ng.org/documentation/latest/installdeb.html
une ligne importante , la commande sed pour positionner le nom du virtual host
les sites available
francois@FrancoisE6320:/etc/apache2$ ls -l sites-available/
total 20
-rw-r--r-- 1 root root 1332 oct. 10 2018 000-default.conf -rw-r--r-- 1 root root 6338 oct. 10 2018 default-ssl.conf lrwxrwxrwx 1 root root 41 avril 22 2018 handler-apache2.conf -> ../../lemonldap-ng/handler-apache2.X.conf lrwxrwxrwx 1 root root 41 avril 22 2018 manager-apache2.conf -> ../../lemonldap-ng/manager-apache2.X.conf -rw-r--r-- 1 root root 1332 nov. 24 2019 mynewsite.conf lrwxrwxrwx 1 root root 40 avril 22 2018 portal-apache2.conf -> ../../lemonldap-ng/portal-apache2.X.conf -rw-r--r-- 1 root root 1492 oct. 6 15:11 stnizier.bernigaud.eu.conf
les sites-enabled
francois@FrancoisE6320:/etc/apache2$ ls -l sites-enabled/
total 0
lrwxrwxrwx 1 root root 35 mars 14 2019 000-default.conf -> ../sites-available/000-default.conf rwxrwxrwx 1 root root 39 nov. 6 23:30 handler-apache2.conf -> ../sites-available/handler-apache2.conf rwxrwxrwx 1 root root 39 nov. 6 23:29 manager-apache2.conf -> ../sites-available/manager-apache2.conf lrwxrwxrwx 1 root root 33 nov. 24 2019 mynewsite.conf -> ../sites-available/mynewsite.conf lrwxrwxrwx 1 root root 38 nov. 6 23:29 portal-apache2.conf -> ../sites-available/portal-apache2.conf lrwxrwxrwx 1 root root 45 oct. 6 14:46 stnizier.bernigaud.eu.conf -> ../sites-available/stnizier.bernigaud.eu.conf
Autre fichier de conf
à modifier en su : /var/lib/lemonldap-ng/conf/lmConf-1.js
Services web
ZenPhoto
Accès phpmyadmin
https://stnizier.bernigaud.eu/phpmyadmin/index.php
Accès administrateur aux bases de données :
francois / mp pro
Base wp pour MonJournal
base = wordpress, francois / mp pro
Connexion wp : francois / mpPro2022
email laposte
PMB
sudo apt install php-soap
sudo apt install php-sqlite3
BD mysql :
user = pmb
pwd = pmb
Pour le serveur je désigne "localhost"
Connexion
admin
admin
Wordpress
Wordpress comme outil de blog pour mon journal personnel.
Comme pour Nextcloud j'utilise deux noms d'utilisateur pour distinguer mon utilisation de l'administration.
utilisateur, rédacteur d'articles et de pages : francois / vp00n7F!2022 associé à l'email @laposte.net
administrateur : fbernigaud / vp00n7F!2022 associé à l'email @tic-sit.fr
FAQ
Page vs article
Une page est une page de blog, elle apparaît dans la chronologie des publications.
Les articles sont sous les rubriques de menu.