Up to 50% off all plan, limited-time offer. Starting at $2.48.

LEMP

The LEMP stack (Linux, Nginx, MySQL, PHP) powers fast, secure, and reliable web hosting.

Installed Services

  • Nginx Web Server → /var/www/html
  • MySQL Server (secured) → Root credentials stored at /root/.cloudzy-creds
  • PHP & Extensions → Includes php-fpm, php-mysql, php-cli, php-curl, php-mbstring, php-xml, php-zip, php-gd

Important Files & Directories

  • Stored MySQL root password: /root/.cloudzy-creds
  • Nginx web root directory: /var/www/html
  • Nginx configuration files: /etc/nginx
  • MySQL configuration files: /etc/mysql
  • MySQL database files: /var/lib/mysql
  • Nginx logs: /var/log/nginx
  • MySQL logs: /var/log/mysql
  • PHP-FPM socket: /run/php/php-fpm.sock

Access MySQL

Login as root:

mysql -u root -p

Password is stored in /root/.cloudzy-creds.

Common commands:

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

Access Nginx

Web root: /var/www/html

Configuration test:

sudo nginx -t

Access in browser: http://<SERVER_IP>

Use PHP

Check version:

php -v

Service Management

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}

Application Details