{"id":5540,"date":"2022-12-01T18:37:14","date_gmt":"2022-12-01T17:37:14","guid":{"rendered":"https:\/\/entropie.org\/3615\/?p=5540"},"modified":"2023-06-23T23:36:07","modified_gmt":"2023-06-23T21:36:07","slug":"installer-un-serveur-lamp-sur-un-vps-sous-debian-11","status":"publish","type":"post","link":"https:\/\/entropie.org\/3615\/index.php\/2022\/12\/01\/installer-un-serveur-lamp-sur-un-vps-sous-debian-11\/","title":{"rendered":"Installer un serveur LAMP sur un VPS sous Debian 11"},"content":{"rendered":"<p>LAMP : Linux \/ Apache \/ MariaDB \/ PHP<\/p>\n<p>Sources :<br \/>\n<a href=\"https:\/\/docs.ovh.com\/fr\/dedicated\/installer-lamp-debian-ubuntu\" rel=\"noopener\" target=\"_blank\">Comment installer un serveur LAMP sous Debian<\/a> (documentation OVH)<br \/>\n<a href=\"https:\/\/www.it-connect.fr\/installer-un-serveur-lamp-linux-apache-mariadb-php-sous-debian-11\/\" rel=\"noopener\" target=\"_blank\">Installer un serveur LAMP (Linux Apache MariaDB PHP) sous Debian 11<\/a><\/p>\n<p><strong>Installer Apache :<\/strong><\/p>\n<p>Voir l&rsquo;<a href=\"https:\/\/entropie.org\/3615\/index.php\/2022\/11\/27\/apache-installation-creation-dhotes-virtuels-certificats-pour-https\/\" rel=\"noopener\" target=\"_blank\">article correspondant<\/a>.<\/p>\n<p><strong>Installer PHP :<\/strong><\/p>\n<p>Voir l&rsquo;<a href=\"https:\/\/entropie.org\/3615\/index.php\/2022\/12\/03\/installer-php-sur-un-vps-sous-debian\/\" rel=\"noopener\" target=\"_blank\">article correspondant<\/a>.<\/p>\n<p><strong>Installer MariaDB :<\/strong><\/p>\n<p>Sources :<br \/>\n<a href=\"https:\/\/www.geek17.com\/fr\/content\/debian-11-bullseye-installer-et-configurer-mariadb-127\" rel=\"noopener\" target=\"_blank\">Debian 11 Bullseye : installer et configurer MariaDB<\/a><\/p>\n<pre>\r\nsudo apt-get update\r\nsudo apt-get install mariadb-server\r\nsudo mysql_secure_installation\r\n<\/pre>\n<pre style=\"font-size:10px;\">\r\nNOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB\r\n      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!\r\n\r\nIn order to log into MariaDB to secure it, we'll need the current\r\npassword for the root user. If you've just installed MariaDB, and\r\nhaven't set the root password yet, you should just press enter here.\r\n\r\nEnter current password for root (enter for none):\r\n<\/pre>\n<p>Appuyer sur Entr\u00e9e.<\/p>\n<pre style=\"font-size:10px;\">\r\nOK, successfully used password, moving on...\r\n\r\nSetting the root password or using the unix_socket ensures that nobody\r\ncan log into the MariaDB root user without the proper authorisation.\r\n\r\nYou already have your root account protected, so you can safely answer 'n'.\r\n\r\nSwitch to unix_socket authentication [Y\/n]\r\n<\/pre>\n<p>Appuyer sur Y.<\/p>\n<pre style=\"font-size:10px;\">\r\nEnabled successfully!\r\nReloading privilege tables..\r\n ... Success!\r\n\r\n\r\nYou already have your root account protected, so you can safely answer 'n'.\r\n\r\nChange the root password? [Y\/n]\r\n<\/pre>\n<p>Appuyer sur Y et choisir un mot de passe root diff\u00e9rent de celui de Debian.<\/p>\n<pre style=\"font-size:10px;\">\r\nNew password: \r\nRe-enter new password: \r\nPassword updated successfully!\r\nReloading privilege tables..\r\n ... Success!\r\n\r\n\r\nBy default, a MariaDB installation has an anonymous user, allowing anyone\r\nto log into MariaDB without having to have a user account created for\r\nthem.  This is intended only for testing, and to make the installation\r\ngo a bit smoother.  You should remove them before moving into a\r\nproduction environment.\r\n\r\nRemove anonymous users? [Y\/n] \r\n<\/pre>\n<p>Appuyer sur Y.<\/p>\n<pre style=\"font-size:10px;\">\r\n ... Success!\r\n\r\nNormally, root should only be allowed to connect from 'localhost'.  This\r\nensures that someone cannot guess at the root password from the network.\r\n\r\nDisallow root login remotely? [Y\/n]\r\n<\/pre>\n<p>Appuyer sur Y.<\/p>\n<pre style=\"font-size:10px;\">\r\n ... Success!\r\n\r\nBy default, MariaDB comes with a database named 'test' that anyone can\r\naccess.  This is also intended only for testing, and should be removed\r\nbefore moving into a production environment.\r\n\r\nRemove test database and access to it? [Y\/n]\r\n<\/pre>\n<p>Appuyer sur Y.<\/p>\n<pre style=\"font-size:10px;\">\r\n - Dropping test database...\r\n ... Success!\r\n - Removing privileges on test database...\r\n ... Success!\r\n\r\nReloading the privilege tables will ensure that all changes made so far\r\nwill take effect immediately.\r\n\r\nReload privilege tables now? [Y\/n]\r\n<\/pre>\n<p>Appuyer sur Y.<\/p>\n<pre style=\"font-size:10px;\">\r\n ... Success!\r\n\r\nCleaning up...\r\n\r\nAll done!  If you've completed all of the above steps, your MariaDB\r\ninstallation should now be secure.\r\n\r\nThanks for using MariaDB!\r\n<\/pre>\n<p>MariaDB est d\u00e9sormais install\u00e9e. On va tester si la connexion \u00e0 la base de donn\u00e9es fonctionne. On entre d&rsquo;abord le mot de passe li\u00e9 \u00e0 sudo puis quand on nous le demande le mot de passe root de MariaDB.<\/p>\n<pre>\r\nsudo mariadb -u root -p\r\nshow databases;\r\n<span style=\"font-size:10px;\">\r\n+--------------------+\r\n| Database           |\r\n+--------------------+\r\n| information_schema |\r\n| mysql              |\r\n| performance_schema |\r\n+--------------------+\r\n3 rows in set (0.001 sec)\r\n<\/span>\r\nexit\r\n<\/pre>\n<p>\u00c0 chaque changement de configuration de MariaDB, Il faut red\u00e9marrer le service :<\/p>\n<pre>\r\nsudo systemctl restart mariadb\r\n<\/pre>\n<p><strong>Installer <a href=\"https:\/\/packages.debian.org\/bullseye\/adminer\" rel=\"noopener\" target=\"_blank\">Adminer<\/a> (pour g\u00e9rer plus facilement mes bases de donn\u00e9es) :<\/strong><\/p>\n<pre>\r\nsudo apt-get update\r\nsudo apt-get install adminer\r\n\r\nLe fichier de configuration Apache pour Adminer est ici :\r\nsudo nano \/etc\/apache2\/conf-available\/adminer.conf\r\nIl contient :\r\n<span style=\"font-size:10px;\">\r\nAlias \/adminer \/etc\/adminer\r\n\r\n&lt;Directory \/etc\/adminer&gt;\r\n        Require all granted\r\n        DirectoryIndex conf.php\r\n&lt;\/Directory&gt;\r\n<\/span>\r\n\r\nsudo a2enconf adminer.conf\r\nsudo systemctl reload apache2\r\n<\/pre>\n<p>Debian 11 installe la version 4.7.9 d&rsquo;Adminer. Pour y acc\u00e9der :<\/p>\n<pre>\r\nhttps:\/\/ [ nom de domaine ] \/adminer\r\n<\/pre>\n<p><a href=\"https:\/\/entropie.org\/3615\/wp-content\/uploads\/2022\/11\/adminer-4.7.9.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/entropie.org\/3615\/wp-content\/uploads\/2022\/11\/adminer-4.7.9.png\" alt=\"\" width=\"660\" height=\"320\" class=\"alignnone size-full wp-image-5743\" srcset=\"https:\/\/entropie.org\/3615\/wp-content\/uploads\/2022\/11\/adminer-4.7.9.png 660w, https:\/\/entropie.org\/3615\/wp-content\/uploads\/2022\/11\/adminer-4.7.9-300x145.png 300w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/a><\/p>\n<p>Attention aux probl\u00e8mes de s\u00e9curit\u00e9 : Une fois en production, il vaut mieux d\u00e9sinstaller Adminer.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>LAMP : Linux \/ Apache \/ MariaDB \/ PHP Sources : Comment installer un serveur LAMP sous Debian (documentation OVH) Installer un serveur LAMP (Linux Apache MariaDB PHP) sous Debian 11 Installer Apache : Voir l&rsquo;article correspondant. Installer PHP : Voir l&rsquo;article correspondant. Installer MariaDB : Sources : Debian 11 Bullseye : installer et configurer &hellip; <a href=\"https:\/\/entropie.org\/3615\/index.php\/2022\/12\/01\/installer-un-serveur-lamp-sur-un-vps-sous-debian-11\/\" class=\"more-link\">Continuer la lecture<span class=\"screen-reader-text\"> de &laquo;&nbsp;Installer un serveur LAMP sur un VPS sous Debian 11&nbsp;&raquo;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22,28,5,53,30],"tags":[],"class_list":["post-5540","post","type-post","status-publish","format-standard","hentry","category-debian","category-installation","category-tutoriels","category-vps","category-web"],"_links":{"self":[{"href":"https:\/\/entropie.org\/3615\/index.php\/wp-json\/wp\/v2\/posts\/5540"}],"collection":[{"href":"https:\/\/entropie.org\/3615\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/entropie.org\/3615\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/entropie.org\/3615\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/entropie.org\/3615\/index.php\/wp-json\/wp\/v2\/comments?post=5540"}],"version-history":[{"count":169,"href":"https:\/\/entropie.org\/3615\/index.php\/wp-json\/wp\/v2\/posts\/5540\/revisions"}],"predecessor-version":[{"id":6261,"href":"https:\/\/entropie.org\/3615\/index.php\/wp-json\/wp\/v2\/posts\/5540\/revisions\/6261"}],"wp:attachment":[{"href":"https:\/\/entropie.org\/3615\/index.php\/wp-json\/wp\/v2\/media?parent=5540"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/entropie.org\/3615\/index.php\/wp-json\/wp\/v2\/categories?post=5540"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/entropie.org\/3615\/index.php\/wp-json\/wp\/v2\/tags?post=5540"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}