Stos LLMP (Linux, Lighttpd, MariaDB i PHP-FPM) to lekka i wydajna alternatywa dla popularnego stosu LAMP, idealna dla serwerów VPS o ograniczonych zasobach. W tym poradniku pokażemy, jak zainstalować i skonfigurować LLMP na Ubuntu 22.04.
Wymagania wstępne
- Serwer VPS z systemem Ubuntu 22.04
- Dostęp do konta root lub użytkownika z uprawnieniami sudo
Kroki instalacji
1. Aktualizacja systemu
Zaloguj się na swój serwer VPS i zaktualizuj system:
sudo apt update
sudo apt upgrade -y
2. Instalacja Lighttpd
Zainstaluj serwer WWW Lighttpd:
sudo apt install lighttpd -y
3. Instalacja MariaDB
Zainstaluj serwer baz danych MariaDB:
sudo apt install mariadb-server -y
Zabezpiecz instalację MariaDB:
sudo mysql_secure_installation
Postępuj zgodnie z instrukcjami, aby ustawić hasło roota i inne opcje bezpieczeństwa.
4. Instalacja PHP-FPM
Zainstaluj PHP-FPM oraz niezbędne moduły:
sudo apt install php-fpm php-mysql -y
5. Konfiguracja PHP-FPM dla Lighttpd
Edytuj plik konfiguracyjny PHP-FPM:
sudo nano /etc/php/8.1/fpm/pool.d/www.conf
Zmień następujące linie:
[www]na[lighttpd]user = www-datanauser = lighttpdgroup = www-datanagroup = lighttpdlisten = /run/php/php8.1-fpm.socknalisten = /run/php/php8.1-lighttpd-fpm.sock
Zapisz plik i uruchom ponownie PHP-FPM:
sudo systemctl restart php8.1-fpm
6. Konfiguracja Lighttpd
Włącz moduł FastCGI i proxy w Lighttpd:
sudo lighty-enable-mod fastcgi
sudo lighty-enable-mod proxy
sudo systemctl reload lighttpd
Edytuj plik konfiguracyjny Lighttpd:
sudo nano /etc/lighttpd/lighttpd.conf
Dodaj następującą konfigurację na końcu pliku:
server.modules += ( "mod_fastcgi" )
server.modules += ( "mod_proxy" )
fastcgi.server = ( ".php" =>
((
"socket" => "/run/php/php8.1-lighttpd-fpm.sock",
"bin-path" => "/usr/bin/php-cgi8.1",
"bin-environment" => (
"PHP_FCGI_CHILDREN" => "4",
"PHP_FCGI_MAX_REQUESTS" => "10000"
),
"check-local" => "disable",
"max-procs" => 1,
))
)
index-file.names += ( "index.php" )
url.rewrite-if-not-file = (
"^/(.*)$" => "/index.php/$1"
)
Uruchom ponownie Lighttpd:
sudo systemctl restart lighttpd
7. Testowanie LEMP
Utwórz prosty plik PHP, aby przetestować, czy wszystkie komponenty działają poprawnie:
sudo nano /var/www/html/index.php
Wklej następujący kod do pliku:
<?php
phpinfo();
?>
Zapisz plik i otwórz go w przeglądarce, wpisując adres IP swojego serwera (np. `http://twoj_adres_ip`). Powinieneś zobaczyć stronę z informacjami o konfiguracji PHP.
Podsumowanie
Gratulacje! Udało Ci się zainstalować stos LEMP na swoim serwerze VPS z Ubuntu 22.04. Możesz teraz rozpocząć tworzenie i wdrażanie swoich dynamicznych stron internetowych i aplikacji webowych.
Windows VPS
Windows VPS UK
Windows VPS
VPS Windows
Serwer VPS Windows
VPS Windows Deutschland
Windows VPS Hosting
VPS Windows España
Windows VPS Nederland
VPS Windows Italia
VPS Windows Portugal
VPS Windows Россия
VPS Windows Украина
VPS Windows 日本
VPS Windows Sverige
VPS Windows Norge
VPS Windows عربى
VPS Windows Türkiye
Remote Desktop Services (RDS)
RDS CAL (Client Access License)
Remote Desktop VPS
Keywords: windows vps uk, windows vps, uk windows vps, windows vps hosting uk, vps windows server, uk vps windows, vps windows, servidor vps windows, vps uk windows, vps with windows, virtual private server windows, windows virtual private server, windows vps server uk, vps for windows, servidores vps windows, vps windows uk, windows vps hosting, vps windows hosting, windows vps server, windows virtual private servers, vps on windows, vps windows servers, cheap windows vps uk, windowsvps, windows desktop vps, buy vps windows, windows server vps, windows 10 vps uk, rds services, rds cal, remote desktop services, remote desktop hosting
#windowsvps #vpshosting #ukvps #virtualserver #windowsvpsuk #vpsserver #hostingvps #cloudvps #windowsvpshosting #cheapvps #vpswithwindows #windowsserver #servervps #vpssolutions #vpswindows #rdscal #remotedesktop #remotedesktopvps #rds #windowsrds
vps windows