Catatan Linux 01
21.46
1. Buka file konfigurasi Apache
Sumber : http://belajarlinux.com
vi /etc/httpd/conf/httpd.conf2. Tambahkan Listen dengan port tambahan
#3. Tambahkan aturan Virtual Host untuk port tambahan
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, in addition to the default. See also the <VirtualHost>
# 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
NameVirtualHost *:80 *.8080Atau jika menggunakan 2 domain, sedangkan hanya salah satu yang menggunakan port tambahan tersebut
<VirtualHost *:80 *.8080>
DocumentRoot /var/www/html
ServerName belajarlinux.local
ServerAlias belajarlinux.local
</VirtualHost>
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot /var/www/html
ServerName belajarlinux.local
ServerAlias belajarlinux.local
</VirtualHost>
NameVirtualHost *:8080Setelah konfigurasi di atas restart service Apache dan cek dengan netstat -tanp untuk memastikan Apache sudah berjalan pada port tambahan tersebut.
<VirtualHost *.8080>
DocumentRoot /opt/www
ServerName ajiegs.local
ServerAlias ajiegs.local
</VirtualHost>
Sumber : http://belajarlinux.com
0 komentar: