Yu-Li-Liang 有力量

by Yu-Li-Liang 有力量

2012年1月28日 星期六

Linux 使用 top 看多顆 CPU 使用狀況、PID 狀態


在 Linux 內, 現在都用 htop, 很少用到 top, 不過在沒裝 htop 的機器, 發現少了幾個重要功能, 還是得要從 top 找出來.

top 看多顆 CPU 使用狀況

  1. $ top
  2. 1 # top 進入後, 按 1, 如果有多顆 CPU, 那最上面的 Cpu(s), 就會變 Cpu0, Cpu1 .. 等.

持續監控某 PID 的 CPU / Ram 使用量

  • 假設 PID 是 1122
  • top -p 1122 # 或 watch "ps aux | grep 1122"

相關網頁

  • Using Top More Efficiently Linux article
張貼者: yuliliang 於 上午11:44 沒有留言:
標籤: linux

2012年1月26日 星期四

電腦課筆試題目 -- 上網能力

100學年度第1學期電腦課筆試題目選20題1月13日(星期五)第5節考試,請充分準備
1 ( 4 )      將網際網路的技術應用到企業或校園,對內部人員提供服務的網路稱為 (1) ISP    (2) TCP/IP    (3) Internet    (4) Intranet  
2 ( 1 )     資料通訊中,計算機之間或計算機與終端機之間為相互交換資訊的格式和內容而訂定一套規則,稱為 (1) 通訊協定    (2) 通訊線路    (3) 區域網路    (4) 數據機  
3 ( 1 )     目前台灣三大網路中,以學校及學術研究單位為主所使用的網路為 (1) TANet    (2) SeedNet    (3) HiNet    (4) SiNet  
4 ( 3 )     下列何者是電子郵件軟體的基本功能? (1) 下載檔案    (2) 瀏覽網頁    (3) 寄信及收信    (4) 檔案傳輸  
5 ( 4 )     網頁中可包含哪些內容? (1) 文字    (2) 動畫    (3) 影片    (4) 以上皆是  
6 ( 2 )     只供給台灣地區的學校與研究機關做教學研究用的網路是 (1) HiNet    (2) TANet    (3) SEEDNet    (4) 以上皆是  
7 ( 2 )     WWW是指 (1) 廣域網路    (2) 全球資訊網    (3) 網際網路    (4) 數據機  
8 ( 4 )     下列何者媒介的傳輸速度最快? (1) 電話線    (2) 同軸電纜    (3) 雙絞線電纜    (4) 光纖纜線  
9( 1 )     下列那一個敘述是不正確的? (1) 電腦網路上的軟體不管有無版權皆可拷貝下來使用    (2) 電腦連成網路可提高整體的效益    (3) 網路通訊除了可使用電話線傳輸外,亦可使用光纖    (4) 國際標準化組織的通訊協定分為七層  
10( 1 )     下列那一個敘述是不正確的? (1) 傳真屬於電子郵件的一種    (2) 語言郵件不屬於電子郵件的一種    (3) 利用通訊衛星,可將電子郵件送到世界各地    (4) 電子郵件要寫對方的郵件地址  
11 ( 2 )     下列那一項是電子佈告欄(BBS)提供的功能? (1) 檔案搜尋與下載    (2) 一對一聊天室    (3) 檔案壓縮、解壓縮    (4) 搜尋網頁  
12 ( 3 )     在網際網路上,下列那一項觀念或行為是正確的? (1) 下載的檔案可直接使用    (2) 私人資料曝光沒關係    (3) 不可將通行密碼告訴他人    (4) 亂發廣告信  
13 ( 3 )     為節省檔案下載時間,網路上的軟體,都會事先經過那一項處理? (1) 掃毒    (2) 我的最愛    (3) 壓縮    (4) 解壓縮  
14 ( 2 )     下列那一項是正確的電子郵件地址? (1) www.ctjh.tpc.edu.tw    (2) ct60396@ms1.ctjh.tpc.edu.tw    (3) bbs.nsysu.edu.tw    (4) 203.71.150.253  
15 ( 2 )     FTP主要的功能是什麼? (1) 電子郵件系統    (2) 檔案傳輸服務    (3) 電子佈告欄    (4) 全球資訊網  
16 ( 3 )     下列那一項是在家上網的必備工具? (1) 印表機    (2) 軟碟機    (3) 數據機    (4) 喇叭  
17 ( 1 )     那一種電腦網路型態,不必透過電信單位所提供的傳輸服務,通訊的範圍也受到一定限制,例如在同一個校園之內? (1) 區域網路    (2) 廣域網路    (3) 網際網路    (4) 全球資訊網  
18( 3 )     下列哪一個是正規的網址名稱? (1) www.edu.tcc.tw    (2) edu.tw.tcc.www    (3) www.tcc.edu.tw    (4) tw.tcc.www.edu  
19( 4 )     區域名稱國家分類中tw是代表那個國家? (1) 美國    (2) 德國    (3) 捷克    (4) 台灣  
20 ( 3 )     目前學校接上網際網路的方式為 (1) 電話撥接    (2) 有線電視    (3) 數據專線    (4) 衛星通訊  
21 ( 2 )     下列那一個教育部全球資訊網站 (1) www.kimo.com.tw    (2) www.edu.tw    (3) www.edu.com.tw    (4) www.cpu.edu.tw  
22 ( 4 )     當我們要利用電腦透過電話來傳輸訊息時會用到 (1) 電話機    (2) 數位機    (3) 類比機    (4) 數據機  
23( 2 )     目前常用的Firefox及Internet Explorer軟體主要是提供何種的網路服務資源? (1) FTP    (2) WWW    (3) GOPHER    (4) E-MAIL  
24 ( 3 )     透過網際網路,可將辦公室各部門公文、文件或信函傳達至各收件人的電子信箱內的功能稱為? (1) 電傳會議    (2) 電傳視訊    (3) 電子郵件    (4) 辦公室自動化  
25 ( 2 )     電腦名詞BBS是指? (1) 電子郵件    (2) 電子佈告欄    (3) 區域網路    (4) 網際網路  
26 ( 4 )     小叮噹想利用網際網路和美國的宜靜通信,下列何者是常用的網路通訊方式? (1) WWW    (2) GOPHER    (3) FTP    (4) E-MAIL  
27 ( 1 )     Internet起源於? (1) ARPANET    (2) SWITCH    (3) TANet    (4) SEEDNet  
28 ( 3 )     何者稱為「檔案傳輸協定」? (1) WWW    (2) BBS    (3) FTP    (4) GOPHER  
29 ( 2 )     何者稱為「電子佈告欄」? (1) WWW    (2) BBS    (3) FTP    (4) GOPHER  
30 ( 1 )     英文網域名稱(Domain name)中edu表示何種意義? (1) 教育    (2) 機構    (3) 商業    (4) 政府  
31 ( 4 )     英文網域名稱(Domain name)中gov表示何種意義? (1) 教育    (2) 機構    (3) 商業    (4) 政府  
32 ( 1 )     在網際網路所使用的通訊協定是? (1) TCP/IP    (2) IPX    (3) NetBEUI    (4) ISDN  
33( 3 )     下列何者不是網際網路可提供的服務? (1) E-mail    (2) FTP    (3) 清理    (4) 新聞論壇(News)  
34 ( 2 )     將檔案從別台電腦複製一份至自己的電腦上稱為 (1) 上傳    (2) 下載    (3) 處理    (4) 行銷  
35 ( 4 )     IPv4位址是由四個0到多少以內(含)的數字所組成? (1) 100    (2) 200    (3) 256    (4) 255  
36 ( 1 )     下列何者是錯誤的電腦倫理? (1) 盡量使用他人的電腦資源    (2) 使用電腦時必須表現出對他人的尊重與體諒    (3) 不可侵占他人的智慧成果    (4) 不可拷貝或使用未授權的軟體  
37 ( 1 )     一種結合文字、聲音、影像、動畫等多媒體方式之服務稱之為 (1) WWW    (2) BBS    (3) FTP    (4) GOPHER  
38( 2 )     由網際網路的網址名稱上,我們可判斷出下列何者為教育學術或研究單位 (1) com    (2) edu    (3) gov    (4) net  
39 ( 4 )     Internet為 (1) 廣域網路    (2) 區域網路    (3) 都會網路    (4) 網際網路  
40 ( 2 )     網際網路英文簡稱是 (1) BITNET    (2) Internet    (3) LAN    (4) WAN  
41 ( 4 )     下列何者網路的應用可呈現圖片、語音、動畫的效果 (1) BBS    (2) E-mail    (3) FTP    (4) WWW  
42( 4 )     下列何者是使用電腦網路的優點? (1) 資源共享    (2) 提升通訊的能力    (3) 電子商務    (4) 以上皆是  
43( 3 )     在網際網路上所採用的通訊協定是為 (1) SNA    (2) X25    (3) TCP/IP    (4) DHLC  
44 ( 3 )     下列何種網路的應用專門做為檔案傳輸服務之用 (1) BBS    (2) E-mail    (3) FTP    (4) WWW  
45 ( 3 )     全球資訊網的英文簡稱為 (1) ISDN    (2) NII    (3) WWW    (4) 以上皆非  
46( 2 )     BBS是指 (1) 電子郵件    (2) 電子佈告欄    (3) 檔案傳輸    (4) 網際網路  
47 ( 3 )     ISP是什麼的簡稱 (1) 台灣學術網路    (2) 企業虛擬網路    (3) 網際網路服務提供者    (4) 以上皆非  
48 ( 2 )     TCP/IP是什麼的簡稱 (1) 新世代網際網路計畫    (2) 傳輸控制協定及網際網路協定    (3) 美國國家科學基金會    (4) 以上皆非  
49 ( 2 )     WWW是指 (1) 廣域網路    (2) 全球資訊網    (3) 網際網路    (4) 區域網路 

張貼者: yuliliang 於 上午10:36 沒有留言:
標籤: 教學評量

補助費


除戶

臺北市信義區戶政事務所 除戶登記貼心小提醒

高雄市小港區戶政事務所- 除戶謄本

 

婚喪生育子女教育補助規定一覽表

以本薪(俸)兩倍為基數內涵之試算表

退休資遣

 

 

張貼者: yuliliang 於 上午8:49 沒有留言:
標籤: 樂活

2012年1月19日 星期四

SQUID 3.1Cent OS 6.2


鳥哥的 Linux 私房菜
第十七章、區網控制者: Proxy 伺服器

17.7 參考資料與延伸閱讀

  • squid 官方網站:http://www.squid-cache.org/
  • squid 說明文件計畫:http://squid-docs.sourceforge.net/, http://www.deckle.co.za/squid-users-guide/
  • squid 的驗證流程:http://www.l-penguin.idv.tw/article/proxy-auth.htm
  • 舊版的一些範例參考:http://linux.vbird.org/linux_server/0420squid/0420squid_vbird_ex
  • squid 官網收集的登錄檔分析軟體:http://www.squid-cache.org/Scripts/

squid Proxy 實戰應用剖析

不自量力 の Weithenn: Squid-Web Proxy Server

#vi /usr/local/etc/squid/squid.conf                   //修改 squid 設定檔,內容如下
 http_port 3128                                        //接受 HTTP 要求時使用的 Port
 maximum_object_size 5120 KB                           //設定 Cache 網頁資料最大值 (超過 5MB 就不 Cache)
 acl QUERY urlpath_regex cgi-bin \? \.php \.asp \.cgi  //設定針對 CGI、PHP、ASP 檔案不作 Cache 
 no_cache deny QUERY                                   //設定定義名稱為 QUERY 的項目不作 Cache 
 cache_mem 32 MB                                       //設定存放在 RAM 裡面的 Cache 大小
 cache_dir ufs /usr/local/squid/cache 2048 16 256      //設定 Cache 在 HDD 裡面的大小 (最多使用 2GB、第一層目錄 16MB、第二層 256MB)
 cache_log /usr/local/squid/logs/cache.log             //記錄 Squid 的執行狀況 
 cache_access_log /usr/local/squid/logs/access.log     //記錄 Squid Client 的 HTTP 及 IGP Request
 cache_store_log /usr/local/squid/logs/store.log       //記錄 Squid Cache 哪些網頁資料
 acl all src 0.0.0.0/0.0.0.0                           //Access Control List Source IP 0.0.0.0 Name all
 acl localhost src 127.0.0.1/255.255.255.255           //Source IP 127.0.0.1 Name localhost
 acl lanuser src 192.168.1.0/24                        //Source IP Range 192.168.1.0 Name lanuser
 http_access allow localhost lanuser                   //允許定義名稱 Localhost 及 LanUser 能使用 Squid 服務
 http_access deny all                                  //禁止其它 IP 使用 squid 服務

步驟3.初始化 cache dir 目錄結構

修 改完 Squid 設定檔後若您的 Squid 是第一次安裝的話則請在啟動 Squid Service 之前,必需先進行初始化 Cache Dir 目錄結構 (若是舊版升級的話就不用了,因為初始化會把 Cache 資料清空),請鍵入如下指令來進行初始化 Cache Dir 目錄結構,初始化完成後可至 /usr/local/squid/cache 查看會發現建立許多 Squid Cache 目錄結構 (為之後的 Cache 資料進行分類)
#/usr/local/sbin/squid -z                             //初始化 Cache Dir 目錄結構
 2007/12/18 18:00:59| Creating Swap Directories


 
574 acl all src 0.0.0.0/0.0.0.0
578 acl localhost src 10.0.0.0/8     # RFC1918 possible internal networ          k
579 acl localhost src 172.16.0.0/12  # RFC1918 possible internal networ          k
580 acl localhost src 163.17.209.0/24        # RFC1918 possible interna          l network
639 http_access allow localhost
679 icp_access allow  localhost
 
 701 htcp_access allow localnet
 702 htcp_access deny all

698 htcp_access allow localhost
699 htcp_access deny all

################################## 
#Default:
httpd_accel_host classb.wcjs.tcc.edu.tw
httpd_accel_port 80


#Default:
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
##################################
575 #acl dropit dstdomain "/etc/squid/dropfile.txt"
 576 #擋網站
 577 acl deny_web dstdomain "/etc/squid/deny_web.txt"
 578 #擋特定網頁
 579 acl deny_page url_regex "/etc/squid/deny_page.txt"
 580 #擋特定資訊(字串)
 581 acl deny_word  urlpath_regex  "/etc/squid/deny_word.txt"

 575 ######################################################
 576 #acl dropit dstdomain "/etc/squid/dropfile.txt"
 577 #  deny web site
 578 acl deny_web dstdomain "/etc/squid/deny_web.txt"
 579 #  deny web page
 580 acl deny_page url_regex "/etc/squid/deny_page.txt"
 581 #  deny string
 582 acl deny_word  urlpath_regex  "/etc/squid/deny_word.txt"
 583 #######################################################
##################################

步驟3.初始化 cache dir 目錄結構

修 改完 Squid 設定檔後若您的 Squid 是第一次安裝的話則請在啟動 Squid Service 之前,必需先進行初始化 Cache Dir 目錄結構 (若是舊版升級的話就不用了,因為初始化會把 Cache 資料清空),請鍵入如下指令來進行初始化 Cache Dir 目錄結構,初始化完成後可至 /usr/local/squid/cache 查看會發現建立許多 Squid Cache 目錄結構 (為之後的 Cache 資料進行分類)
 #/usr/local/sbin/squid -z                             //初始化 Cache Dir 目錄結構
 2007/12/18 18:00:59| Creating Swap Directories

步驟4.啟動 squid 服務

在啟動 Squid 服務之前請修改 /etc/rc.conf 以便系統重新開機時能自動帶起 Suqid 服務
 #vi /etc/rc.conf
 squid_enable="YES"                                   //加入此行
在啟動 Squid 服務之前建議先確定 Squid 設定檔的語法是否正確 (沒任何訊息就代表設定檔語法都正確!!),以免造成不可預期的錯誤
 #/usr/local/sbin/squid -f /usr/local/etc/squid/squid.conf -k parse 
鍵入如下指令來啟動 Squid Service
 #/usr/local/etc/rc.d/squid start
 Starting squid.

步驟5.測試 Squid 是否啟動成功

檢查 Squid Process 是否執行
 #ps ax |grep squid
 16954  ??  Is     0:00.00 /usr/local/sbin/squid -D
檢查 Squid 是否 Listen 設定的 HTTP Request Port
 #sockstat | grep 3128
 squid    squid      16956 11 tcp4   *:3128                *:*
檢查 Squid 是否作用了
 #telnet localhost 3128        //假設 Squid 為本機
 GET / [enter]                 //輸入 GET 及反斜線後在按下 Enter
當 Enter 按入後,若你看到一堆 HTML 的輸出,代表您的 Squid 服務成功運作了 Squid Client 可設定瀏覽器來使用 Web Proxy 了,關於如何設定瀏覽器使用 Web Proxy 可參考如下網路資源:
  • [Internet Explorer]
    • [彰基圖書館專用 PROXY 設定說明]
    • [如何設定 Internet Explorer 使用 Proxy 伺服器]
    • [如何為使用代理服務器而配置 Internet Explorer]
  • [FireFox]
    • [How to set up Mozilla Firefox to use proxy server]
  • [Netscape]
    • [臺大醫學院圖書分館 Proxy 設定說明]

Squid 運作後續注意事項

  • 若您修改 Squid 設定檔內容之後又不想重新啟動 Squid 服務可以鍵入下列指令 (請依個人喜好擇一即可)
 #/usr/local/etc/rc.d/squid reload          //squid 重新讀取設定檔 (方法一)
 #/usr/local/sbin/squid -k reconfigure      //squid 重新讀取設定檔 (方法二)
  • 如何查看 Squid 執行狀況
 #less /usr/local/squid/logs/cache.log      //可看到 Squid 目前執行狀況
  • 系統重新啟動或關機前,應先停止 Squid 服務
因為 Squid 對硬碟讀寫很頻繁且會有一堆資料 Cache 在記憶體之中,因此建議您當 Proxy Server 需要重新開機或關機之前請先停止 Squid 服務
 #/usr/local/etc/rc.d/squid stop
  • 定期 Rotate Squid Logs
Squid 相關 Logs (access.log、cache.log、store.log) 在不停運作中若不進行 Rotate Logs 除了 Logs 檔案本身會異常肥大之外也可能造成硬碟空間被佔滿,因此建議設定至排程內來定期將 Rotate Squid Logs
 0 3 * * * /usr/local/sbin/squid -k rotate   //定期於每天早上 3 點 Rotate Logs

Transparent Proxy with NAT Mode

為何要使用 [Transparent Proxy]? 當您設定好 Squid 但內部 User 端有一、二百台電腦難道需要一台一台去設定 User 端瀏覽器使用 Web Proxy? 所以這時便可透過 Transparent Proxy 機制來達成不須設定 User 端也能讓 User 端使用 Web Proxy。

步驟1.修改 squid 設定檔

新版本的 Squid (ex. squid-2.6.17) 將 Transparent Proxy 設定簡化了,簡單說就是把一些功能都整合到 http_port 的 option 內了,至於詳細內容您可參考官網 [Squid 2.6.STABLE8 release notes]
 #vi /usr/local/etc/squid/squid.conf         //修改 squid 設定檔
 http_port 3128                              //預設值
 http_port 3128 transparent                  //修改後,加上 transparent option
舊版本的 Squid (ex. squid-2.5.14_2) 其 Transparent Proxy 設定則為修改 Squid 設定檔並加上如下四行內容
 httpd_accel_host virtual
 httpd_accel_port 80
 httpd_accel_with_proxy on
 httpd_accel_uses_host_header on   

步驟2.修改 NAT 的 RDR 設定

再來就是修改 NAT 中 RDR (Redirect) 設定了,簡單說 LAN User 要對外存取 HTTP (80) 時就導 (Redirect) 到 Squid 主機的 Port 3128 出去。
以下列出在 FreeBSD 中常用的三種 NAT 其 RDR Rule (請自行依網路環境作調整),而此次實作的網路環境如下:
  • Squid IP Address: 192.168.1.10
  • Squid 網卡代號: em0
  • Lan User 網段: 192.168.1.0/24
IPFIREWALL (IPFW)
 /sbin/ipfw add 50000 fwd 192.168.1.10,3128 tcp from 192.168.1.0/24 to any 80
IPFILTER (IPF)
 rdr em0 0.0.0.0/0 port 80 -> 192.168.1.10/32 port 3128 tcp/udp
Packet Filter (PF)
 int_if="em0"
 internal_net="192.168.1.0/24" 
 rdr on $int_if proto tcp from $internal_net to any port 80 -> $int_if port 3128

Transparent Proxy with Bridge Mode

為何要使用 [Transparent Proxy]? 當您設定好 Squid 但內部 User 端有一、二百台電腦難道需要一台一台去設定 User 端瀏覽器使用 Web Proxy? 所以這時便可透過 Transparent Proxy 機制來達成不須設定 User 端也能讓 User 端使用 Web Proxy。
因為此次的 Proxy 角色僅為監控使用者上網行為其擺放位置介於防火牆 (Firewall) 與使用者之間,因此將 Proxy 設定為 Transparent Proxy with Bridge Mode,其網路環境如下:
Juniper SSG20Transparent Proxy with Bridge LAN
WAN Port LAN Port ext_if (bce0)FreeBSD int_if (bce1)End User PCs
61.60.59.58/32192.168.1.1/32192.168.1.10FreeBSD (PF、Squid)192.168.1.20192.168.1.0/24
Gateway 61.60.59.254/32Gateway 192.168.1.1/32Gateway 192.168.1.20/32

步驟1.修改 squid 設定檔

新版本的 Squid (ex. squid-2.6.17) 將 Transparent Proxy 設定簡化了,簡單說就是把一些功能都整合到 http_port 的 option 內了,至於詳細內容您可參考官網 [Squid 2.6.STABLE8 release notes]
 #vi /usr/local/etc/squid/squid.conf         //修改 squid 設定檔
 http_port 3128                              //預設值
 http_port 192.168.1.20:3128 transparent     //修改後,指定 int_if 網卡 IP 並加上 transparent option

步驟2.允許 IP 轉送封包

修改 sysctl.conf 設定檔加入允許 IP 轉送封包功能選項
 #vi /etc/sysctl.conf
 net.inet.ip.forwarding=1                    //加入此行

步驟3.設定網卡為橋接模式 (Bridge Mode)

設定網路卡為橋接模式 (Bridge Mode),因為二張網卡位於同一個 IP 網段內因此與 End User 相連接的網卡其遮罩值必須為 255.255.255.255。
 #vi /etc/rc.conf
 defaultrouter="192.168.1.1"                                                   //設定 Gateway IP
 cloned_interfaces="bridge0"                                                   //設定網卡啟用橋接模式
 ifconfig_bridge0="addm bce0 addm bce1 up"                                     //設定橋接網卡代號
 ifconfig_bce0="inet 192.168.1.10  netmask 255.255.255.0"   #Juniper SSG20     //連接至 Juniper SSG20 LAN Port 的網卡
 ifconfig_bce1="inet 192.168.1.20  netmask 255.255.255.255" #End User          //連接至使用者郡組的網卡 (請注意遮罩設定!!)

步驟4.修改 PF Rules 設定

修 改 PF Rules 中 RDR (Redirect) 設定,簡單說 End User PCs 要對外存取 HTTP (80) 時就導引 (Redirect) 到 Squid 主機的 Port 3128 出去,由於此台 Proxy 僅為監控用途因此對於其它流量一律 Pass All。
 #vi /etc/pf.conf
 ext_if="bce0"
 int_if="bce1"
 rdr on $int_if inet proto tcp from any to any port www -> $int_if port 3128
 pass in all
 pass out all

補充:如何快速分析 access.log

如果您不想安裝分析 Squid Log (access.log) 套件而想快速分析使用者行為的話您可利用下列簡單的指令來達成,預設的 access.log 內容如下
 #cat access.log
 1248857041.100    286 192.168.1.88 TCP_MISS/200 872 GET http://tw.msn.com - DIRECT/207.46.59.170 text/html
 1248857041.416    313 192.168.1.88 TCP_MISS/200 792 GET http://0932.jp/ - DIRECT/65.55.15.241 text/html
 1248857151.228    337 192.168.1.88 TCP_MISS/200 2265 GET http://1-2-c.com/ - DIRECT/67.220.225.40 text/html
利用 cat 指令將 access.log 內容全部輸出後配合 awk 指令取出要的欄位值 (Time、Client IP、URL) 後將結果存入到家目錄下名為 111 的檔案內
 #cat access.log | awk '{print$1 " " $3 " " $7}' > ~/111
 1248857041.100 286 192.168.1.88 http://tw.msn.com
 1248857041.416 313 192.168.1.88 http://0932.jp
 1248857151.228 337 192.168.1.88 http://1-2-c.com
最後透過下列 Perl 指令將 TimeStamp 時間轉換成 Localtime 後存入到名為 222 的檔案內
 #perl -p -e 's/^\d+\.\d+/localtime $&/e' < 111 > 222
 Wed Jul 29 16:44:01 2009 192.168.1.88 http://tw.msn.com
 Wed Jul 29 16:44:01 2009 192.168.1.88 http://0932.jp
 Wed Jul 29 16:45:51 2009 192.168.1.88 http://1-2-c.com
經過上述二道步驟後可簡單把 access.log 內容轉換成具有時間及 Client IP 及所連結的網址。

參考

[Squid 2.5 Quick Start Guide]
[苗栗縣大湖鄉大南國民小學全球資訊網路 (FreeBSD) 架站日誌 Proxy-Server (Squid) 代理伺服器]
[FreeBSD Proxy Server 之 安裝 與 設定]
[IPNAT+Ipfilter+Squid Transparent Proxy 超級防火牆]
[YI-Jer Shou & Chung-Kie Tung Squid Proxy Server 介紹]
[Squid 2.6.STABLE8 release notes]
[Transparent proxying with squid and pf]
[OpenBSD PF & 之橋接模式﹝Bridge Mode﹞+ Squid with Transparent proxying]
[pf transparent proxy squid nat - The FreeBSD Forums]
[Configuring transparent proxy - GrahamstownSchoolWiki]

Me FAQ

Q1.檢查 squid 設定檔時顯示訊息 ACL name 'QUERY' not defined!?
Error Meaage:
修改好 Squid 設定檔後執行檢查設定檔的指令後顯示說找不到定義的 ACL 名稱 QUERY
 #squid -f /usr/local/etc/squid/squid.conf -k parse
 2007/12/18 13:55:54| ACL name 'QUERY' not defined!
 FATAL: Bungled squid.conf line 2446: no_cache deny QUERY
 Squid Cache (Version 2.6.STABLE17): Terminated abnormally.
Ans:
原因為 Squid 設定檔內關於 ACL 名稱 QUERY 定義順序顛倒了,修改後再度檢查設定檔內容就沒問題了。
 acl QUERY urlpath_regex cgi-bin \? \.php \.asp \.cgi
 no_cache deny QUERY                                  //此行要放在 ACL 下面
Q2.無法使用 Transparent Proxy 功能?
Error Meaage:
修改好 Squid 設定檔後執行檢查設定檔的指令後顯示說找不到定義的 Transparent Proxy 名稱
 #/usr/local/sbin/squid -k parse
 2007/12/18 14:43:06| parseConfigFile: line 3170 unrecognized: 'httpd_accel_host virtual'
 2007/12/18 14:43:06| parseConfigFile: line 3171 unrecognized: 'httpd_accel_port 80'
 2007/12/18 14:43:06| parseConfigFile: line 3172 unrecognized: 'httpd_accel_with_proxy on'
 2007/12/18 14:43:06| parseConfigFile: line 3173 unrecognized: 'httpd_accel_uses_host_header on  '
Ans:
新版本的 Squid (ex. squid-2.6.17) 將 Transparent Proxy 設定簡化了,簡單說就是把一些功能都整合到 http_port 的 option 內了,至於詳細內容您可參考官網 [Squid 2.6.STABLE8 release notes]
 #vi /usr/local/etc/squid/squid.conf         //修改 squid 設定檔
 http_port 3128                              //預設值
 http_port 3128 transparent                  //修改後,加上 transparent option


##################################
chown squid:squid /cache1
chown squid:squid /cache2 
/etc/rc.d/init.d/squid restart
##################################
張貼者: yuliliang 於 下午1:46 沒有留言:
標籤: linux, squid

SquidGuard-Web Proxy Server Filter

內容

  1. 前言
  2. 實作環境
  3. 安裝及設定
    1. 步驟1.安裝 SquidGuard 套件
    2. 步驟2.修改 squidguard.conf 設定檔
    3. 步驟3.下載黑名單檔案 Blacklist.gz
    4. 步驟4.修改並重新載入 squid.conf 設定檔
    5. 步驟5.查看及測試
  4. 參考

前言

Squid 能讓過濾 (Filter) 不當資訊網站,但若是您一筆一筆自行定義實在是很累的事,因此 [SquidGuard] 就這樣產生了,SquidGuard 是由國外一群厭惡網路不當資訊的人所組成,會定期增加黑名單網站 [SquidGuard Blacklist],您只要安裝 SquidGuard 並匯入黑名單在搭配 Squid 就可輕鬆達到過濾不當資訊網站的功能。
SquidGuard 作用的原理很簡單,就是當 Squid Clients 欲透過 Squid 對外連線至 Internet時會檢查一下 SquidGuard 內所定義的黑名單網站清單 (Blacklist) 若符合則重新導向 (Redirect) 到自訂的禁止連線說明網站,若未符合則放行對外連線。

實作環境

  • CentOS 5.1 (Linux 2.6.18-53.1.4.el5)
  • squidguard-1.2.0-2.2.el5.rf

安裝及設定

步驟1.安裝 SquidGuard 套件

 #yum -y install squidguard        //使用 yum 安裝 squidguard 套件

步驟2.修改 squidguard.conf 設定檔

 #vi /etc/squid/squidguard.conf
 dbhome /var/lib/squidguard        //存放 Blacklist 黑名單路徑
 logdir /var/log/squidguard        //存放 SquidGuard Log 路徑
 source clients {                  //定義 squid clients 網段 (更進階可配合開放 /禁止時間)
     ip 192.168.1.0/24
 }
 dest block {                      //定義 blacklist 名稱項目
        domainlist blacklists      //Domains 檔路徑
        urllist blacklists         //URL 檔路徑
 }
 acl {
        default {
         pass     !block all       //不在 blacklist 內則放行
         redirect http://www.weithenn.org/block.htm    //若是連線為 block 內定義則重新導向至連線禁止網頁
        }
 }

步驟3.下載黑名單檔案 Blacklist.gz

我們切換至 SquidGuard 存放黑名單資料夾,下載黑名單檔案開解後將該檔案權限設定為 squid (這樣 squid 才可讀取)
 #cd /var/lib/squidguard                                   //切換至存放黑名單路徑
 #wget http://squidguard.mesd.k12.or.us/blacklists.tgz     //下載黑名單檔案
 #gunzip blacklists.gz                                     //解開黑名單檔案
 #chown squid:squid blacklists                             //更改權限為 squid

步驟4.修改並重新載入 squid.conf 設定檔

修改 squid.conf 設定檔以便在啟動 Squid 時順便將 SquidGuard 黑名單設定檔載入。
 #vi /etc/squid/squid.conf
 redirect_program /usr/bin/squidGuard -c /etc/squid/squidguard.conf    //加入此行來帶起 SquidGuard 服務
 #/usr/sbin/squid -k reconfigure                                       //重新讀取設定檔

步驟5.查看及測試

查看 Squid 是否有載入 SquidGuard
 #tail /home/log/squid/cache.log
 2008/04/16 19:37:23| Adding nameserver 168.95.192.1 from /etc/resolv.conf
 2008/04/16 19:37:23| Adding nameserver 168.95.1.1 from /etc/resolv.conf
 2008/04/16 19:37:23| helperOpenServers: Starting 5 'squidGuard' processes  //載入成功
 2008/04/16 19:37:23| Accepting transparently proxied HTTP connections at 0.0.0.0, port 3128, FD 14.
 2008/04/16 19:37:23| Accepting ICP messages at 0.0.0.0, port 3130, FD 16.
 2008/04/16 19:37:23| WCCP Disabled.
 2008/04/16 19:37:23| Loaded Icons.
 2008/04/16 19:37:23| Ready to serve requests.
查看是否順利載入黑名單 SquidGuard
 #tail /var/log/squidguard/squidGuard.log
 2008-04-16 18:23:27 [4468] init domainlist /var/lib/squidguard/blacklists
 2008-04-16 18:25:30 [4464] init urllist /var/lib/squidguard/blacklists
 2008-04-16 18:25:37 [4464] squidGuard 1.2.0 started (1208341407.170)
 2008-04-16 18:25:37 [4464] squidGuard ready for requests (1208341537.491)
查看是否順利啟動 SquidGuard Process
 #ps ax |grep squid
 root      2665  0.0  0.0   7716  1104 ?        Ss   11:37   0:00 squid -D
 squid     2667  0.0  0.3  12300  8192 ?        S    11:37   0:01 (squid) -D
 squid     2669  0.0  0.0   3336  1560 ?        Ss   11:37   0:21 (squidGuard) -c /etc/squid/squidguard.conf
 squid     2670  0.0  0.0   3336  1556 ?        Ss   11:37   0:22 (squidGuard) -c /etc/squid/squidguard.conf
 squid     2671  0.0  0.0   3336  1560 ?        Ss   11:37   0:22 (squidGuard) -c /etc/squid/squidguard.conf
 squid     2672  0.0  0.0   3336  1500 ?        Ss   11:37   0:22 (squidGuard) -c /etc/squid/squidguard.conf
 squid     2673  0.0  0.0   3332  1500 ?        Ss   11:37   0:22 (squidGuard) -c /etc/squid/squidguard.conf
測試 SquidGuard 功能是否生效
此時你可以操作你的 Squid Client 隨便連一個 Blacklist 內的網站(例如 mp3.sites.cc),此時應該要 Redirect 到您指定的禁止存取網頁 (ex. [http://www.weithenn.org/block.htm]) 才對。

參考

[SquidGuard.org]
[Installation and Configuration of the SquidGuard web filter]
[資訊組長聯誼會 :: 觀看文章 - 在sarg下看squidGuard的阻擋紀錄]
[ SquidGuard 安裝]
[國立暨南國際大學色情防治機制]
[MyUnix論壇 :: 觀看文章 - squid和squidGuard配置代理伺服器]
張貼者: yuliliang 於 中午12:54 沒有留言:
標籤: squid

安裝 Content Security 來搭配 Squid Proxy 進行不當資訊防治

Content Security 是由 QuintoLabs 公司所開發的程式,可以搭配 Squid Proxy 使用,方便管理人員進行網路不當資訊的防治,功能類似許多人常用的 squidGuard。
Content Security 官方網站:http://www.quintolabs.com
Content Security 系統主要的特色是:
1.刪除惱人的網頁廣告
2.控制Web使用分類
3.封鎖網路下載
4.減少誤報
4.享有較高的性能和硬體要求低
5.易於安裝和維護
6.支援多種平台(Linux/BSD*/Windows*)
底下是安裝步驟和簡單的設定
1. 下載套件
# wget http://www.quintolabs.com/qlproxy/binaries/2.0.0/qlproxy-2.0.0-bb01d.i386.rpm
2. 安裝套件
# rpm -ivh qlproxy-2.0.0-bb01d.i386.rpm

3. qlproxy 的主要設定檔在 /etc/opt/quintolabs/qlproxy 目錄之下
adblock.conf -- 主要是設定用來阻擋廣告
adultblock.conf - 主要是設定阻擋成人資訊
exceptions.conf - 設定不受到管制的群組
httpblock.conf - 設定 httpd 協定的一些阻擋方式
qlproxyd.conf - 主要的設定檔
urlblock.conf - 設定要啟用阻擋的 url 網址

4. 阻擋的 url 和 domain 設定檔位於 /var/opt/quintolabs/qlproxy/spool/urlblock/blacklists 目錄下,一個目錄代表一個類別,每一個目錄之中有 domains 和 urls 的設定檔
# ls -l /var/opt/quintolabs/qlproxy/spool/urlblock/blacklists/sexuality/*domains
urls

 5. 修改設定檔
#
cat /opt/quintolabs/qlproxy/etc/qlproxyd.conf | grep -v '#' | grep -v ^$# 執行時的使用者
user = qlproxy
pidfile = /var/opt/quintolabs/qlproxy/run/qlproxyd.pid
error_loglevel = info
# 執行時錯誤記錄檔的位置
error_log = /var/opt/quintolabs/qlproxy/log/error.log
# 執行時記錄檔的位置
access_log = /var/opt/quintolabs/qlproxy/log/access.log
access_log_all = no
debug_dump_enabled = no
debug_dump_dir = /var/opt/quintolabs/qlproxy/tmp
icap_address = 127.0.0.1
# 所使用的 TCP Port
icap_port    = 1344
pool_threads = 3
min_trickled_size = 65536
trickle_size = 8192
trickled_percent = 80
action = block
redirect_url = http://www.quintolabs.com/redirect/index.php
# 阻擋的畫面
blocked_page = /var/opt/quintolabs/qlproxy/www/redirect/blocked.html
blocked_image = /var/opt/quintolabs/qlproxy/www/redirect/transparent.gif
# 啟用內容阻擋
contentblock_enabled = yes
# 內容阻擋的設定檔位置
contentblock_conf = /var/opt/quintolabs/qlproxy/spool/contentblock
# 啟用廣告阻擋
adblock_enabled = yes
# 廣告阻擋的設定檔位置
adblock_conf = /opt/quintolabs/qlproxy/etc/adblock.conf
# 啟用 http 阻擋
httpblock_enabled = yes
# http 阻擋的設定檔位置
httpblock_conf = /opt/quintolabs/qlproxy/etc/httpblock.conf
# 啟用成人資訊阻擋
adultblock_enabled = yes
# 成人資訊阻擋的設定檔位置
adultblock_conf = /opt/quintolabs/qlproxy/etc/adultblock.conf
# 啟用 url 阻擋
urlblock_enabled = yes
# url 阻擋的設定檔位置
urlblock_conf = /opt/quintolabs/qlproxy/etc/urlblock.conf
# 排除阻擋的設定檔位置
exceptions = /opt/quintolabs/qlproxy/etc/exceptions.conf
6. 增加設定檔到 Proxy Server
# vim /etc/squid/squid.conf在檔案最後面加入下面幾行(更詳細的說明可以參考 /opt/quintolabs/qlproxy/README )
icap_enable on
icap_preview_enable on
icap_preview_size 4096
icap_persistent_connections on
icap_send_client_ip on
icap_send_client_username on
icap_client_username_header X-Client-Username
icap_service qlproxy1 reqmod_precache bypass=0 icap://127.0.0.1:1344/reqmod
icap_service qlproxy2 respmod_precache routing=on icap://127.0.0.1:1344/respmod
adaptation_access qlproxy1 allow all
adaptation_access qlproxy2 allow all
7. 啟動 Squid Proxy 和 qlproxy
# /usr/sbin/squid -k reconfigure# service qlproxy start
8. 設定開機時啟動
# chkconfig --level 3 qlproxy on9. 啟動 qlproxy 會使用 tcp 1344 埠
# netstat -antlp | grep qlproxydtcp        0      0 127.0.0.1:1344              0.0.0.0:*                   LISTEN      12022/qlproxyd10. 隨便開啟網址,如 http://www.google.com/search?adult
應該會出現下面的畫面
qlproxy
張貼者: yuliliang 於 凌晨1:14 沒有留言:
標籤: squid

2012年1月18日 星期三

上網防護: 使用 Squid + qlproxy 過濾不良內容

  1. 過濾不良內容 (Content Filtering)
  2. 擋廣告 (Ad Blocking)
  3. 網站黑名單 (HTTP Blocking)
  4. 禁止瀏覽成人內容 (Adult Blocking)
  5. 網址黑名單 (URL Blocking)
  6. 強迫 Google "嚴格篩選" 搜尋結果 (url_rewrite)
環境: Fedora 14, squid 3.1.15, qlproxy 1.4.0, php-cli 5.3.6

以下操作全部以 root 身份進行
su -
下載並安裝 qlproxy (QuintoLabs Content Security Download Page)
wget http://www.quintolabs.com/qlproxy/binaries/1.4.0/qlproxy-1.4.0-72bbf.i386.rpm
yum localinstall --nogpgcheck qlproxy-*.rpm
提升成人內容過濾等級
vi adultblock.conf
heuristics_level = high
禁止使用 IP Address 連線
vi httpblock.conf
url = http://\d+\.\d+\.\d+\.\d+/.*
摘除誤植黑名單的 blogspot.com
cd /var/opt/quintolabs/qlproxy/spool/urlblock/blacklists
find ./ -type f -name domains -exec sed -i -e '/^blogspot.com$/d' {} \;
啟動 qlproxy
chkconfig qlproxy on
service qlproxy start
讓 squid 使用 qlproxy 過濾不良內容
vi /etc/squid/squid.conf
#於檔尾加入以下內容 (Ref: /opt/quintolabs/qlproxy/README)
icap_enable on
icap_preview_enable on
icap_preview_size 4096
icap_persistent_connections on
icap_send_client_ip on
icap_send_client_username on
icap_client_username_header X-Client-Username
icap_service qlproxy1 reqmod_precache bypass=0 icap://127.0.0.1:1344/reqmod
icap_service qlproxy2 respmod_precache routing=on icap://127.0.0.1:1344/respmod
adaptation_access qlproxy1 allow all
adaptation_access qlproxy2 allow all
#若只想針對特定使用者進行內容過濾, 可設置 acl, 並修改 adaptation_access 如下
acl mychildren src 192.168.1.104/29 #IP Range: 192.168.1.105 ~ 192.168.1.110
adaptation_access qlproxy1 allow mychildren
adaptation_access qlproxy2 allow mychildren
service squid restart
使用瀏覽器通過 squid proxy 進行以下測試
#AdBlock 測試
http://thepcspy.com/blockadblock/
#eicar.com 測試
http://eicar.org/download/eicar.com
#搜尋關鍵字測試
http://www.google.com/search?q=adult
若要排除阻擋內容, 可編輯 /opt/quintolabs/qlproxy/etc/exceptions.conf 再 service qlproxy reload 即可生效
-
進階設置: 使用 url_rewrite_program 功能強迫 Google 搜尋使用 "嚴格篩選"
vi /usr/local/bin/rewrite.php
01#!/usr/bin/php
02<?php
03$temp = array();
04while ( $input = fgets(STDIN) ) {
05    // Split the output (space delimited) from squid into an array.
06    $temp = split(' ', $input);
07    // Set the URL from squid to a temporary holder.
08    $output = $temp[0] . "\n";
09    // Check the URL and rewrite it if it matches foo.example.com
10    if ( strpos($temp[0], "google.com") !== false && strpos($temp[0], "q=") !== false ) {
11        $output = $temp[0] . "&safe=strict\n";
12    }
13    echo $output;
14} ?>
chmod +x /usr/local/bin/rewrite.php
vi /etc/squid/squid.conf
url_rewrite_program /usr/local/bin/rewrite.php
service squid reload

參考資料:
  • Tiny Web Proxy And Content Filtering Appliance On CentOS 6 (Version 1.4)
  • Google 網頁搜尋說明 - 鎖定安全搜尋 : 搜尋記錄和設定
  • [ubuntu] Squid Script Problems [Archive] - Ubuntu Forums
張貼者: yuliliang 於 下午4:23 沒有留言:
標籤: squid

2012年1月17日 星期二

單純的 cache-only DNS 伺服器與 forwarding 功能

19.3.3 單純的 cache-only DNS 伺服器與 forwarding 功能

在下一小節開始介紹正、反解 zone 的資料設定之前,在這個小節當中,我們先來談一個單純修改設定檔,而不必設計 zone file 的環境,那就是不具有自己正反解 zone 的僅進行快取的 DNS 伺服器。



  • 什麼是 cache-only 與 forwarding DNS 伺服器呢?
有個只需要 . 這個 zone file 的簡單 DNS 伺服器,我們稱這種沒有自己公開的 DNS 資料庫的伺服器為 cache-only (僅快取) DNS server!顧名思義,這個 DNS server 只有快取搜尋結果的功能,也就是說,他本身並沒有主機名稱與 IP 正反解的設定檔,完全是由對外的查詢來提供他的資料來源!
那如果連 . 都不想要呢?那就得要指定一個上層 DNS 伺服器作為你的 forwarding (轉遞) 目標,將原本自己要往 . 查詢的任務,丟給上層 DNS 伺服器去煩惱即可。 如此一來,我們這部具有 forwarding 功能的 DNS 伺服器,甚至連 . 都不需要了!因為 . 有記錄在上層 DNS 上頭了嘛!
如同剛剛提到的,cache only 的 DNS 並不存在資料庫 (其實還是存在 . 這個 root 領域的 zone file), 因此不論是誰來查詢資料,這部 DNS 一律開始從自己的快取以及 . 找起,整個流程與圖 19.1-4 相同。那如果具有 forwarding 功能呢?果真如此,那即使你的 DNS 具有 . 這個 zone file,這部 DNS 還是會將查詢權『委請』上層 DNS 查詢的,這部 DNS 伺服器當場變成用戶端啦!查詢流程會變這樣喔:

具有 forwarding 功能的 DNS 伺服器查詢方式
圖 19.3-1、具有 forwarding 功能的 DNS 伺服器查詢方式
觀察上圖的查詢方向,你會發現到,具有 forwarding 機制時,查詢權會委請上層 DNS 伺服器來處理,所以根本也不需要 . 這個位置所在的 zone 啦。一般來說,如果你的環境需要架設一個 cache-only 的 DNS 伺服器時,其實可以直接加上 forwarding 的機制,讓查詢權指向上層或者是流量較大的上層 DNS 伺服器即可。那既然 cache only 的伺服器並沒有資料庫, forwarding 機制甚至不需要 . 的 zone ,那幹嘛還得要架設這樣的 DNS 呢?是有理由的啦!



  • 什麼時候有架設 cache-only DNS 的需求?
在某些公司行號裡頭,為了預防員工利用公司的網路資源作自己的事情,所以都會針對 Internet 的連線作比較嚴格的限制。當然啦,連 port 53 這個 DNS 會用到的 port 也可能會被擋在防火牆之外的~這個時候, 你可以在『防火牆的那部機器上面,加裝一個 cache-only 的 DNS 服務!』
這是什麼意思呢?很簡單啊!就是你自己利用自己的防火牆主機上的 DNS 服務去幫你的 Client 端解譯 hostname <--> IP 囉!因為防火牆主機可以設定放行自己的 DNS 功能,而 Client 端就設定該防火牆 IP 為 DNS 伺服器的 IP 即可!哈哈!這樣就可以取得主機名稱與 IP 的轉譯啦!所以,通常架設 cache only DNS 伺服器大都是為了系統安全囉。



  • 實際設定 cache-only DNS server
那如何在你的 Linux 主機上架設一個 cache-only 的 DNS 伺服器呢?其實真的很簡單的啦!因為不需要設定正反解的 zone (只需要 . 的 zone 支援即可),所以只要設定一個檔案 (就是 named.conf 主設定檔) 即可!真是快樂得不得了吶! 另外,cache-only 只要加上個 forwarders 的設定即可指定 forwarding 的資料,所以底下我們將設定具有 forwarding 的 cache-only DNS 伺服器吧!



  1. 編輯主要設定檔: /etc/named.conf

    雖然我們具有 chroot 的環境,不過由於 CentOS 6.x 已經透過啟動腳本幫我們進行檔案與目錄的掛載連結,所以請你直接修改 /etc/named.conf 即可呦!不要再去 /var/named/chroot/etc/named.conf 修改啦! 在這個檔案中,主要是定義跟伺服器環境有關的設定,以及各個 zone 的領域及資料庫所在檔名。 在鳥哥的這個案例當中,因為使用了 forwarding 的機制,所以這個 cache-only DNS 伺服器並沒有 zone (連 . 都沒有),所以我們只要設定好跟伺服器有關的設定即可。設定這個檔案的時候請注意:

    • 註解資料是放置在兩條斜線『 // 』後面接的資料
    • 每個段落之後都需要以分號『 ; 』來做為結尾!

    鳥哥將這個檔案再簡化如下的樣式:
    [root@www ~]# cp /etc/named.conf /etc/named.conf.raw
    [root@www ~]# vim /etc/named.conf
    // 在預設的情況下,這個檔案會去讀取 /etc/named.rfc1912.zones 這個領域定義檔
    // 所以請記得要修改成底下的樣式啊!
    options {
            listen-on port 53  { any; };     //可不設定,代表全部接受
            directory          "/var/named"; //資料庫預設放置的目錄所在
            dump-file          "/var/named/data/cache_dump.db"; //一些統計資訊
            statistics-file    "/var/named/data/named_stats.txt";
            memstatistics-file "/var/named/data/named_mem_stats.txt";
            allow-query        { any; };     //可不設定,代表全部接受
            recursion yes;                   //將自己視為用戶端的一種查詢模式
            forward only;                    //可暫時不設定
            forwarders {                     //是重點!
                    168.95.1.1;              //先用中華電信的 DNS 當上層
                    139.175.10.20;           //再用 seednet 當上層
            };
    };  //最終記得要結尾符號!
    
    鳥哥將大部分的資料都予以刪除,只將少部分保留的資料加以小部分的修訂而已。在 named.conf 的結構中,與伺服器環境有關的是由 options 這個項目內容設定的,因為 options 裡面還有很多子參數, 所以就以大括號 { } 包起來囉。至於 options 內的子參數在上面提到的較重要的項目簡單敘述如下:

    • listen-on port 53 { any; };
      監聽在這部主機系統上面的哪個網路介面。預設是監聽在 localhost,亦即只有本機可以對 DNS 服務進行查詢,那當然是很不合理啊! 所以這裡要將大括號內的資料改寫成 any。記得,因為可以監聽多個介面,因此 any 後面得要加上分號才算結束喔! 另外,這個項目如果忘記寫也沒有關係,因為預設是對整個主機系統的所有介面進行監聽的。

       
    • directory "/var/named";
      意思是說,如果此檔案底下有規範到正、反解的 zone file 檔名時,該檔名預設應該放置在哪個目錄底下的意思。預設放置到 /var/named/ 底下。由於 chroot 的關係,最終這些資料庫檔案會被主動連結到 /var/named/chroot/var/named/ 這個目錄。

       
    • dump-file, statistics-file, memstatistics-file
      與 named 這個服務有關的許多統計資訊,如果想要輸出成為檔案的話,預設的檔名就如上所述。鳥哥自己很少看這些統計資料, 所以,這三個設定值寫不寫應該都是沒有關係的。

       
    • allow-query { any; };
      這個是針對用戶端的設定,到底誰可以對我的 DNS 服務提出查詢請求的意思。原本的檔案內容預設是針對 localhost 開放而已, 我們這裡改成對所有的用戶開放 (當然啦,防火牆也得放行才行)。不過,預設 DNS 就是對所有用戶放行,所以這個設定值也可以不用寫。

       
    • forward only ;
      這個設定可以讓你的 DNS 伺服器僅進行 forward,即使有 . 這個 zone file 的設定,也不會使用 . 的資料, 只會將查詢權交給上層 DNS 伺服器而已,是 cache only DNS 最常見的設定了!

       
    • forwarders { 168.95.1.1; 139.175.10.20; } ;
      既然有 forward only,那麼到底要對哪部上層 DNS 伺服器進行轉遞呢?那就是 forwarders (不要忘記那個 s) 設定值的重要性了!由於擔心上層 DNS 伺服器也可能會掛點,因此可以設定多部上層 DNS 伺服器喔!每一個 forwarder 伺服器的 IP 都需要有『 ; 』來做為結尾!

    很簡單吧!至於更多的參數我們會在後續篇幅當中慢慢介紹的。這樣就已經設定完成了最簡單的 cache only DNS server 了!

     

  2. 啟動 named 並觀察服務的埠口

    啟動總不會忘記吧?趕快去啟動一下吧!同時啟動完畢之後,觀察一下由 named 所開啟的埠口,看看到底哪些埠口會被 DNS 用到的!
    # 1. 啟動一下 DNS 這玩意兒!
    [root@www ~]# /etc/init.d/named start
    Starting named:                     [  OK  ]
    [root@www ~]# chkconfig named on
    
    # 2. 到底用了多少埠口呢?
    [root@www ~]# netstat -utlnp | grep named
    Proto Recv-Q Send-Q Local Address       Foreign Address  State  PID/Program name
    tcp        0      0 192.168.100.254:53  0.0.0.0:*        LISTEN 3140/named
    tcp        0      0 192.168.1.100:53    0.0.0.0:*        LISTEN 3140/named
    tcp        0      0 127.0.0.1:53        0.0.0.0:*        LISTEN 3140/named
    tcp        0      0 127.0.0.1:953       0.0.0.0:*        LISTEN 3140/named
    tcp        0      0 ::1:953             :::*             LISTEN 3140/named
    udp        0      0 192.168.100.254:53  0.0.0.0:*               3140/named
    udp        0      0 192.168.1.100:53    0.0.0.0:*               3140/named
    udp        0      0 127.0.0.1:53        0.0.0.0:*               3140/named
    
    我們知道 DNS 會同時啟用 UDP/TCP 的 port 53,而且是針對所有介面,因此上面的資料並沒有什麼特異的部分。不過,怎麼會有 port 953 且僅針對本機來監聽呢?其實那是 named 的遠端控制功能,稱為遠端名稱解析服務控制功能 (remote name daemon control, rndc)。預設的情況下,僅有本機可以針對 rndc 來控制。我們會在後續的章節再來探討這個 rndc 啦,目前我們只要知道 UDP/TCP port 53 有啟動即可。

     

  3. 檢查 /var/log/messages 的內容訊息 (極重要!)

    named 這個服務的記錄檔就直接給他放置在 /var/log/messages 裡面啦,所以來看看裡面的幾行登錄資訊吧!
    [root@www ~]# tail -n 30 /var/log/messages | grep named
    Aug  4 14:57:09 www named[3140]: starting BIND 9.7.0-P2-RedHat-9.7.0-5.P2.el6_0.1 -u named
     -t /var/named/chroot <==說明的是 chroot 在哪個目錄下!
    Aug  4 14:57:09 www named[3140]: adjusted limit on open files from 1024 to 1048576
    Aug  4 14:57:09 www named[3140]: found 1 CPU, using 1 worker thread
    Aug  4 14:57:09 www named[3140]: using up to 4096 sockets
    Aug  4 14:57:09 www named[3140]: loading configuration from '/etc/named.conf'
    Aug  4 14:57:09 www named[3140]: using default UDP/IPv4 port range: [1024, 65535]
    Aug  4 14:57:09 www named[3140]: using default UDP/IPv6 port range: [1024, 65535]
    Aug  4 14:57:09 www named[3140]: listening on IPv4 interface lo, 127.0.0.1#53
    Aug  4 14:57:09 www named[3140]: listening on IPv4 interface eth0, 192.168.1.100#53
    Aug  4 14:57:09 www named[3140]: listening on IPv4 interface eth1, 192.168.100.254#53
    Aug  4 14:57:09 www named[3140]: generating session key for dynamic DNS
    Aug  4 14:57:09 www named[3140]: command channel listening on 127.0.0.1#953
    Aug  4 14:57:09 www named[3140]: command channel listening on ::1#953
    Aug  4 14:57:09 www named[3140]: the working directory is not writable
    Aug  4 14:57:09 www named[3140]: running
    
    上面最重要的是第一行出現的『-t ...』那個項目指出你的 chroot 目錄囉。另外,上面表格中特殊字體的部分,有寫到讀取 /etc/named.conf,代表可以順利的載入 /var/named/etc/named.conf 的意思。如果上面有出現冒號後面接數字 (:10), 那就代表某個檔案內的第十行有問題的意思,屆時再進入處理即可。要注意的是,即使 port 53 有啟動,但有可能 DNS 服務是錯誤的,此時這個登錄檔就顯的非常重要!每次重新啟動 DNS 後,請務必查閱一下這個檔案的內容!!

    Tips:
    如果你在 /var/log/messages 裡面一直看到這樣的錯誤資訊:
    couldn't add command channel 127.0.0.1#953: not found
    那表示你還必需要加入 rndc key ,請參考本章後面的 利用 RNDC 指令管理 DNS 伺服器 的介紹,將他加入你的 named.conf 中!
    鳥哥的圖示

  4. 測試:

    如果你的 DNS 伺服器具有連上網際網路的功能,那麼透過『 dig www.google.com @127.0.0.1 』這個基本指令執行看看, 如果有找到 google 的 IP ,並且輸出資料的最底下顯示『 SERVER: 127.0.0.1#53(127.0.0.1) 』的字樣, 那就代表應該是成功啦!其他更詳細的測試請參考:19.2 小節的內容
張貼者: yuliliang 於 中午12:02 沒有留言:
標籤: DNS

BIND9 – Master / Slave DNS 基本設定備忘

  • named.conf 重點內容
  • Slave 主機向 Master 要求傳送 Zone File 的時機
  • Zone File 檔案結構
named.conf 重點內容
Master:
vi /etc/named.conf
acl “trusted” { 127.0.0.1; 192.168.1.0/24; };
options {
allow-recursion { trusted; }; //避免變成 Open DNS
allow-transfer { none; }; //預設禁止 Zone Transfer
notify no; //預設不通知轄區 DNS Server
};
zone “mydomain.com” in {
type master;
file “mydomain.com.zone”;
allow-transfer { slave.ip.address; };
notify yes;
};
zone “1.168.192.in-addr.arpa” in {
type master;
file “192.168.1.zone”;
allow-transfer { slave.ip.address; };
notify yes;
};
Slave:
vi /etc/named.conf
zone “mydomain.com” in {
type slave;
file “slave/mydomain.com.zone”;
masters { master.ip.address; };
};
zone “1.168.192.in-addr.arpa” in {
type slave;
file “slave/192.168.1.zone”;
masters { master.ip.address; };
};
Slave 主機向 Master 要求傳送 Zone File 的時機
  1. master 主機上的 named 啟動、Reload 時, 發送 dns notify 信號通知 NS 主機 (除本身外) 比對 zone file serial, 且 master serial 大於 slave serial 時.
  2. slave 主機上的 named 啟動時, 發現 master serial 大於 slave serial, 或無 zone file 存在時.
  3. slave 主機每隔 refresh 時間, 向 master 查詢 zone file serial, 發現 master serial 大於 slave serial 時.
Zone File 檔案結構
Forward Lookup / 正解
$TTL 1W @   IN SOA master_dns_fqdn zone_admin (      2006092001 ;serial      2D  ;refresh      4H  ;retry      6W  ;expire      1W )  ;TTL     IN NS master_dns_fqdn    IN NS slave_dns_fqdn    IN MX 10 mail_server_fqdn  master_dns_hostname IN A ip_address slave_dns_hostname IN A ip_address mail_server_hostname IN A ip_address some_hostname  IN CNAME another_hostname_has_A_record
Reverse Lookup / 反解
$TTL 1W @   IN SOA master_dns_fqdn zone_admin (      2006092001 ;serial      2D  ;refresh      4H  ;retry      6W  ;expire      1W )  ;TTL     IN NS master_dns_fqdn  entry_in_*.in-addr.arpa IN PTR some_host_fqdn
ex1. zone: 20.10.150.in-addr.arpa
in the zone file: 1 IN PTR ms1.mydomain.com
retult: ms1.mydomain.com=150.10.20.1
ex2. zone: 10.150.in-addr.arpa
in the zone file: 2.20 IN PTR ms1.mydomain.com
retult: ms1.mydomain.com=150.10.20.2
Ref: Microsoft Support – Description of DNS Reverse Lookups
Root Domain Zone File: ftp://ftp.internic.net/domain/named.root
Resources:
  • BIND Official Website
  • PHP5 網管實驗室 – 於 Fedora Core 上的 bind 設定
  • 鳥哥的 Linux 私房菜 – 簡易 DNS 伺服器設定
  • Study Area – 架設 DNS

您还可能感兴趣的内容

  • How To Install DNS server with Master/Slave’s config
  • Python 进行DNS解析监控
  • Linux下DNS轮询与Squid反向代理结合
  • How To Patch BIND9 Against DNS Cache Poisoning On Debian Etch
  • 使用TSIG和DNSSEC加固域名服务器
張貼者: yuliliang 於 上午9:25 沒有留言:
標籤: DNS

2012年1月16日 星期一

bind 9設定

【CentOS】 bind9-提供Domain Name與IP對應的服務
鳥哥的 Linux 私房菜
第十九章、主機名稱控制者: DNS 伺服器

DNS BIND 安裝設定

http://ipv6.tcc.edu.tw/
相關文件:
WINDOWS
WindowsXP 支援IPv6網路 Windows2003支援 IPv6網路
Windows2003 域名伺服器DNS支援IPv6 [1] [2] Windows2003 網頁伺服器IIS 支援IPv6
Windows 7支援IPv6網路
LINUX/FREEBSD
Redhat/Fedora/CentOS LINUX支援IPv6網>路 網頁伺服器 APACHE支援IPv6設定
FREEBSD支援IPv6網路 域名伺服 器DNS BIND9 支援IPv6設定
OTHERS
台中縣網 IPv6及DNS IP6分配一覽表ver1.3 XLS FORTIGATE 400/400a OS3.0支援IPv6網路
關於此監測網站的程式安裝及說明


 
  1 //
  2 // Sample named.conf BIND DNS server 'named' configuration fil    e
  3 // for the Red Hat BIND distribution.
  4 //
  5 // See the BIND Administrator's Reference Manual (ARM) for det    ails, in:
  6 //   file:///usr/share/doc/bind-*/arm/Bv9ARM.html
  7 // Also see the BIND Configuration GUI : /usr/bin/system-confi    g-bind and
  8 // its manual.
  9 //
 10 options
 11 {
 12         // Those options should be used carefully because they     disable port
 13         // randomization
 14         // query-source    port 53;
 15         // query-source-v6 port 53;
 16
 17         // Put files that named is allowed to write in the dat    a/ directory:
 18         directory "/var/named"; // the default
 19         dump-file               "data/cache_dump.db";
 20         statistics-file         "data/named_stats.txt";
 21         memstatistics-file      "data/named_mem_stats.txt";
 22
 23 };
 24 logging
 25 {
 26 /*      If you want to enable debugging, eg. using the 'rndc t    race' command,
 27  *      named will try to write the 'named.run' file in the $d    irectory (/var/named).
 28  *      By default, SELinux policy does not allow named to mod    ify the /var/named directory,
 29  *      so put the default debug log file in data/ :
 30  */
 31         channel default_debug {
 32                 file "data/named.run";
 33                 severity dynamic;
 34         };
 35 };
 36 //
 37 // All BIND 9 zones are in a "view", which allow different zon    es to be served
 38 // to different types of client addresses, and for options to     be set for groups
 39 // of zones.
 40 //
 41 // By default, if named.conf contains no "view" clauses, all z    ones are in the
 42 // "default" view, which matches all clients.
 43 //
 44 // If named.conf contains any "view" clause, then all zones MU    ST be in a view;
 45 // so it is recommended to start off using views to avoid havi    ng to restructure
 46 // your configuration files in the future.
 47 //
 48 view "localhost_resolver"
 49 {
 50 /* This view sets up named to be a localhost resolver ( cachin    g only nameserver ).
 51  * If all you want is a caching-only nameserver, then you need     only define this view:
 52  */
 53         match-clients           { localhost; };
 54         match-destinations      { localhost; };
 55         recursion yes;
 56         # all views must contain the root hints zone:
 57         include "/etc/named.root.hints";
 58
 59         /* these are zones that contain definitions for all th    e localhost
 60          * names and addresses, as recommended in RFC1912 - th    ese names should
 61          * ONLY be served to localhost clients:
 62          */
 63         include "/etc/named.rfc1912.zones";
 64 };
 65 view "internal"
 66 {
 67 /* This view will contain zones you want to serve only to "int    ernal" clients
 68    that connect via your directly attached LAN interfaces - "l    ocalnets" .
 69  */
 70         match-clients           { localnets; };
 71         match-destinations      { localnets; };
 72         recursion yes;
 73         // all views must contain the root hints zone:
 74         include "/etc/named.root.hints";
75
 76         // include "named.rfc1912.zones";
 77         // you should not serve your rfc1912 names to non-loca    lhost clients.
 78
 79         // These are your "authoritative" internal zones, and     would probably
 80         // also be included in the "localhost_resolver" view a    bove :
 81
 82         zone "my.internal.zone" {
 83                 type master;
 84                 file "my.internal.zone.db";
 85         };
 86         zone "my.slave.internal.zone" {
 87                 type slave;
88                 file "slaves/my.slave.internal.zone.db";
 89                 masters { /* put master nameserver IPs here */     127.0.0.1; } ;
 90                 // put slave zones in the slaves/ directory so     named can update them
 91         };
 92         zone "my.ddns.internal.zone" {
 93                 type master;
 94                 allow-update { key ddns_key; };
 95                 file "slaves/my.ddns.internal.zone.db";
 96                 // put dynamically updateable zones in the sla    ves/ directory so named can update them
 97         };
 98 };
 99 key ddns_key
100 {
101         algorithm hmac-md5;
102         secret "use /usr/sbin/dns-keygen to generate TSIG keys    ";
103 };
104 view    "external"
105 {
106 /* This view will contain zones you want to serve only to "ext    ernal" clients
107  * that have addresses that are not on your directly attached     LAN interface subnets:
108  */
109         match-clients           { any; };
110         match-destinations      { any; };
111
112         recursion no;
113         // you'd probably want to deny recursion to external c    lients, so you don't
114         // end up providing free DNS service to all takers
115
116         allow-query-cache { none; };
117         // Disable lookups for any cached data and root hints
118
119         // all views must contain the root hints zone:
120         include "/etc/named.root.hints";
121
122         // These are your "authoritative" external zones, and     would probably
123         // contain entries for just your web and mail servers:
124
125         zone "my.external.zone" {
126                 type master;
127                 file "my.external.zone.db";
128         };
129 };
----------------------------------
張貼者: yuliliang 於 晚上9:22 沒有留言:
標籤: DNS

設定 BIND9 獨立輸出 log 到 /var/log/named/named.log 不要輸出到 /var/log/messages

設定 /var/log/named/named.log 每 5M 就會 rotate 並且只保留三份。

1. 建立 /var/log/named 目錄

mkdir /var/log/named
touch /var/log/named/named.log
cd /var/log
chown -R named:named named/

2. 設定 /etc/named.conf 加上 logging 功能

vi /etc/named.conf

logging {
        channel Named_log {
                file "/var/log/named/named.log" versions 3 size 5m;
                severity info;
                print-severity  yes;
                print-time yes; };
        category default {Named_log; };
        category xfer-out {Named_log; };
        category queries {Named_log; };
};

3. 重啟 named 服務

/etc/rc.d/init.d/named restart
張貼者: yuliliang 於 下午5:10 沒有留言:
標籤: DNS

2012年1月12日 星期四

SMTP server - Sendmail

Sendmail 官方網站:http://www.sendmail.org/
yum -y install sendmail sendmail-cf m4 cyrus-sasl
cp /etc/mail/sendmail.mc /etc/mail/sendmail.mc.bak
vim /etc/mail/sendmail.mc
#################################################################
52行 dnl TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
53 行 dnl define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
#刪掉上面兩行前面的 dnl
#注意:TRUST_AUTH_METH、define 前面不要留有空格
116行 dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
#前面加上 dnl, 把這行註解起來(dnl = do not load)
#或改成下面這樣也可以
DAEMON_OPTIONS(`Port=smtp,Addr=0.0.0.0, Name=MTA')dnl
#################################################### 
cp /etc/mail/sendmail.cf /etc/mail/sendmail.cf.bak
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
vim /etc/mail/access
#####################################################
Connect:localhost.localdomain           RELAY
Connect:localhost                       RELAY
Connect:127.0.0.1                       RELAY
rexbode@walla.com                       DISCARD
35198347098vbr@yahoo.ie                 DISCARD
info@kia.com                            DISCARD
test@testing.domain.name                REJECT
from:35198347098vbr@yahoo.ie            DISCARD
from:rexbode@walla.com                  DISCARD
localhost.localdomain                   RELAY
localhost                               RELAY
127.0.0.1                               RELAY
wcjs.tcc.edu.tw                         RELAY
41.220.75                               DISCARD
163.17.209                              RELAY
# Connect:41.220.75                     REJECT
# onnect:163.17.209                     DISCARD
*.dynamic.*                             REJECT
h8h.com                             DISCARD
192.168.1.100                       DISCARD
from:info@cole.tw                       DISCARD
jessica.barry2009@hotmail.com           DISCARD
jessicabarry12@live.com                 DISCARD
info@winners.org                        DISCARD
info@cole.tw                            DISCARD
# info@kia.com                          DISCARD
# info@cole.tw                          DISCARD

##############################################################
 10 rexbode@walla.com                       DISCARD
 11 35198347098vbr@yahoo.ie                 DISCARD
 12 info@kia.com                            DISCARD
 13 test@testing.domain.name                REJECT
 14 from:35198347098vbr@yahoo.ie            DISCARD
 15 from:rexbode@walla.com                  DISCARD
 16 localhost.localdomain                   RELAY
 17 localhost                               RELAY
 18 127.0.0.1                               RELAY
 19 wcjs.tcc.edu.tw                         RELAY
 20 wcjs.tc.edu.tw                          RELAY
 21 41.220.75                               DISCARD
 22 163.17.209                              RELAY
 23 #Connect:41.220.75                      REJECT
 24 #onnect:163.17.209                      DISCARD
 25 *.dynamic.*                             REJECT
 26 h8h.com                             DISCARD
 27 192.168.1.100                       DISCARD
 28 from:info@cole.tw                       DISCARD
 29 jessica.barry2009@hotmail.com           DISCARD
 30 jessicabarry12@live.com                 DISCARD
 31 info@winners.org                        DISCARD
 32 info@cole.tw                            DISCARD
 33 #info@kia.com                           DISCARD
 34 #info@cole.tw                           DISCARD
 ###############################################################
makemap hash /etc/mail/access < /etc/mail/access
/etc/rc.d/init.d/saslauthd restart
/etc/rc.d/init.d/sendmail restart
chkconfig saslauthd on
chkconfig sendmail on
##############################################################
SMTP 測試:telnet IP 25(離開:quit)
把寄給 root 的信寄給 sysadm: vim /etc/aliases
96行 #root: marc 修改成--> root: sysadm
#若想要 root 也留一份備份的話:root: cyl62,root
newaliases
mutt 介紹:yum -y install mutt && mutt
Sendmail 官方文件:http://www.sendmail.org/~ca/email/sm-X/
張貼者: yuliliang 於 上午11:35 沒有留言:
標籤: linux
較新的文章 較舊的文章 首頁
查看行動版
訂閱: 文章 (Atom)

網誌存檔

  • ►  2023 (6)
    • ►  7月 (2)
    • ►  3月 (1)
    • ►  1月 (3)
  • ►  2022 (25)
    • ►  11月 (2)
    • ►  10月 (3)
    • ►  9月 (3)
    • ►  8月 (3)
    • ►  5月 (2)
    • ►  3月 (5)
    • ►  2月 (4)
    • ►  1月 (3)
  • ►  2021 (58)
    • ►  12月 (2)
    • ►  11月 (3)
    • ►  10月 (6)
    • ►  9月 (4)
    • ►  8月 (11)
    • ►  7月 (10)
    • ►  6月 (2)
    • ►  4月 (2)
    • ►  3月 (5)
    • ►  2月 (11)
    • ►  1月 (2)
  • ►  2020 (79)
    • ►  12月 (9)
    • ►  11月 (18)
    • ►  10月 (7)
    • ►  9月 (10)
    • ►  8月 (7)
    • ►  7月 (3)
    • ►  6月 (14)
    • ►  5月 (2)
    • ►  4月 (4)
    • ►  3月 (3)
    • ►  2月 (1)
    • ►  1月 (1)
  • ►  2019 (25)
    • ►  11月 (1)
    • ►  6月 (1)
    • ►  4月 (5)
    • ►  3月 (2)
    • ►  2月 (7)
    • ►  1月 (9)
  • ►  2018 (63)
    • ►  12月 (3)
    • ►  11月 (4)
    • ►  10月 (2)
    • ►  9月 (6)
    • ►  8月 (4)
    • ►  6月 (1)
    • ►  5月 (6)
    • ►  3月 (3)
    • ►  2月 (18)
    • ►  1月 (16)
  • ►  2017 (85)
    • ►  12月 (3)
    • ►  11月 (7)
    • ►  10月 (12)
    • ►  9月 (4)
    • ►  8月 (10)
    • ►  7月 (3)
    • ►  6月 (7)
    • ►  5月 (3)
    • ►  4月 (16)
    • ►  3月 (7)
    • ►  2月 (10)
    • ►  1月 (3)
  • ►  2016 (114)
    • ►  12月 (9)
    • ►  11月 (7)
    • ►  10月 (11)
    • ►  9月 (8)
    • ►  8月 (17)
    • ►  7月 (1)
    • ►  6月 (6)
    • ►  5月 (11)
    • ►  4月 (10)
    • ►  3月 (6)
    • ►  2月 (15)
    • ►  1月 (13)
  • ►  2015 (150)
    • ►  12月 (45)
    • ►  11月 (24)
    • ►  10月 (6)
    • ►  9月 (9)
    • ►  8月 (3)
    • ►  7月 (2)
    • ►  6月 (9)
    • ►  5月 (8)
    • ►  4月 (8)
    • ►  3月 (27)
    • ►  2月 (2)
    • ►  1月 (7)
  • ►  2014 (74)
    • ►  12月 (3)
    • ►  11月 (5)
    • ►  10月 (3)
    • ►  9月 (9)
    • ►  8月 (8)
    • ►  7月 (9)
    • ►  6月 (9)
    • ►  5月 (7)
    • ►  4月 (3)
    • ►  3月 (7)
    • ►  2月 (4)
    • ►  1月 (7)
  • ►  2013 (153)
    • ►  12月 (4)
    • ►  11月 (18)
    • ►  10月 (14)
    • ►  9月 (9)
    • ►  8月 (2)
    • ►  7月 (13)
    • ►  6月 (20)
    • ►  5月 (14)
    • ►  4月 (11)
    • ►  3月 (12)
    • ►  2月 (10)
    • ►  1月 (26)
  • ▼  2012 (205)
    • ►  12月 (23)
    • ►  11月 (27)
    • ►  10月 (35)
    • ►  9月 (34)
    • ►  8月 (7)
    • ►  7月 (7)
    • ►  6月 (10)
    • ►  5月 (8)
    • ►  4月 (5)
    • ►  3月 (16)
    • ►  2月 (9)
    • ▼  1月 (24)
      • Linux 使用 top 看多顆 CPU 使用狀況、PID 狀態
      • 電腦課筆試題目 -- 上網能力
      • 補助費
      • SQUID 3.1Cent OS 6.2
      • SquidGuard-Web Proxy Server Filter
      • 安裝 Content Security 來搭配 Squid Proxy 進行不當資訊防治
      • 上網防護: 使用 Squid + qlproxy 過濾不良內容
      • 單純的 cache-only DNS 伺服器與 forwarding 功能
      • BIND9 – Master / Slave DNS 基本設定備忘
      • bind 9設定
      • 設定 BIND9 獨立輸出 log 到 /var/log/named/named.log 不要輸出到...
      • SMTP server - Sendmail
      • locate updatedb
      • vim /etc/fstab
      • CentOS z86_64 安裝第三方套件加強 YUM 功能
      • 安裝 RPMforge
      • crontab文件
      • dns & mail server 救援---初設定
      • CENTOS6.1版本重啟後黑屏
      • ticker
      • 相簿
      • 網頁(UTF-8) 於 瀏覽器 出現亂碼解法
      • Virtualbox 安裝 Android 安卓智慧手機平台
      • 20120107婦女快樂玩電腦班-補課
  • ►  2011 (108)
    • ►  12月 (22)
    • ►  11月 (5)
    • ►  10月 (3)
    • ►  9月 (18)
    • ►  8月 (8)
    • ►  7月 (3)
    • ►  6月 (8)
    • ►  5月 (6)
    • ►  4月 (7)
    • ►  3月 (15)
    • ►  2月 (2)
    • ►  1月 (11)
  • ►  2010 (36)
    • ►  12月 (7)
    • ►  11月 (25)
    • ►  10月 (4)
  • ►  2007 (1)
    • ►  8月 (1)

Translate

訂閱

發表文章
Atom
發表文章
所有留言
Atom
所有留言

文章分類

  • 樂活 (137)
  • 校務行政 (91)
  • google app (65)
  • linux (56)
  • VMware vSphere (44)
  • 攝影 (27)
  • sketchup (22)
  • website (17)
  • 資安 (15)
  • dhcpd (13)
  • 教學評量 (12)
  • sfs3 (11)
  • DNS (9)
  • scratch (9)
  • squid (9)
  • e化教學 (8)
  • ldap (8)
  • 玩玩數學 (8)
  • PHP & MySQL (4)
  • 環保生活 (4)
  • radius (3)
  • rsync (3)
  • 搜尋 (3)
  • 美工 (3)

關於我自己

yuliliang
檢視我的完整簡介
圖片視窗主題. 主題圖片來源:loops7. 技術提供:Blogger.