« Team Password Manager : Installation » : différence entre les versions
De www.yakakliker.org
(Page créée avec « == Système == === Paramètres génériques === * Après installation du système, veiller à effectuer les mises à jours <code>sudo apt update && sudo apt upgrade -y</code> * Renseigner le fichier '''''/etc/hosts''''' avec le hostname appelé dans l'url ** Editer le fichier '''''/etc/hosts''''' ** <code>Addresse IP hostname teampassword.exemple.lan</code> * Paramétrer le fuseau horaire ** <code>sudo dpkg-reconfigure tzdata</code> <syntaxhighlight lang="bas... ») |
Aucun résumé des modifications |
||
Ligne 29 : | Ligne 29 : | ||
** <code>sudo ufw allow ntp</code> | ** <code>sudo ufw allow ntp</code> | ||
== Installation de Apache == | |||
* Installation du service | * Installation du service | ||
** <code>sudo apt install apache2</code> | ** <code>sudo apt install apache2</code> | ||
Ligne 41 : | Ligne 40 : | ||
** <code>sudo systemctl restart apache2</code> | ** <code>sudo systemctl restart apache2</code> | ||
=== Liens === | |||
* https://httpd.apache.org/docs/2.4/fr/mod/prefork.html | * https://httpd.apache.org/docs/2.4/fr/mod/prefork.html | ||
* https://httpd.apache.org/docs/trunk/fr/mod/event.html | * https://httpd.apache.org/docs/trunk/fr/mod/event.html | ||
== Installation de Mysql == | |||
* Installation du service | * Installation du service | ||
** <code>sudo apt install mysql-server</code> | ** <code>sudo apt install mysql-server</code> | ||
Ligne 55 : | Ligne 52 : | ||
** <code>sudo mysql</code> | ** <code>sudo mysql</code> | ||
== Installation de PHP 8.2 == | |||
* PHP 8.2 n'est pas la version de PHP par défaut sur Ubuntu 22.04 (à vérifier sur Debian 12). Nous avons besoin d'ajouter un repository spécifique. | * PHP 8.2 n'est pas la version de PHP par défaut sur Ubuntu 22.04 (à vérifier sur Debian 12). Nous avons besoin d'ajouter un repository spécifique. | ||
** <code>sudo add-apt-repository ppa:ondrej/php</code> | ** <code>sudo add-apt-repository ppa:ondrej/php</code> | ||
Ligne 81 : | Ligne 77 : | ||
* Lancer un navigateur et se connecter à l'adresse : <nowiki>http://adresseIP/phpinfo.php</nowiki> | * Lancer un navigateur et se connecter à l'adresse : <nowiki>http://adresseIP/phpinfo.php</nowiki> | ||
=== Liens === | |||
* https://tecadmin.net/how-to-install-php-on-debian-12/ | * https://tecadmin.net/how-to-install-php-on-debian-12/ | ||
* https://www.php.net/manual/en/timezones.php | * https://www.php.net/manual/en/timezones.php | ||
== Configuration du serveur Apache pour utiliser Virtual Hosts avec l'installation de Teampassword Manager == | |||
* Créer une entrée DNS pointant sur l'adresse IP du serveur (exemple : teampassword.exemple.lan) | * Créer une entrée DNS pointant sur l'adresse IP du serveur (exemple : teampassword.exemple.lan) | ||
* Configurer un virtualhost Apache pour accepter teampassword.exemple.lan (port 80 & 443) | * Configurer un virtualhost Apache pour accepter teampassword.exemple.lan (port 80 & 443) | ||
Ligne 182 : | Ligne 176 : | ||
** <code>systemctl reload apache2</code> | ** <code>systemctl reload apache2</code> | ||
== Installation du loader SourceGuardian == | |||
* Téléchargement des sources à l'adresse : <nowiki>https://www.sourceguardian.com/loaders.html</nowiki> | * Téléchargement des sources à l'adresse : <nowiki>https://www.sourceguardian.com/loaders.html</nowiki> | ||
* Décompresser le fichier téléchargé et uploader le fichier '''''ixed.8.2.lin''''' dans le dossier '''''/usr/lib/php/20220829''''' | * Décompresser le fichier téléchargé et uploader le fichier '''''ixed.8.2.lin''''' dans le dossier '''''/usr/lib/php/20220829''''' | ||
Ligne 196 : | Ligne 189 : | ||
** Supprimer le fichier phpinfo.php après validation | ** Supprimer le fichier phpinfo.php après validation | ||
== Création de la base de donnée Team Password Manager == | |||
* Informations nécessaires | * Informations nécessaires | ||
** Database: tpm_database | ** Database: tpm_database | ||
Ligne 212 : | Ligne 204 : | ||
** <code>mysql> FLUSH PRIVILEGES;</code> | ** <code>mysql> FLUSH PRIVILEGES;</code> | ||
== Fichiers Team Password Manager == | |||
* Télécharger les sources à cette adresse : <nowiki>https://teampasswordmanager.com/download/</nowiki> | * Télécharger les sources à cette adresse : <nowiki>https://teampasswordmanager.com/download/</nowiki> | ||
** Uploader les fichiers dans le dossier : '''''/var/www/html/teampassword.exemple.lan/public_html''''' | ** Uploader les fichiers dans le dossier : '''''/var/www/html/teampassword.exemple.lan/public_html''''' | ||
Ligne 255 : | Ligne 246 : | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== Script d'installation de Team Password Manager == | |||
* Lancer un navigateur à l'adresse : <nowiki>https://teampassword.exemple.lan/index.php/install</nowiki> | * Lancer un navigateur à l'adresse : <nowiki>https://teampassword.exemple.lan/index.php/install</nowiki> | ||
Version du 4 mars 2025 à 18:21
Système
Paramètres génériques
- Après installation du système, veiller à effectuer les mises à jours
sudo apt update && sudo apt upgrade -y
- Renseigner le fichier /etc/hosts avec le hostname appelé dans l'url
- Editer le fichier /etc/hosts
Addresse IP hostname teampassword.exemple.lan
- Paramétrer le fuseau horaire
sudo dpkg-reconfigure tzdata
Current default time zone: 'Europe/Paris'
Local time is now: Mon Mar 3 14:00:02 CET 2025.
Universal Time is now: Mon Mar 3 13:00:02 UTC 2025.
- Configuration du Firewall & ouverture du port SSH
sudo ufw allow
sudo ufw enable
- Installation de Fail2ban
sudo apt-get install fail2ban
sudo cp /etc/fail2ban/fail2ban.conf /etc/fail2ban/fail2ban.local
- Activation du NTP pour la double authentification
sudo timedatectl set-ntp off
sudo timedatectl set-ntp on
sudo ufw allow ntp
Installation de Apache
- Installation du service
sudo apt install apache2
- Ouverture des ports
sudo ufw allow in "Apache Full"
- Activation de Apache MPM prefork à la place de mpm_event
sudo a2dismod mpm_event
sudo a2enmod mpm_prefork
- Redémarrage du service Apache
sudo systemctl restart apache2
Liens
- https://httpd.apache.org/docs/2.4/fr/mod/prefork.html
- https://httpd.apache.org/docs/trunk/fr/mod/event.html
Installation de Mysql
- Installation du service
sudo apt install mysql-server
- Lancement du script de configuration du serveur
sudo mysql_secure_installation
- Penser à tester la connexion Mysql
sudo mysql
Installation de PHP 8.2
- PHP 8.2 n'est pas la version de PHP par défaut sur Ubuntu 22.04 (à vérifier sur Debian 12). Nous avons besoin d'ajouter un repository spécifique.
sudo add-apt-repository ppa:ondrej/php
sudo apt update
- Installation des modules nécessaires à Teampasswordmanager
sudo apt install php8.2 php8.2-cli php8.2-mysql php8.2-mbstring php8.2-ldap php8.2-curl php8.2-gd php8.2-xml
- Vérification de la version PHP installée
php -v
PHP 8.2.27 (cli) (built: Dec 24 2024 06:29:37) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.27, Copyright (c) Zend Technologies
with Zend OPcache v8.2.27, Copyright (c), by Zend Technologies
- Paramétrage du Timezone PHP
- Editer le fichier /etc/php/8.2/apache2/php.ini
date.timezone = "Europe/Paris"
- Editer le fichier /etc/php/8.2/apache2/php.ini
- Redémarrage du service Apache
sudo systemctl restart apache2
- Pour vérifier la version de PHP installée :
- Créer un fichier phpinfo.php dans /var/www/html/ avec à l'intérieur :
<?php phpinfo();
- Créer un fichier phpinfo.php dans /var/www/html/ avec à l'intérieur :
- Lancer un navigateur et se connecter à l'adresse : http://adresseIP/phpinfo.php
Liens
Configuration du serveur Apache pour utiliser Virtual Hosts avec l'installation de Teampassword Manager
- Créer une entrée DNS pointant sur l'adresse IP du serveur (exemple : teampassword.exemple.lan)
- Configurer un virtualhost Apache pour accepter teampassword.exemple.lan (port 80 & 443)
- Exemple de fichier conf Apache
<Directory /var/www/html/teampassword.exemple.lan/public_html>
Require all granted
AllowOverride All
Options FollowSymLinks
</Directory>
<VirtualHost *:80>
ServerName teampassword.exemple.lan
ServerAlias teampassword.exemple.lan
ServerAdmin info@mycompany.com
DocumentRoot /var/www/html/teampassword.exemple.lan/public_html
ErrorLog /var/www/html/teampassword.exemple.lan/logs/error.log
CustomLog /var/www/html/teampassword.exemple.lan/logs/access.log combined
</VirtualHost>
- Création des dossiers d'installation
sudo mkdir -p /var/www/html/teampassword.exemple.lan/{public_html,logs}
- Attribution des droits
sudo chown -R $USER:$USER /var/www/html/teampassword.exemple.lan/public_html
sudo chmod -R 755 /var/www/html/teampassword.exemple.lan/public_html
- Le résultat doit ressembler à ceci :
myuser@myhostname:/var/www/html/teampassword.exemple.lan$ ls -la
total 16
drwxr-xr-x 4 root root 4096 Oct 24 18:28 .
drwxr-xr-x 3 root root 4096 Oct 24 18:28 ..
drwxr-xr-x 2 root root 4096 Oct 24 18:28 logs
drwxr-xr-x 2 myuser myuser 4096 Oct 24 18:28 public_html
- Activation du site
sudo a2ensite teampassword.exemple.lan
- Désactivation du virtualhost par défaut
sudo a2dissite 000-default.conf
- Rechargement des paramètres Apache
sudo systemctl reload apache2
- Tester l'adresse http://teampassword.exemple.lan qui doit répondre par un Forbidden
Paramétrages HTTPS & Certificats SSL
- Copier les certificats dans le dossier : /etc/apache2/certif/
- Activation du SSL Apache
a2enmod ssl
a2enmod headers
- Redémarrage du service Apache
systemctl restart apache2
- Edition du fichier de configuration /etc/apache2/sites-available/teampassword.exemple.conf
<Directory /var/www/html/teampassword.exemple.lan/public_html>
Require all granted
AllowOverride All
Options FollowSymLinks
</Directory>
<VirtualHost *:80>
ServerName teampassword.exemple.lan
ServerAlias teampassword.exemple.lan
ServerAdmin info@mycompany.com
DocumentRoot /var/www/html/teampassword.exemple.lan/public_html
ErrorLog /var/www/html/teampassword.exemple.lan/logs/error.log
CustomLog /var/www/html/teampassword.exemple.lan/logs/access.log combined
Redirect 301 / https://teampassword.exemple.lan/
</VirtualHost>
<VirtualHost *:443>
ServerAdmin info@mycompany.com
ServerName teampassword.exemple.lan
ServerAlias teampassword.exemple.lan
DocumentRoot /var/www/html/teampassword.exemple.lan/public_html
ErrorLog /var/www/html/teampassword.exemple.lan/logs/error.log
CustomLog /var/www/html/teampassword.exemple.lan/logs/access.log combined
SSLEngine on
SSLCertificateFile /etc/apache2/certif/wildcard.exemple.lan/teampassword.exemple.lan.crt
SSLCertificateKeyFile /etc/apache2/certif/wildcard.exemple.lan/teampassword.exemple.lan.key
SSLCertificateChainFile /etc/apache2/certif/wildcard.exemple.lan/GandiStandardSSLCA2.pem
# HSTS (mod_headers is required) (15768000 seconds = 6 months)
Header always set Strict-Transport-Security "max-age=15768000"
</VirtualHost>
- Rechargement d'Apache
systemctl reload apache2
Installation du loader SourceGuardian
- Téléchargement des sources à l'adresse : https://www.sourceguardian.com/loaders.html
- Décompresser le fichier téléchargé et uploader le fichier ixed.8.2.lin dans le dossier /usr/lib/php/20220829
- Editer le fichier php.ini dans le dossier /etc/php/8.2/apache2/php.ini et ajouter cette ligne après [PHP] :
extension=ixed.8.2.lin
- Redémarrage su service Apache
sudo systemctl restart apache2
- Pour tester, créer un fichier phpinfo.php dans /var/www/html/teampassword.exemple.lan/public_html avec ce contenu :
<?php phpinfo();
- https://teampassword.exemple.lan/phpinfo.php
- Vérifier la section "SourceGuardian"
- Supprimer le fichier phpinfo.php après validation
Création de la base de donnée Team Password Manager
- Informations nécessaires
- Database: tpm_database
- User: tpm_user
- Password: tpmPass%2023
- Se connecter sur Mysql
sudo mysql
- Création de la base
mysql> CREATE DATABASE `tpm_database` CHARACTER SET utf8 COLLATE utf8_unicode_ci;
- Création de l'utilisateur
mysql> CREATE USER 'tpm_user'@'%' IDENTIFIED WITH mysql_native_password BY 'tpmPass%2023';
- Attribution des privilèges
mysql> GRANT ALL ON tpm_database.* TO 'tpm_user'@'%';
mysql> FLUSH PRIVILEGES;
Fichiers Team Password Manager
- Télécharger les sources à cette adresse : https://teampasswordmanager.com/download/
- Uploader les fichiers dans le dossier : /var/www/html/teampassword.exemple.lan/public_html
- Modification des permissions sur les fichiers
sudo chown -R $USER:www-data *
chmod -R 770 *
- Vérification :
$ ls -la
drwxrwxr-x 7 myuser myuser 4096 Oct 24 12:16 .
drwxr-xr-x 4 root root 4096 Oct 24 11:46 ..
-rwxrwx--- 1 myuser www-data 2115 Oct 18 10:44 config.php
drwxrwx--- 3 myuser www-data 4096 Oct 17 08:17 css
-rwxrwx--- 1 myuser www-data 9127 Oct 17 08:17 eula.txt
-rwxrwx--- 1 myuser www-data 610 Oct 17 08:17 folder.php
drwxrwx--- 2 myuser www-data 4096 Oct 17 08:17 import
-rwxrwx--- 1 myuser www-data 21484 Oct 17 08:17 index.php
-rwxrwx--- 1 myuser www-data 10157 Oct 17 08:17 install.txt
-rwxrwx--- 1 myuser www-data 25 Oct 17 08:17 robots.txt
drwxrwx--- 8 myuser www-data 4096 Oct 17 08:17 system
-rwxrwx--- 1 myuser www-data 5063 Oct 17 08:17 upgrade.txt
drwxrwx--- 6 myuser www-data 4096 Oct 19 09:41 uploads
drwxrwx--- 17 myuser www-data 4096 Oct 17 08:17 wmm
Fichier de configuration de Team Password Manager (config.php)
- Editer le fichier config.php
// MySQL Database server
define('CONFIG_HOSTNAME', 'localhost');
// User that accesses the database server, that should have all privileges on the database CONFIG_DATABASE
define('CONFIG_USERNAME', 'tpm_user');
// User password
define('CONFIG_PASSWORD', 'tpmPass%2023');
// Database for Team Password Manager. You must manually create it before installing Team Password Manager
define('CONFIG_DATABASE', 'tpm_database');
Script d'installation de Team Password Manager
- Lancer un navigateur à l'adresse : https://teampassword.exemple.lan/index.php/install