MRTG Server performace

每次看到 每5分鐘執行 mrtg 的時候, 以root身份去執行它,會使系統瞬間負載增加 就算在好的電腦,我發現在mrtg畫圖的瞬間,還是會使系統負擔,要如何避免這樣呢 The RunAsDaemon keyword enables daemon mode operation. The purpose of daemon mode is that MRTG is launched once and not repeatedly (as it is with cron). This behavior saves computing resourses as loading and parsing of configuration files happens only once. Using daemon mode MRTG itself is responible for timing the measurement intervals. Therfore its important to set the Interval keyword to an apropiate value. [Read More]

[Apache] mod_rewrite 實做 防盜圖

PTT 的 php版 有人問到

如何在URL隱藏’.php’ 有時候會看到一些網站的URL沒有後面的.php .jsp .xxx 自己加上去反而無法開啟 像 http://www.google.com.tw/search?hl=zh-TW&q=abc 讓人無法得知該網站是使用哪種語言開發 請問要如何隱藏 我想這對網站的安全性應該有一些幫助 謝謝回覆 以下是我的回覆: 這是利用 mod_rewrite 作法達到的,其實不只隱藏 後面的php而已,還可以你隨便取呢 在根目錄底下新增 .htaccess[這個必須你的server有支援才行,有的不會讓你新增此檔 ] 然後在該檔裏面 寫下

[Read More]

[Linux] 安裝使用 Webalizer

系統:CentOS 4.4 搜尋 Webalizer

[root@NAS][~][17:52:51]# yum search webalizer Searching Packages: Setting up repositories Reading repository metadata in from local files webalizer.x86_64 2.01_10-25 base Matched from: webalizer The Webalizer is a Web server log analysis program. It is designed to scan Web server log files in various formats and produce usage statistics in HTML format for viewing through a browser. It produces professional looking graphs which make analyzing when and where your Web traffic is coming from easy. http://www.mrunix.net/webalizer/ 設定檔放在 /etc/webalizer.conf 我的設定如下

LogFile /var/log/httpd/access_log OutputDir /var/www/html/webalizer HistoryName /var/lib/webalizer/webalizer.hist Incremental yes IncrementalName /var/lib/webalizer/webalizer.current HostName NAS.th.gov.tw PageType htm* PageType cgi PageType php PageType shtml DNSCache /var/lib/webalizer/dns_cache.db DNSChildren 10 Quiet yes FoldSeqErr yes HideURL *.gif HideURL *.GIF HideURL *.jpg HideURL *.JPG HideURL *.png HideURL *.PNG HideURL *.ra SearchEngine yahoo.com p= SearchEngine altavista.com q= SearchEngine google.com q= SearchEngine eureka.com q= SearchEngine lycos.com query= SearchEngine hotbot.com MT= SearchEngine msn.com MT= SearchEngine infoseek.com qt= SearchEngine webcrawler searchText= SearchEngine excite search= SearchEngine netscape.com search= SearchEngine mamma.com query= SearchEngine alltheweb.com query= SearchEngine northernlight.com qr=

[Read More]

[Linux] Mrtg 實做 war3 線上人數統計

應大家觀眾要求,來寫一下教學 當然我不想怎麼安裝mrtg了,搜尋一下本站就會找到教學 相信mrtg最主要是他的設定檔 cfg檔,先來看看 這個cfg檔怎麼寫 # Created by # Appleboy 2006/09/25 WorkDir: /usr/local/www/data-dist Language: big5 Target[bnet_person]: `/usr/local/etc/mrtg/mrtg.person.sh` MaxBytes[bnet_person]: 10000 Options[bnet_person]: gauge, nopercent, growright YLegend[bnet_person]: Online Users ShortLegend[bnet_person]: 人 LegendI[bnet_person]:   線上人數 : LegendO[bnet_person]:   遊戲數目 : Title[bnet_person]: 小熊戰網 上線人數統計表 先來解釋 WorkDir: /usr/local/www/data-dist 這個是來存放mrtg統計圖的資料夾,請對應到相關可以放html的資料夾 Target[bnet_person]: `/usr/local/etc/mrtg/mrtg.person.sh` 以下是 mrtg.person.sh 這個檔案 #!/bin/sh # 這個程式主要在計算有多少人以 bnetd 的方式連線進我們的主機! # 1. 計算線上的數目 cat /~pvpgn/server.dat | grep "Users" | cut -d "=" -f2 # 2. 計算遊戲數目 cat /~pvpgn/server. [Read More]

[Linux] CentOS 4.4 安裝過程 NAS 2U Server

新主機 2u nas server

  • 2顆amd Opteron 2.2ghz
  • 機架高度2u
  • 2*1GB RAM ECC DDR400
  • SCSI硬碟 ULTRA320磁碟陣列卡支援RAID0,1,5,1000RPM 72GB4顆
  • 網路卡10/100/ 1000 Mbps介面卡2個
  • 主機板型號GA-7A8DRH 連結

主機照片 上面那台,下面那台也是NAS WIN2003 SERVER

  • 安裝步驟:

利用光碟開機,鍵入linux ddDSCF0059

[Read More]

[Ubuntu] 安裝 StarDict 星際譯王 以及 字典檔

如何在Ubuntu 底下安裝字典呢 先去搜尋 StarDict Shell Script{#p94}StarDict Shell Script{#p94}StarDict Shell Script{#p94} 套件

[root@appleboy-dorm][~][21:59:39]# apt-cache search stardict sdcv – StarDict Console Version stardict – International dictionary for GNOME 2 stardict-common – International dictionary for GNOME 2 – data files stardict-tools – The dictionary conversion tools of stardict 然後安裝

apt-get install stardict-* 安裝好之後就可以在 應用程式->附屬應用程式->星際譯王 但是安裝好之後沒有任何字典檔,所以請自行到網路上下載 http://stardict.sourceforge.net/Dictionaries_zh_TW.php 下載軟體後 請把他解壓縮到 /usr/share/stardict/dic/ 解壓縮的目錄應該有 *.dz *.idx *.ifo 這3個檔案 重新啟動該軟體 就可以使用了 Update: 2007.04.16 有人有寫好script了,底下給大家參考 StarDict Shell Script{#p94}

幸福專賣 NO.24

這個還不錯看,講的也很實際~ 哈哈~ 看看就好,我丟給我同學看,他說它看了很傷心 好像剛跟女朋友分手~~~ — 題外話,如何讓wp支援youtube播放 1.- In admin panel, deactivate “Use the visual rich editor when writing” in “User” – “your profile”.. 2.- Deactivate “WordPress should correct invalidly nested XHTML automatically ” in “options” – “writing”. 這是我在官方找到的 http://wordpress.org/support/topic/65239?replies=9

[CentOS 4.4] 架設 rsync 伺服器

安裝方式: 先檢查是否有安裝rsync yum list installed | grep rsync rsync.x86_64 2.6.3-1 installed vi /etc/xinetd.d/rsync service rsync { disable = yes socket_type = stream wait = no user = root server = /usr/bin/rsync server_args = –daemon log_on_failure += USERID } disable = yes 改成 disable = no 然後重新啟動xinetd /etc/init.d/xinetd restart vi /etc/rsyncd.conf [backup] path = /backup02 auth users = admin uid = root gid = root secrets file = /etc/rsyncd.secrets read only = no [主機代號:自訂] path = 備份資料放置的路徑 auth users = 定義援權的帳號 uid = 應是執行時的uid gid = 應是執行時的gid secrets file = 認證密碼檔的位置 read only = 是否唯讀 [Read More]