Selasa, Juli 26, 2016

How to make subdomain in debian

How to make subdomain in debian
Ditulis Oleh Musik Bali
 

Subdomain is a part of domain. subdomain usually use as area from a website. Example, first area school website using www.smktisingaraja.com and in the school will have a skills program like COMPUTER AND NETWORKING ENGINERING so,   tkj.smktisingaraja.com is subdomain that explain about tkj in smktingaraja.com.

before I have ever explain about configure DNS ( Domain Name Server ) and now I wanna give you how to configure subdomain in debian.

make sure the ip address that you will give a domain can be connect to the server

before you continue the steps you have to read how to make a DNS server

HOW TO MAKE A DNS SERVER IN DEBIAN 
 you have to edit in db. budi (db budi is zone reverse ) where like shown bellow. using command nano /etc/bind/db.budi and save using command ctrl + X and then Y and enter
note : tkj and mm is a subdomain with ip address 10.10.10.1
          budi.com is a domain
also edit in db.10 ( db 10 is zone forward ) use command nano /etc/bind/db.10

restart your bind9. service bind9 restart

before you continue make sure you have install web server if you yet install you can read bellow
HOW TO INSTALL WEB SERVER
after you install web server make directori again in /var/www  that is tkj and mm
use command mkdir /var/www/tkj and mkdir /var/www/mm
 write a simple content in your web pages of subdomain tkj and mm
for tkj using command nano /var/www/tkj/index.html
for mm using command nano /var/www/mm/index.html
that all subdomains are well conected now we make a virtualhost edit in nano /etc/apache2/sites-available/default
cause we have 2 subdomain so, we have to write more virtual host or you can also copy the virtual host use ctrl + 6 to mark, alt + 6 to copy and ctrl + u to paste. put it in the very bottom dont forget to write the end tag of virtual host
the first virtual host for subdomain of tkj write the subdomain name tkj,the document root of tkj and the second virtual host for mm and also write the document root and the subdomain name mm
save your work.
restart your web server. service apache2 restart
to see the change cek in your browser 
insert tkj.budi.com in your browser
and for mm.budi.com

Tidak ada komentar:
Write komentar

Add Your Comment

Blog Archive