LEMP

De LEMP-stack (Linux, Nginx, MySQL, PHP) zorgt voor snelle, veilige en betrouwbare webhosting.

Geïnstalleerde diensten

  • Nginx-webserver → /var/www/html
  • MySQL Server (beveiligd) → Root-inloggegevens opgeslagen op /root/.cloudzy-creds
  • PHP & Extensies → Inclusief php-fpm, php-mysql, php-cli, php-curl, php-mbstring, php-xml, php-zip, php-gd

Belangrijke bestanden en mappen

  • Opgeslagen MySQL-rootwachtwoord: /root/.cloudzy-creds
  • Nginx web root directory: /var/www/html
  • Nginx-configuratiebestanden: /etc/nginx
  • MySQL-configuratiebestanden: /etc/mysql
  • MySQL-databasebestanden: /var/lib/mysql
  • Nginx-logboeken: /var/log/nginx
  • MySQL-logboeken: /var/log/mysql
  • PHP-FPM-socket: /run/php/php-fpm.sock

Toegang tot MySQL

Log in als root:

mysql -u root -p

Het wachtwoord wordt opgeslagen in /root/.cloudzy-creds.

Veelgebruikte commando's:

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

Toegang tot Nginx

Webroot: /var/www/html

Configuratietest:

sudo nginx -t

Toegang in browser: http://<SERVER_IP>

Gebruik PHP

Controleer versie:

php -v

Servicemanagement

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}

Details van de aanvraag