Services installés
- Serveur Web Nginx →
/var/www/html - Serveur MySQL (sécurisé) → Identifiants root stockés dans
/root/.cloudzy-creds - PHP & Extensions → Inclut
php-fpm,php-mysql,php-cli,php-curl,php-mbstring,php-xml,php-zip,php-gd
Fichiers et répertoires importants
- Mot de passe root MySQL stocké :
/root/.cloudzy-creds - Répertoire racine web Nginx :
/var/www/html - Fichiers de configuration Nginx :
/etc/nginx - Fichiers de configuration MySQL :
/etc/mysql - Fichiers de base de données MySQL :
/var/lib/mysql - Journaux Nginx :
/var/log/nginx - Journaux MySQL :
/var/log/mysql - Socket PHP-FPM :
/run/php/php-fpm.sock
Accéder à MySQL
Connexion en tant que root :
mysql -u root -p
Le mot de passe est stocké dans /root/.cloudzy-creds.
Commandes courantes :
SHOW DATABASES; -- List all databases
USE <database>; -- Switch to a specific database
CREATE DATABASE mydb; -- Create a new database
CREATE USER 'appuser'@'localhost' IDENTIFIED BY 'password'; -- Create a new user
GRANT ALL PRIVILEGES ON mydb.* TO 'appuser'@'localhost'; -- Grant privileges
EXIT; -- Quit MySQL shell
Accéder à Nginx
Racine web : /var/www/html
Test de configuration :
sudo nginx -t
Accès via le navigateur : http://<SERVER_IP>
Utiliser PHP
Vérifier la version :
php -v
Gestion du service
Nginx :
sudo systemctl status nginx # Check status
sudo systemctl restart nginx # Restart service
MySQL :
sudo systemctl status mysql # Check status
sudo systemctl restart mysql # Restart service
PHP-FPM :
PHP_FPM_VERSION=$(ls /etc/php | grep -E '^[0-9]+.[0-9]+$')
PHP_FPM_SERVICE="php${PHP_FPM_VERSION}-fpm"
systemctl status ${PHP_FPM_SERVICE}
systemctl restart ${PHP_FPM_SERVICE}