50% rabat alle planer, begrænset periode. Fra kun $2.48/mo
LEMP

LEMP

LEMP er Linux + NGINX + MySQL + PHP. Et alternativ til LAMP med højere gennemstrømning, ideelt til WordPress, Laravel, Symfony og moderne PHP-frameworks. Håndterer 3-4 gange så mange forespørgsler per sekund som LAMP på samme hardware, med et mindre hukommelsesfodaftryk per worker.

Udgave

Seneste

Operativsystem

Ubuntu Server 24.04 LTS, Ubuntu Server 22.04 LTS

Min. RAM

1 GB

IP-typer

IPV4,IPV6

Installerede tjenester

  • Nginx-webserver → /var/www/html
  • MySQL Server (sikret) → Root-legitimationsoplysninger gemt i /root/.cloudzy-creds
  • PHP & udvidelser → Inkluderer php-fpm, php-mysql, php-cli, php-curl, php-mbstring, php-xml, php-zip, php-gd

Vigtige filer og mapper

  • Gemt MySQL root-adgangskode: /root/.cloudzy-creds
  • Nginx web-rodmappe: /var/www/html
  • Nginx konfigurationsfiler: /etc/nginx
  • MySQL konfigurationsfiler: /etc/mysql
  • MySQL databasefiler: /var/lib/mysql
  • Nginx-logs: /var/log/nginx
  • MySQL-logge: /var/log/mysql
  • PHP-FPM-stik: /run/php/php-fpm.sock

Få adgang til MySQL

Log ind som root:

mysql -u root -p

Adgangskode gemmes i /root/.cloudzy-creds.

Almindelige kommandoer:

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

Adgang til Nginx

Webrod: /var/www/html

Konfigurationstest:

sudo nginx -t

Adgang i browser: http://<SERVER_IP>

Brug PHP

Kontroller version:

php -v

Servicestyrring

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}

Mere inden for webhosting

Relaterede apps.

Deploy LEMP nu. Fra $2,48/mdr.