/etc/httpd/conf/*
/etc/httpd/conf.d/*
Supaya mudah, saya lebih suka meletakkan berkas konfigurasi per host pada direktori /etc/httpd/conf.d/ dan dipisah setiap berkas untuk masing-masing host.
Langkahnya :
- Ubah berkas /etc/httpd/conf/httpd.conf
Tambahkan pada akhir berkas :
NameVirtualHost <alamat-ip-server>:80
- Buat berkas virtual host untuk masing-masing host di /etc/httpd/conf.d/
# vim /etc/httpd/conf.d/contoh.conf
Isikan :
<VirtualHost <alamat-ip-server>:80>
ServerAdmin webmaster@domain.com
DocumentRoot /var/www/html
ServerName www.domain.com
ErrorLog logs/domain-error_log
CustomLog logs/domain-access_log common
</VirtualHost>
- Nyalakan ulang Apache
# service httpd restartSetiap berkas yang berakhiran .conf pada direktori /etc/httpd/conf.d/* akan dibaca dan dimuat oleh Apache web server.
No comments:
Post a Comment