server:installation
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| server:installation [2019/05/09 20:44] – ajout de MariaDB kevin | server:installation [2019/05/12 18:21] (Version actuelle) – [HTTPS] kevin | ||
|---|---|---|---|
| Ligne 346: | Ligne 346: | ||
| </ | </ | ||
| - | < | + | < |
| NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB | NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB | ||
| SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! | SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! | ||
| Ligne 356: | Ligne 356: | ||
| Enter current password for root (enter for none): | Enter current password for root (enter for none): | ||
| - | </ | ||
| - | |||
| - | Appuyer sur la touche Entrée. | ||
| - | |||
| - | <code bash> | ||
| OK, successfully used password, moving on... | OK, successfully used password, moving on... | ||
| Ligne 366: | Ligne 361: | ||
| root user without the proper authorisation. | root user without the proper authorisation. | ||
| - | Set root password? [Y/n] | + | Set root password? [Y/n] y |
| - | </code> | + | New password: |
| - | + | Re-enter new password: | |
| - | Répondre '' | + | |
| - | + | ||
| - | <code bash> | + | |
| - | New password: | + | |
| - | Re-enter new password: | + | |
| Password updated successfully! | Password updated successfully! | ||
| Reloading privilege tables.. | Reloading privilege tables.. | ||
| Ligne 385: | Ligne 375: | ||
| production environment. | production environment. | ||
| - | Remove anonymous users? [Y/n] | + | Remove anonymous users? [Y/n] y |
| - | </ | + | |
| - | + | ||
| - | Répondre '' | + | |
| - | + | ||
| - | <code bash> | + | |
| ... Success! | ... Success! | ||
| Ligne 396: | Ligne 381: | ||
| ensures that someone cannot guess at the root password from the network. | ensures that someone cannot guess at the root password from the network. | ||
| - | Disallow root login remotely? [Y/n] | + | Disallow root login remotely? [Y/n] y |
| - | </ | + | |
| - | + | ||
| - | Répondre '' | + | |
| - | + | ||
| - | <code bash> | + | |
| ... Success! | ... Success! | ||
| Ligne 408: | Ligne 388: | ||
| before moving into a production environment. | before moving into a production environment. | ||
| - | Remove test database and access to it? [Y/n] | + | Remove test database and access to it? [Y/n] y |
| - | </ | + | |
| - | + | ||
| - | Répondre '' | + | |
| - | + | ||
| - | <code bash> | + | |
| - Dropping test database... | - Dropping test database... | ||
| ... Success! | ... Success! | ||
| Ligne 422: | Ligne 397: | ||
| will take effect immediately. | will take effect immediately. | ||
| - | Reload privilege tables now? [Y/n] | + | Reload privilege tables now? [Y/n] y |
| - | </ | + | |
| - | + | ||
| - | Répondre '' | + | |
| - | + | ||
| - | <code bash> | + | |
| ... Success! | ... Success! | ||
| Ligne 439: | Ligne 409: | ||
| MariaDB est dès à présent sécurisé. | MariaDB est dès à présent sécurisé. | ||
| + | |||
| + | === Créer un utilisateur avec tous les privilèges === | ||
| + | <code bash> | ||
| + | sudo mysql | ||
| + | </ | ||
| + | |||
| + | <code sql> | ||
| + | GRANT ALL ON *.* TO ' | ||
| + | </ | ||
| + | <code sql> | ||
| + | FLUSH PRIVILEGES; | ||
| + | </ | ||
| + | <code sql> | ||
| + | QUIT; | ||
| + | </ | ||
| + | |||
| + | ==== Apache ==== | ||
| + | Installer Apache : | ||
| + | <code bash> | ||
| + | sudo apt install apache2 | ||
| + | </ | ||
| + | |||
| + | Ajouter une règle dans le pare-feu (voir [[installation# | ||
| + | <file bash> | ||
| + | # Accept HTTP | ||
| + | -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT | ||
| + | </ | ||
| + | |||
| + | Chemins à connaître : | ||
| + | * Racine des documents : ''/ | ||
| + | * Fichier de configuration : ''/ | ||
| + | * Modules : ''/ | ||
| + | * Virtual hosts : ''/ | ||
| + | * Global configuration fragments : ''/ | ||
| + | |||
| + | === Déplacer le répertoire www === | ||
| + | Copier le répertoire ''/ | ||
| + | <code bash> | ||
| + | sudo cp -r /var/www/ /home/www/ | ||
| + | </ | ||
| + | |||
| + | Il est également possible de copier le répertoire (et les droits associés) avec [[https:// | ||
| + | |||
| + | Remplacer toutes les occurrences de ''/ | ||
| + | * ''/ | ||
| + | * ''/ | ||
| + | * ''/ | ||
| + | |||
| + | Redémarrer Apache : | ||
| + | <code bash> | ||
| + | sudo systemctl restart apache2 | ||
| + | </ | ||
| + | |||
| + | ==== PHP ==== | ||
| + | Installer PHP et plusieurs modules courants : | ||
| + | <code bash> | ||
| + | sudo apt install php libapache2-mod-php php-mysql php-curl php-gd php-intl php-json php-mbstring php-xml php-zip php-sqlite3 php-imagick php-mcrypt php-memcache | ||
| + | </ | ||
| + | |||
| + | Redémarrer Apache : | ||
| + | <code bash> | ||
| + | sudo systemctl restart apache2 | ||
| + | </ | ||
| + | |||
| + | Tester : | ||
| + | <code bash> | ||
| + | sudo nano / | ||
| + | </ | ||
| + | |||
| + | <file php info.php> | ||
| + | <?php | ||
| + | phpinfo(); | ||
| + | </ | ||
| + | |||
| + | ==== phpMyAdmin ==== | ||
| + | Installer phpMyAdmin : | ||
| + | <code bash> | ||
| + | sudo apt install phpmyadmin | ||
| + | </ | ||
| + | |||
| + | FIXME Configurer | ||
| + | |||
| + | Tester le fonctionnement de phpMyAdmin en se rendant sur http:// | ||
| + | |||
| + | S'il n'est pas accessible, il faut modifier la configuration du serveur Apache. | ||
| + | |||
| + | Éditer ''/ | ||
| + | <code bash> | ||
| + | sudo nano / | ||
| + | </ | ||
| + | |||
| + | Ajouter la ligne suivante à la fin du fichier : | ||
| + | <file bash> | ||
| + | Include / | ||
| + | </ | ||
| + | |||
| + | Redémarrer le serveur Apache : | ||
| + | <code bash> | ||
| + | sudo systemctl restart apache2 | ||
| + | </ | ||
| + | |||
| + | ==== HTTPS ==== | ||
| + | Activer le module SSL : | ||
| + | <code bash> | ||
| + | sudo a2enmod ssl | ||
| + | </ | ||
| + | |||
| + | Recharger la configuration d' | ||
| + | <code bash> | ||
| + | sudo systemctl reload apache2 | ||
| + | </ | ||
| + | |||
| + | Finalement, suivre les instructions données [[https:// | ||
| + | |||
| + | <WRAP center round important 60%> | ||
| + | Ne pas oublier d' | ||
| + | </ | ||
| + | |||
| ==== Sources ==== | ==== Sources ==== | ||
| * https:// | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| ===== Divers liens utiles ===== | ===== Divers liens utiles ===== | ||
| * https:// | * https:// | ||
| * https:// | * https:// | ||
server/installation.1557427458.txt.gz · Dernière modification : 2019/05/09 20:44 de kevin
