Cài đặt bind
sudo apt-get install bind9Thiết lập BIND như là 1 caching server. Có nghĩa là card mạng dùng DNS của BIND dùng DNS của public của DNS nào đó nếu muốn internet
Mở:
/etc/bind/named.conf.optionsThiết lập:
forwarders {
# Phía dưới dùng google DNS. Bạn có thể dùng DNS khác
8.8.8.8;
8.8.4.4;
};Tạo 1 ZONE
Mở:
/etc/bind/named.conf.localThêm 1 zone:
zone "dev.com" {
type master;
file "/etc/bind/db.dev.com";
};Tạo:
/etc/bind/db.dev.comThêm vào:
;
; BIND data file for local loopback interface
;
$TTL 14400
@ IN SOA dev.com. root.dev.com. (
2012091901 ; Serial
86400 ; Refresh
7200 ; Retry
3600000 ; Expire
86400 ) ; Negative Cache TTL
;
@ IN NS dev.com.
@ IN A 127.0.0.1
* IN A 127.0.0.1
@ IN AAAA ::1Khởi động lại BIND
sudo service bind9 restartBước tiếp theo là thiết lập card mạng chúng ta dùng DNS 127.0.0.1
Please google!
Kết tiếp là thiết lập Apache (tạo virtual host) cho tên miền dev.com
<Virtualhost *:80>
ServerName dev.com
ServerAlias *.dev.com
DocumentRoot /home/user/www/dev.com
<directory "/home/user/www/dev.com">
AllowOverride All
Options All
Order allow,deny
Allow from all
</Directory>
ErrorLog /var/log/apache2/dev.com.error.log
CustomLog /var/log/apache2/dev.com.access.log combined
</VirtualHost>
No comments :
Post a Comment