1. Buka file konfigurasi Apache
vi /etc/httpd/conf/httpd.conf
2. Tambahkan Listen dengan port tambahan
#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, in addition to the default. See also the
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses (0.0.0.0)
#
#Listen 12.34.56.78:80
Listen 80
Listen 8080
3. Tambahkan aturan Virtual Host untuk port tambahan
NameVirtualHost *:80 *.8080
DocumentRoot /var/www/html
ServerName belajarlinux.local
ServerAlias belajarlinux.local
Atau jika menggunakan 2 domain, sedangkan hanya salah satu yang menggunakan port tambahan tersebut
NameVirtualHost *:80
DocumentRoot /var/www/html
ServerName belajarlinux.local
ServerAlias belajarlinux.local
NameVirtualHost *:8080
DocumentRoot /opt/www
ServerName ajiegs.local
ServerAlias ajiegs.local
Setelah konfigurasi di atas restart service Apache dan cek dengan netstat -tanp untuk memastikan Apache sudah berjalan pada port tambahan tersebut.
Tidak ada komentar:
Posting Komentar