KONFIGURASI VIRTUAL HOST(SUBDOMAIN) DI DEBIAN JESSIE 8.6
Assalamu'alaikum Wr Wb.
Selamat siang kawan hari ini saya akan berbagi sedikit mengenai Konfigurasi Virtual Host di Debian Jessie 8.6
Oke langsung saja..
I.PENGERTIAN
adalah cara untuk mengatur banyak URL di dalam satu IP.
Maksudnya adalah anda bisa masuk pada suatu IP tanpa menuliskan IP nya,
anda hanya perlu menuliskan SubDomain IP tersebut yang telah di tambahkan
dan anda bisa menambahkan lebih dari satu SubDomain sehingga dapat
menghemat IP.
Contoh SubDomain : mail.yahoo.com, mail.google.com.
Maksudnya adalah anda bisa masuk pada suatu IP tanpa menuliskan IP nya,
anda hanya perlu menuliskan SubDomain IP tersebut yang telah di tambahkan
dan anda bisa menambahkan lebih dari satu SubDomain sehingga dapat
menghemat IP.
Contoh SubDomain : mail.yahoo.com, mail.google.com.
II.LATAR BELAKANG
Dapat masuk kedalam suatu IP tanpa harus menulis IP cukup menggunkan subdomain, sehingga dapat menghemat IP.
III.MAKSUD DAN TUJUAN
mengatur banyak URL dialam satu IP Address. Maksudnya anda bisa masuk ke
suatu IP tanpa menulis IP nya, anda cukup menuliskan SubDomain IP tsb
yang telah ditambahkan dan dapat menambahkan lebih dari satu SubDomain
sehingga mampu menghemat IP.
IV.ALAT DAN BAHAN
-laptop/pc
-koneksi internet
-os debian
-koneksi internet
-os debian
V.WAKTU PELAKSANAAN
Waktu yang dibutuhkan untuk konfigurasi virtual host kurang lebih 30 menit
VI.LANGKAH KERJA
1. langkah pertama, server saya remote melalui terminal menggunakan ssh.
* masuk sebagai SuperUser.
* masuk sebagai SuperUser.
2.masukkan perintah
#mkdir /var/www/subdomain
3.kemudian buat file index.html untuk subdomain portal
nano /var/www/subdomainl/index.html
4.isikan pada index.html kurang lebih seperti ini
5. masuk ke direktori VirtualHost (sites-available)
cd /etc/apache2/sites-available
6.copy file default untuk VirtualHost menjadi subportal.conf
cp 000-default.conf subdomain.conf
7.kemudian edit file subportal.conf
nano subdomain.conf
* edit seperti dibawah ini
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerAdmin admin@localhost
ServerName david.net
ServerAlias portal.david.net
DocumentRoot /var/www/subportal
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerAdmin admin@localhost
ServerName david.net
ServerAlias portal.david.net
DocumentRoot /var/www/subportal
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
8.perintah berikut untuk aktifkan Sites/situs
a2ensite subdomain.conf
9.restart apache2
#/etc/init.d/apache2 restart
10.lalu periksa apakah subdomain telah terkonfigurasi atau belum dengan mengetikkansub.sindyzahwa.net
VII.KESIMPULAN
Hasil nya virtual host telah terkonfigurasi dan dapat membuat subdomain.
VIII.REFERENSI
https://translate.google.co.id/translate?hl=id&sl=en&u=https://en.wikipedia.org/wiki/Virtual_hosting&prev=search
- Buku Konfigurasi Server Ver BLC Telkom.pdf
Sekian dari saya, semoga bermanfaat..
Wassalamu'alaikum Wr Wb.
0 komentar