Layanan yang Telah Diinstal
- Server Web Nginx →
/var/www/html - MySQL Server (terenkripsi) → Kredensial root disimpan di
/root/.cloudzy-creds - PHP & Ekstensi → Termasuk
php-fpm,php-mysql,php-cli,php-curl,php-mbstring,php-xml,php-zip,php-gd
Berkas dan Direktori Penting
- Kata sandi root MySQL yang disimpan:
/root/.cloudzy-creds - Direktori akar web Nginx:
/var/www/html - Berkas konfigurasi Nginx:
/etc/nginx - Berkas konfigurasi MySQL:
/etc/mysql - Berkas basis data MySQL:
/var/lib/mysql - Catatan log Nginx:
/var/log/nginx - Catatan 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 Nginx
Akar web: /var/www/html
Uji konfigurasi:
sudo nginx -t
Akses melalui browser: http://<SERVER_IP>
Gunakan PHP
Periksa versi:
php -v
Manajemen Layanan
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}