Lewati ke konten utama
diskon 50% semua paket, waktu terbatas. Mulai dari $2.48/mo
LAMP

LAMP

LAMP adalah stack klasik Linux + Apache + MySQL + PHP yang sudah terkonfigurasi. Stack web yang menopang sebagian besar internet sepanjang tahun 2000-an dan masih menjalankan WordPress, Joomla, Drupal, serta 80% situs shared-hosting. Pilihan utama untuk aplikasi PHP tradisional.

Sekilas

2.9k

Bintang GitHub

38

Tampilan halaman

320

Instalasi aktif

Lisensi GPL-3.0 Versi Latest OS Ubuntu Server 24.04 LTS, Ubuntu Server 22.04 LTS Min RAM 1 GB IP IPV4,IPV6

Instalasi aktif adalah data sampel (pratinjau); metrik nyata akan terhubung sebelum peluncuran.

Layanan Terinstal

  • Apache Web Server → /var/www/html
  • MySQL Server (diamankan) → Kredensial root tersimpan di /root/.cloudzy-creds
  • PHP & Extensions → Mencakup php-fpm, php-mysql, php-opcache, php-cli, php-curl, php-mbstring, php-xml, php-zip, php-gd

File dan Direktori Penting

  • Password root MySQL yang tersimpan: /root/.cloudzy-creds
  • Direktori web root Apache: /var/www/html
  • File konfigurasi Apache: /etc/apache2
  • File konfigurasi MySQL: /etc/mysql
  • File database MySQL: /var/lib/mysql
  • Log Apache: /var/log/apache2
  • Log MySQL: /var/log/mysql
  • Socket PHP-FPM: /run/php/php-fpm.sock

Akses MySQL

Masuk sebagai root:

mysql -u root -p

Kata sandi disimpan di /root/.cloudzy-creds.

Perintah umum:

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

Akses Apache

Akar web: /var/www/html

Tes konfigurasi:

sudo apache2ctl configtest

Akses di browser: http://<SERVER_IP>

Gunakan PHP

Buat sebuah file /var/www/html/hello.php dengan:

<?php

echo "Hello World!";

?>

Lihat di browser: http://<SERVER_IP>/hello.php

Manajemen Layanan

Apache:

sudo systemctl status apache2    # Check status
sudo systemctl restart apache2   # 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}

Lainnya di Web Hosting

Aplikasi terkait.

Deploy LAMP sekarang. Mulai $2,48/bln.