阿豆的記筆本

Recent site activity

首頁‎ > ‎

Ubuntu

設定 DNS

在中華電信設定的 domain
www.tnhc.org.tw 60.xxx.xxx.130
dns.tnhc.org.tw 60.xxx.xxx.130


DNS Server(Bind)設定檔路徑 /etc/bind/named.conf
在內容加入正反解:

zone "tnhc.org.tw" {
type master;
file "/etc/bind/named.tnhc";
};
zone "xxx.xxx.60.in-addr.arpa" {
type master;
file "/etc/bind/named.60.xxx.xxx.130";
};


/etc/bind/named.conf.options
先備份這個檔案,再把內容清空(小弟不是很了解這個檔案內容的設定,所以才這樣做)

options {
directory "/var/cache/bind";
forwarders {
168.95.1.1; 139.175.10.20; 203.133.1.6;
};
allow-query { any; };
allow-transfer { none; };
};


增加正解檔案:/etc/bind/named.tnhc
內容:

$TTL 600
@ IN SOA @ root.dns.tnhc.org.tw (
2006103002 ; Serial
28800 ; Refresh
14400 ; Retry
720000 ; Expire
86400 ) ; minimum
;
@ IN NS dns.tnhc.org.tw.
@ IN NS www.tnhc.org.tw.
@ IN MX 10 60.xxx.xxx.130
@ IN A 60.xxx.xxx.130
www IN A 60.xxx.xxx.130


增加反解檔案:/etc/bind/named.60.xxx.xxx.xxx
內容:

$TTL 600
@ IN SOA @ root.dns.tnhc.org.tw. (
1 ; Serial
28800 ; Refresh
14400 ; Retry
720000 ; Expire
86400 ) ; minimum
;
@ IN NS dns.tnhc.org.tw.
@ IN NS www.tnhc.org.tw.
130 IN PTR dns.tnhc.org.tw.
130 IN PTR www.tnhc.org.tw.


目前我還不知道,ubuntu 的 bind 記錄檔會寫到那裡
還有不少的疑問,DNS 這塊真的需要了解更深的知識,不然真的很
難發現問題,每過一座山,又會出現一座更高的山...

參考來源:
鳥哥的 DNS 伺服器設定
UbuntuServerTips Bind
好站: DNS查詢 除錯

20080316 補充資訊(使用 bind9):
apt-get install bind9 dnsutils
http://blog.havenlin.org/index.php/archives/541

安裝 lokkit 防火牆

原本是使用 shorewall,但是新版的我不會設定了(有空再來研究囉!)
所以找到了 RedHat 系統的 lokkit,設定上更方便了,效果如何,我就不知道囉!
安裝方法:
sudo apt-get install lokkit

lokkit01
執行:
sudo lokkit ←就會有畫面出現,讓你設定...

lokkit02
設定:
我的 Security Level 設為 High,再加上 Customize 開一些會用到的 port,如 www 80 / smtp 25 ...

加入檔掉 ping 的 iptables 語法:
sudo iptables -A INPUT -p icmp --icmp-type 8 -j DROP ←擋掉全部來的 ping
sudo iptables -A INPUT -p icmp --icmp-type 0 -j ACCEPT ←讓自己可以去 ping 別人

參考來源:
關於Ubuntu 7.04 Desktop的簡易防火牆設定
UbuntuServerTips - # 11.5 Firewall 設定

Apache2 網站伺服器

開放 .htaccess :

Wordpress 的固定網址問題,困惑我一段時間了,終於在剛剛真正解決囉!
原本以為只要掛上 Apache 的 mod_rewrite 就好了,原來還要設定可以載入的目錄。

1. 啟動 Apache2 的 mod_rewirte:
sudo a2enmod rewrite ←啟動 mod_rewrite
sudo /etc/init.d/apache2 restart ←重新啟動 Apache2

參考來源:
http://blog.linym.net/archives/119

2. 設定可以載入 .htaccess 的目錄:
在 /etc/apache2/apache2.conf 的最後面新增以下的內容...
←(這裡是設定讓 .htaccess 可以載入的目錄)
AllowOverride All ←(這個是關鍵的地方...)
Order allow,deny
allow from all
Subpages (1): 桌面相關