Apache: Difference between revisions
| Line 26: | Line 26: | ||
sudo apt install -y apache2 apache2-utils | sudo apt install -y apache2 apache2-utils | ||
==Membuat Virtual Host dan directory root== | |||
sudo mkdir -p /var/www/html/test | |||
sudo chown -R $USER:$USER /var/www/html/test | |||
sudo chmod -R 755 /var/www/html/test | |||
Membuat virtual host | |||
sudo vim /etc/apache2/sites-available/test.conf | |||
Copy code berikut pada virtual host | |||
ServerAdmin admin@example.com | |||
ServerName example.com | |||
ServerAlias www.example.com | |||
DocumentRoot /var/www/html/test | |||
ErrorLog ${APACHE_LOG_DIR}/error.log | |||
CustomLog ${APACHE_LOG_DIR}/access.log combined | |||
Setalah selesai, sekarang aktifkan virtula host dengan menggunakan perintah | |||
sudo a2ensite test.conf | |||
sudo systemctl reload apache2 | |||
==Terkait== | ==Terkait== | ||