Setting SubDomain
Perintah menambah user linux ubuntu :
$user@user:~$ sudo adduser lan
[sudo] password for user:
Adding user `lan’ …
Adding new group `lan’ (1001) …
Adding new user `lan’ (1001) with group `lan’ …
Creating home directory `/home/lan’ …
Copying files from `/etc/skel’ …
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for lan
Enter the new value, or press ENTER for the default
Full Name []: Lokal Area Network
Room Number []: 0
Work Phone []: 12345
Home Phone []: 67890
Other []:
Is the information correct? [Y/n] y
tkjsmk3@tkjsmk3-Kota-Tegal:~$ ls /home
lan root tkjsmk3
tkjsmk3@tkjsmk3-Kota-Tegal:~$
[sudo] password for user:
Adding user `lan’ …
Adding new group `lan’ (1001) …
Adding new user `lan’ (1001) with group `lan’ …
Creating home directory `/home/lan’ …
Copying files from `/etc/skel’ …
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for lan
Enter the new value, or press ENTER for the default
Full Name []: Lokal Area Network
Room Number []: 0
Work Phone []: 12345
Home Phone []: 67890
Other []:
Is the information correct? [Y/n] y
tkjsmk3@tkjsmk3-Kota-Tegal:~$ ls /home
lan root tkjsmk3
tkjsmk3@tkjsmk3-Kota-Tegal:~$
Dengan cara yang sama buat user baru dengan nama user wan perintahnya :
$user@user:~$ sudo adduser wan
Maka isi dari direktory home, untuk menampilkan isi direktory home ( ls /home) :
- lan
- root
- tkj02smk3
- wan
• D• Desktop
• Downloads
• Documents
• Music
• Pictures
• Public
• Templates
• Videos
• examples.desktop
Menyiapkan direktory untuk lokasi website pada setiap user, misalkan website akan ditempatkan pada direktory Public.
$ sudo mkdir /home/lan/Public/html
$ sudo mkdir /home/lan/Public/html/cgi-bin
$ sudo mkdir /home/lan/Public/html/logs
$ sudo mkdir /home/lan/Public/html/cgi-bin
$ sudo mkdir /home/lan/Public/html/logs
Membuat file index.html pada direktory /home/lan/Public/html
$ sudo gedit /home/lan/Public/html/index.html
Website ini
Lokasi : /home/lan/Public/html/
Mengganti hak akses :
$ sudo chmod -R 755 /home/lan/Public/html/
$ sudo chown -R www-data:www-data /home/lan/Public/html/
$ sudo chown -R www-data:www-data /home/lan/Public/html/
Ulangi lagi hal yang sama untuk user wan dan tkj02smk3.
Menyalin file default pada direktory /etc/apache2/sites-available/ ke file dengan nama sesuai subdomain misalkan lan.tkj02smk3.net :
$ sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/lan.tkj02smk3.net
Buat Virtual file lan.tkj02smk3.net :
$ sudo gedit /etc/apache2/sites-available/lan.tkj02smk3.net
DocumentRoot “/home/lan/Public/html/”
ServerName lan.tkj02smk3.net
ServerAdmin tkj02smk3@tkj02smk3.net
ErrorLog /home/lan/Public/html/logs/error.log
Options Indexes FollowSymLinks MultiViews +Includes
AllowOverride None
Order allow,deny
allow from all
Link dengan perintah a2ensite :
$ sudo a2ensite lan.tkj02smk3.net
Buat Virtual file wan.tkj02smk3.net :
$ sudo gedit /etc/apache2/sites-available/wan.tkj02smk3.net
DocumentRoot “/home/wan/Public/html/”
ServerName wan.tkj02smk3.net
ServerAdmin tkj02smk3@tkj02smk3.net
ErrorLog /home/wan/Public/html/logs/error.log
Options Indexes FollowSymLinks MultiViews +Includes
AllowOverride None
Order allow,deny
allow from all
Link dengan perintah a2ensite :
$ sudo a2ensite wan.tkj02smk3.net
Buat Virtual file tkjsmk3.net :
$ sudo gedit /etc/apache2/sites-available/tkjsmk3.net
DocumentRoot “/home/tkjsmk3/Public/html/”
ServerName tkjsmk3.net
ServerAdmin tkjsnk3@tkjsmk3.net
ErrorLog /home/tkjsmk3/Public/html/logs/error.log
Options Indexes FollowSymLinks MultiViews +Includes
AllowOverride None
Order allow,deny
allow from all
Link dengan perintah a2ensite :
$ sudo a2ensite tkjsmk3.net
Restart apache2
$ sudo /etc/init.d/apache2 restart
Konfiguarasi DNS:
Pada terminal, masukkan perintah berikut untuk menginstal dns (Jika belum di Install):
$ sudo apt-get install bind9
Edit /etc/bind/ named.conf.options : (tambahkan DNS IP ISP Anda)
$ sudo gedit /etc/bind/named.conf.options
directory “/var/cache/bind”;
// If there is a firewall between you and nameservers you want
// to talk to, you may need to fix the firewall to allow multiple
// ports to talk. See http://www.kb.cert.org/vuls/id/800113
// If your ISP provided one or more IP addresses for stable
// nameservers, you probably want to use them as forwarders.
// Uncomment the following block, and insert the addresses replacing
// the all-0′s placeholder.
// forwarders {
// 0.0.0.0;
// };
// Menambah IP DNS ISP Anda
// If there is a firewall between you and nameservers you want
// to talk to, you may need to fix the firewall to allow multiple
// ports to talk. See http://www.kb.cert.org/vuls/id/800113
// If your ISP provided one or more IP addresses for stable
// nameservers, you probably want to use them as forwarders.
// Uncomment the following block, and insert the addresses replacing
// the all-0′s placeholder.
// forwarders {
// 0.0.0.0;
// };
// Menambah IP DNS ISP Anda
forwarders {
192.168.1.218;
203.130.193.74;
202.134.0.155;
202.155.0.10;
202.155.0.15; };
192.168.1.218;
203.130.193.74;
202.134.0.155;
202.155.0.10;
202.155.0.15; };
auth-nxdomain no; # conform to RFC1035
listen-on-v6 { any; };
};
listen-on-v6 { any; };
};
Primary Master untuk domain tkj02smk3.net. Edit /etc/bind/named.conf.local:
$ sudo gedit /etc/bind/named.conf.local
//
// Do any local configuration here
//
// Do any local configuration here
//
// Consider adding the 1918 zones here, if they are not used in your
// organization
//include “/etc/bind/zones.rfc1918″;
// organization
//include “/etc/bind/zones.rfc1918″;
zone “tkj02smk3.net” {
type master;
file “/etc/bind/db.tkj02smk3.net”;
};
type master;
file “/etc/bind/db.tkj02smk3.net”;
};
zone “218.168.192.in-addr.arpa” {
type master;
notify no;
file “/etc/bind/db.192″;
};
type master;
notify no;
file “/etc/bind/db.192″;
};
Membuat file /etc /bind/db.tkj02smk3.net :
$ sudo cp /etc/bind/db.local /etc/bind/db.tkj02smk3.net
Edit file /etc/bind/db.tkj02smk3.net
$ sudo gedit /etc/bind/db.tkj02smk3.net
;
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA ns.tkj02smk3.net. root.tkj02smk3.net. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS ns.tkj02smk3.net.
@ IN A 192.168.1.218
@ IN AAAA ::1
@ IN MX 10 mail.tkj02smk3.net.
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA ns.tkj02smk3.net. root.tkj02smk3.net. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS ns.tkj02smk3.net.
@ IN A 192.168.1.218
@ IN AAAA ::1
@ IN MX 10 mail.tkj02smk3.net.
Ns IN A 192.168.1.218
www IN A 192.168.1.218
mail IN A 192.168.1.218
ftp IN A 192.168.1.218
lan IN A 192.168.1.218
wan IN A 192.168.1.218
www IN A 192.168.1.218
mail IN A 192.168.1.218
ftp IN A 192.168.1.218
lan IN A 192.168.1.218
wan IN A 192.168.1.218
Sekarang buat file /etc/bind/db.192 :
$ sudo cp /etc/bind/db.127 /etc/bind/db.192
Edit /etc/bind/db.192 :
$ sudo gedit /etc/bind/db.192
;
; BIND reverse data file for local loopback interface
;
$TTL 604800
@ IN SOA ns.tkj02smk3.net. root.tkj02smk3.net. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS ns.
9 IN PTR ns.tkj02smk3.net.
9 IN PTR www.tkj02smk3.net.
9 IN PTR mail.tkj02smk3.net.
9 IN PTR ftp.tkj02smk3.net.
9 IN PTR lan.tkj02smk3.net.
9 IN PTR wan.tkj02smk3.net.
; BIND reverse data file for local loopback interface
;
$TTL 604800
@ IN SOA ns.tkj02smk3.net. root.tkj02smk3.net. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS ns.
9 IN PTR ns.tkj02smk3.net.
9 IN PTR www.tkj02smk3.net.
9 IN PTR mail.tkj02smk3.net.
9 IN PTR ftp.tkj02smk3.net.
9 IN PTR lan.tkj02smk3.net.
9 IN PTR wan.tkj02smk3.net.
edit /etc/resolv.conf :
$ sudo gedit /etc/resolv.conf
nameserver 192.168.1.218
nameserver 202.134.0.155
nameserver 202.155.0.15
nameserver 202.134.0.155
nameserver 202.155.0.15
Restart BIND9
$ sudo /etc/init.d/bind9 restart
Tidak ada komentar:
Posting Komentar