designevo

Logo通過DesignEvo設計製作

2009年5月7日 星期四

在 unbuntu 9.04 安裝 ssh

#apt-get install ssh

正在讀取套件清單... 完成
正在重建相依關係
正在讀取狀態資料... 完成
下列的額外套件將被安裝:
openssh-server
建議套件:
rssh molly-guard openssh-blacklist openssh-blacklist-extra
下列【新】套件將會被安裝:
openssh-server ssh
升級 0 個,新安裝 2 個,移除 0 個,有 12 個未被升級。
需要下載 287kB 的套件檔。
此操作完成之後,會多佔用 827kB 的磁碟空間。
是否繼續進行 [Y/n]?
下載:1 http://tw.archive.ubuntu.com jaunty/main openssh-server 1:5.1p1-5ubuntu1 [285kB]
下載:2 http://tw.archive.ubuntu.com jaunty/main ssh 1:5.1p1-5ubuntu1 [1244B]
取得 287kB 用了 0s (436kB/s)
正在預先設定套件 ...
選中了曾被取消選擇的套件 openssh-server。
(正在讀取資料庫 ... 系統目前總共安裝有 122627 個檔案和目錄。)
正在解壓縮 openssh-server (從 .../openssh-server_1%3a5.1p1-5ubuntu1_i386.deb) ...
選中了曾被取消選擇的套件 ssh。
正在解壓縮 ssh (從 .../ssh_1%3a5.1p1-5ubuntu1_all.deb) ...
Processing triggers for ufw ...
Processing triggers for man-db ...
正在設定 openssh-server (1:5.1p1-5ubuntu1) ...
Creating SSH2 RSA key; this may take some time ...
Creating SSH2 DSA key; this may take some time ...
* Restarting OpenBSD Secure Shell server sshd [ OK ]

正在設定 ssh (1:5.1p1-5ubuntu1) ...

#

2009年4月30日 星期四

解決 netflow-tools 編譯錯誤

由於 cacti 有一個netflow viewer plugin, 但是從網站下載的 ftp://ftp.eng.oar.net/pub/flow-tools/flow-tools-0.66.tar.gzftp://ftp.eng.oar.net/pub/flow-tools/flow-tools-0.68.tar.gz 解開後,在 ./configure 指令沒有開問題,但用 make 時便出現無法編譯的錯誤,情況如下:
==============================================
# makeMaking all in lib
make[1]: Entering directory `/cacti/flow-tools-0.68/lib'
make all-am
make[2]: Entering directory `/cacti/flow-tools-0.68/lib'
source='ftio.c' object='ftio.o' libtool=no \
depfile='.deps/ftio.Po' tmpdepfile='.deps/ftio.TPo' \
depmode=gcc3 /bin/sh ../depcomp \
gcc -I. -I./lib -I. -I. -I. -g -Wall -g -Wall -c `test -f 'ftio.c'
echo './'`ftio.c
ftio.c: In function 「readn」:
ftio.c:2270: 錯誤:賦值運算中的左值無效
ftio.c: In function 「writen」:
ftio.c:2295: 錯誤:賦值運算中的左值無效
make[2]: *** [ftio.o] Error 1
make[2]: Leaving directory `/cacti/flow-tools-0.68/lib'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/cacti/flow-tools-0.68/lib'
make: *** [all-recursive] Error 1
===========================================

依照情況來看問題應該是 c 語言的語法有問題,所以就先修改 ftio.c 這個檔案,在錯誤的第2270行與2295行的程式改寫如下:

2270行原本程式碼:
(char*)ptr += nread;
改寫為:
ptr = (void*) ((char*) ptr) + nread ;

2296行原本程式碼:
(char*)ptr += nwritten;
改寫為:
ptr = (void*) (((char*) ptr) - nwritten) ;

將改寫後的程式存檔後再執行make 指今,發現原先的錯誤不會出現,但出現更多的相同錯誤在fttlv.c、ftchash.c 這個檔案,所以我們再按照相同方式一一修改,應該就可以了完成make動作,雖然仍會遇到一些警告但仍可以完成。

2009年4月11日 星期六

解決cacti的Mac Track Device中的 status error

要把 pfsense 放在 cacti 中的Mac Track Devices的設定, 一直會有 status error 的問題,原因是我一直沒注意 pfsense 的System Description Match會更 hostname 變動,所以可以用下列指令來檢查。
#/usr/bin/php -q /var/www/cacti/plugins/mactrack/mactrack_scanner.php -id=1 -d

2009年4月8日 星期三

在 pfsense 安裝 pfflowd

要讓 pfSense 具備 netflow 可以安裝 pfflowd 的 套件,如此就可以讓 pfSense 的流量狀況被網管系統掌握。

安裝 pfflowd 成簡單只要在 pfSense 的 System->Packages 下選擇就可以看到 pfflowd 的套件,雙擊就可以自動安裝。

接下來就可以到 Services 找到 pfflowd 的設定,然後將 Host 填入 netflow collector 的IP位置與設定 Port 參數為 2055 就可以完成設定。

記得要把 collector 的設備打開,應該就可以看到netflow的資料。

要看看是否有順利執行可以到 Status->Services 看看,若有Running就表示 netflow 已經可以正常運作。

Bacula Backup 安裝

Bacula 是一個 Linux 的 Open Source 的備份軟體,並適用於一般企業,可以讓管理者進行網路備份管理,復原和驗証電腦資料。

我們可以從 http://sourceforge.net/projects/bacula 來下載套件,目前我們可以用的最新版本是 2.4.4。

Step 1. 把套件取得解開到工作目錄

#tar -zxvf bacula-2.4.4.tar.gz
# cd bacula-2.4.4

Step 2. 準備進行套件的編譯

由於我是用 mysql 來做DB參數要用 --with-mysql,我用root安裝並要放程式放在 /root/bacula/bin 的目錄下,因此 configure 的參數如下:

#./configure --sbindir=$HOME/bacula/bin --sysconfdir=$HOME/bacula/bin --with-pid-dir=$HOME/bacula/bin/working --with-subsys-dir=$HOME/bacula/bin/working --enable-smartalloc --with-mysql --with-working-dir=$HOME/bacula/bin/working --with-dump-email=name@host.com --with-job-email=name@host.com --with-smtp-host=localhost

結果輸出如下:
checking for acltotext in -lsec... no
checking for pthread_create in -lpthread... yes
configure: creating ./config.status
config.status: creating autoconf/Make.common
config.status: creating Makefile
config.status: creating manpages/Makefile
config.status: creating scripts/startmysql
config.status: creating scripts/stopmysql
config.status: creating scripts/btraceback
config.status: creating scripts/startit
config.status: creating scripts/stopit
config.status: creating scripts/bconsole
config.status: creating scripts/gconsole
config.status: creating scripts/bacula
config.status: creating scripts/bacula-ctl-dir
config.status: creating scripts/bacula-ctl-fd
config.status: creating scripts/bacula-ctl-sd
config.status: creating scripts/devel_bacula
config.status: creating scripts/Makefile
config.status: creating scripts/logrotate
config.status: creating scripts/bacula.desktop.gnome1
config.status: creating scripts/bacula.desktop.gnome2
config.status: creating scripts/bacula.desktop.gnome1.consolehelper
config.status: creating scripts/bacula.desktop.gnome2.consolehelper
config.status: creating scripts/bacula.desktop.gnome1.xsu
config.status: creating scripts/bacula.desktop.gnome2.xsu
config.status: creating scripts/bgnome-console.console_apps
config.status: creating scripts/mtx-changer
config.status: creating scripts/disk-changer
config.status: creating scripts/dvd-handler
config.status: creating scripts/dvd-simulator
config.status: creating scripts/bacula-tray-monitor.desktop
config.status: creating scripts/logwatch/Makefile
config.status: creating scripts/logwatch/logfile.bacula.conf
config.status: creating scripts/wxconsole.console_apps
config.status: creating scripts/wxconsole.desktop.consolehelper
config.status: creating scripts/wxconsole.desktop.xsu
config.status: creating scripts/bat.desktop
config.status: creating scripts/bat.desktop.xsu
config.status: creating scripts/bat.desktop.consolehelper
config.status: creating scripts/bat.console_apps
config.status: creating src/Makefile
config.status: creating src/host.h
config.status: creating src/console/Makefile
config.status: creating src/console/bconsole.conf
config.status: creating src/gnome2-console/Makefile
config.status: creating src/gnome2-console/bgnome-console.conf
config.status: creating src/qt-console/bat.conf
config.status: creating src/qt-console/bat.pro
config.status: creating src/qt-console/install_conf_file
config.status: creating src/wx-console/Makefile
config.status: creating src/wx-console/bwx-console.conf
config.status: creating src/tray-monitor/Makefile
config.status: creating src/tray-monitor/tray-monitor.conf
config.status: creating src/dird/Makefile
config.status: creating src/dird/bacula-dir.conf
config.status: creating src/lib/Makefileconfig.status: creating src/stored/Makefile
config.status: creating src/stored/bacula-sd.conf
config.status: creating src/filed/Makefile
config.status: creating src/filed/bacula-fd.conf
config.status: creating src/cats/Makefile
config.status: creating src/cats/make_catalog_backup
config.status: creating src/cats/delete_catalog_backup
config.status: creating src/cats/create_postgresql_database
config.status: creating src/cats/update_postgresql_tables
config.status: creating src/cats/make_postgresql_tables
config.status: creating src/cats/grant_postgresql_privileges
config.status: creating src/cats/drop_postgresql_tables
config.status: creating src/cats/drop_postgresql_database
config.status: creating src/cats/create_mysql_database
config.status: creating src/cats/update_mysql_tables
config.status: creating src/cats/make_mysql_tables
config.status: creating src/cats/grant_mysql_privileges
config.status: creating src/cats/drop_mysql_tables
config.status: creating src/cats/drop_mysql_database
config.status: creating src/cats/create_sqlite_database
config.status: creating src/cats/update_sqlite_tables
config.status: creating src/cats/make_sqlite_tables
config.status: creating src/cats/grant_sqlite_privileges
config.status: creating src/cats/drop_sqlite_tables
config.status: creating src/cats/drop_sqlite_database
config.status: creating src/cats/create_sqlite3_database
config.status: creating src/cats/update_sqlite3_tables
config.status: creating src/cats/make_sqlite3_tables
config.status: creating src/cats/grant_sqlite3_privileges
config.status: creating src/cats/drop_sqlite3_tables
config.status: creating src/cats/drop_sqlite3_database
config.status: creating src/cats/sqlite
config.status: creating src/cats/mysql
config.status: creating src/cats/create_bdb_database
config.status: creating src/cats/update_bdb_tables
config.status: creating src/cats/make_bdb_tables
config.status: creating src/cats/grant_bdb_privileges
config.status: creating src/cats/drop_bdb_tables
config.status: creating src/cats/drop_bdb_database
config.status: creating src/cats/create_bacula_database
config.status: creating src/cats/update_bacula_tables
config.status: creating src/cats/grant_bacula_privileges
config.status: creating src/cats/make_bacula_tables
config.status: creating src/cats/drop_bacula_tables
config.status: creating src/cats/drop_bacula_database
config.status: creating src/findlib/Makefile
config.status: creating src/tools/Makefile
config.status: creating po/Makefile.in
config.status: creating platforms/Makefile
config.status: creating platforms/redhat/Makefile
config.status: creating platforms/redhat/bacula-fd
config.status: creating platforms/redhat/bacula-sd
config.status: creating platforms/redhat/bacula-dir
config.status: creating platforms/redhat/bacula.spec
config.status: creating src/config.h
config.status: executing default-1 commands
config.status: creating po/POTFILES
config.status: creating po/Makefile
config.status: executing default commands
Doing make of dependencies
==>Entering directory /Download/bacula-2.4.4/src
make[1]: Entering directory `/Download/bacula-2.4.4/src'
make[1]: Nothing to be done for `depend'.
make[1]: Leaving directory `/Download/bacula-2.4.4/src'
==>Entering directory /Download/bacula-2.4.4/scripts
make[1]: Entering directory `/Download/bacula-2.4.4/scripts'
make[1]: `depend' is up to date.
make[1]: Leaving directory `/Download/bacula-2.4.4/scripts'
==>Entering directory /Download/bacula-2.4.4/src/lib
make[1]: Entering directory `/Download/bacula-2.4.4/src/lib'
make[1]: Leaving directory `/Download/bacula-2.4.4/src/lib'
==>Entering directory /Download/bacula-2.4.4/src/findlib
make[1]: Entering directory `/Download/bacula-2.4.4/src/findlib'
make[1]: Leaving directory `/Download/bacula-2.4.4/src/findlib'
==>Entering directory /Download/bacula-2.4.4/src/filed
make[1]: Entering directory `/Download/bacula-2.4.4/src/filed'
make[1]: Leaving directory `/Download/bacula-2.4.4/src/filed'
==>Entering directory /Download/bacula-2.4.4/src/console
make[1]: Entering directory `/Download/bacula-2.4.4/src/console'
conio.c:82:21: error: termcap.h: No such file or directory
make[1]: *** [depend] Error 1
make[1]: Leaving directory `/Download/bacula-2.4.4/src/console'
==>Entering directory /Download/bacula-2.4.4/src/cats
make[1]: Entering directory `/Download/bacula-2.4.4/src/cats'
make[1]: Leaving directory `/Download/bacula-2.4.4/src/cats'
==>Entering directory /Download/bacula-2.4.4/src/dird
make[1]: Entering directory `/Download/bacula-2.4.4/src/dird'
make[1]: Leaving directory `/Download/bacula-2.4.4/src/dird'
==>Entering directory /Download/bacula-2.4.4/src/stored
make[1]: Entering directory `/Download/bacula-2.4.4/src/stored'
make[1]: Leaving directory `/Download/bacula-2.4.4/src/stored'
==>Entering directory /Download/bacula-2.4.4/src/tools
make[1]: Entering directory `/Download/bacula-2.4.4/src/tools'
make[1]: Leaving directory `/Download/bacula-2.4.4/src/tools'
==>Entering directory /Download/bacula-2.4.4/manpages
make[1]: Entering directory `/Download/bacula-2.4.4/manpages'
make[1]: Nothing to be done for `depend'.
make[1]: Leaving directory `/Download/bacula-.4.4/manpages'

Configuration on Wed Apr 8 14:55:29 CST 2009:
Host: i686-pc-linux-gnu -- redhat
Bacula version: 2.4.4 (28 December 2008)
Source code location: .
Install binaries: /root/bacula/bin
Install config files: /root/bacula/bin
Scripts directory: /root/bacula/bin
Archive directory:
Working directory: /root/bacula/bin/working PID directory: /root/bacula/bin/working
Subsys directory: /root/bacula/bin/working
Man directory: ${datarootdir}/man
Data directory: ${prefix}/share
C Compiler: gcc 4.1.2
C++ Compiler: /usr/bin/g++ 4.1.2
Compiler flags: -g -O2 -Wall -fno-strict-aliasing -fno-exceptions -fno-rtti
Linker flags: -O
Libraries: -lpthread
Statically Linked Tools: no
Statically Linked FD: no
Statically Linked SD: no
Statically Linked DIR: no
Statically Linked CONS: no
Database type: MySQL
Database lib: -L/usr/lib/mysql -lmysqlclient_r -lz
Database name: bacula
Database user: bacula
Job Output Email: name@host.com
Traceback Email: name@host.com
SMTP Host Address: localhost
Director Port: 9101
File daemon Port: 9102
Storage daemon Port: 9103
Director User:
Director Group:
Storage Daemon User:
Storage DaemonGroup:
File Daemon User:
File Daemon Group:
SQL binaries Directory /usr/bin
Large file support: yes
Bacula conio support: no
readline support: no
TCP Wrappers support: no
TLS support: no
Encryption support: no
ZLIB support: yes
enable-smartalloc: yes
bat support: no
enable-gnome: no
enable-bwx-console: no
enable-tray-monitor:
client-only: no
build-dird: yes
build-stored: yes
ACL support: no
Python support: no
Batch insert enabled: yes

過程中有錯誤發生!!!
conio.c:82:21: error: termcap.h: No such file or directory
make[1]: *** [depend] Error 1

由於發現需要 termcap.h 的標頭檔案,而該檔案是在libtermcap-devel套件中, 所以我使用centos可以用 yum install libtermcap-devel來取得。
所以我們重新再作一次 ./configure

# make distclean

make[1]: Entering directory `/Download/bacula-2.4.4/src'(cd gnome2-console && make clean)make[2]: Entering directory `/Download/bacula-2.4.4/src/gnome2-console'
make[2]: Leaving directory `/Download/bacula-2.4.4/src/gnome2-console'if test . = .; then make realclean; fi
make[2]: Entering directory `/Download/bacula-2.4.4/src'(cd gnome2-console && make clean)make[3]: Entering directory `/Download/bacula-2.4.4/src/gnome2-console'
make[3]: Leaving directory `/Download/bacula-2.4.4/src/gnome2-console'
make[2]: Leaving directory `/Download/bacula-2.4.4/src'
make[1]: Leaving directory `/Download/bacula-2.4.4/src'
make[1]: Entering directory `/Download/bacula-2.4.4/scripts'
make[1]: Leaving directory `/Download/bacula-2.4.4/scripts'
make[1]: Entering directory `/Download/bacula-2.4.4/src/lib'
/bin/rm -f *.a core a.out *.o *.bak *.tex *.pdf *~ *.intpro *.extpro 1 2 3/bin/rm -f rwlock_test md5sum sha1sum/bin/rm -f tagsif test . = .; then make realclean; fi
make[2]: Entering directory `/Download/bacula-2.4.4/src/lib'/bin/rm -f *.a core a.out *.o *.bak *.tex *.pdf *~ *.intpro *.extpro 1 2 3
/bin/rm -f rwlock_test md5sum sha1sum/bin/rm -f tags
make[2]: Leaving directory `/Download/bacula-2.4.4/src/lib'(cd .; /bin/rm -f Makefile)
make[1]: Leaving directory `/Download/bacula-2.4.4/src/lib'
make[1]: Entering directory `/Download/bacula-2.4.4/src/findlib'
/bin/rm -f find core a.out *.a *.o *.bak *~ *.intpro *.extpro 1 2 3/bin/rm -f tagsif test . = .; then make realclean; fi
make[2]: Entering directory `/Download/bacula-2.4.4/src/findlib'
/bin/rm -f find core a.out *.a *.o *.bak *~ *.intpro *.extpro 1 2 3/bin/rm -f tags
make[2]: Leaving directory `/Download/bacula-2.4.4/src/findlib'(cd .; /bin/rm -f Makefile)
make[1]: Leaving directory `/Download/bacula-2.4.4/src/findlib'
make[1]: Entering directory `/Download/bacula-2.4.4/src/filed'if test -f win32/Makefile; then \ (cd win32; make clean); \ fiif test . = .; then make realclean; fi
make[2]: Entering directory `/Download/bacula-2.4.4/src/filed'if test -f win32/Makefile; then \ (cd win32; make clean); \ fi
make[2]: Leaving directory `/Download/bacula-2.4.4/src/filed'(cd .; /bin/rm -f Makefile)if test -f win32/Makefile; then \ (cd win32; make distclean); \ fi
make[1]: Leaving directory `/Download/bacula-2.4.4/src/filed'
make[1]: Entering directory `/Download/bacula-2.4.4/src/console'if test . = .; then make realclean; fi
make[2]: Entering directory `/Download/bacula-2.4.4/src/console'
make[2]: Leaving directory `/Download/bacula-2.4.4/src/console'(cd .; /bin/rm -f Makefile)
make[1]: Leaving directory `/Download/bacula-2.4.4/src/console'
make[1]: Entering directory `/Download/bacula-2.4.4/src/cats'
/bin/rm -f cats core a.out *.o *.a *.bak *~ *.intpro *.extpro 1 2 3
/bin/rm -f tags
/bin/rm -f create_bacula_database update_bacula_tables make_bacula_tables
/bin/rm -f grant_bacula_privileges drop_bacula_tables drop_bacula_database
/bin/rm -f create_bdb_database update_bdb_tables make_bdb_tables
/bin/rm -f grant_bdb_privileges drop_bdb_tables drop_bdb_database
/bin/rm -f create_mysql_database update_mysql_tables make_mysql_tables
/bin/rm -f grant_mysql_privileges drop_mysql_tables drop_mysql_database
/bin/rm -f create_postgresql_database update_postgresql_tables make_postgresql_tables
/bin/rm -f grant_postgresql_privileges drop_postgresql_tables drop_postgresql_database
/bin/rm -f create_sqlite_database update_sqlite_tables make_sqlite_tables
/bin/rm -f grant_sqlite_privileges drop_sqlite_tables drop_sqlite_database
/bin/rm -f create_sqlite3_database update_sqlite3_tables make_sqlite3_tables
/bin/rm -f grant_sqlite3_privileges drop_sqlite3_tables drop_sqlite3_database
/bin/rm -f mysql sqlite postgresql
/bin/rm -f make_catalog_backup delete_catalog_backupif test . = .; then make realclean; fi
make[2]: Entering directory `/Download/bacula-2.4.4/src/cats'
/bin/rm -f cats core a.out *.o *.a *.bak *~ *.intpro *.extpro 1 2 3/bin/rm -f tags
/bin/rm -f create_bacula_database update_bacula_tables make_bacula_tables
/bin/rm -f grant_bacula_privileges drop_bacula_tables drop_bacula_database
/bin/rm -f create_bdb_database update_bdb_tables make_bdb_tables
/bin/rm -f grant_bdb_privileges drop_bdb_tables drop_bdb_database
/bin/rm -f create_mysql_database update_mysql_tables make_mysql_tables
/bin/rm -f grant_mysql_privileges drop_mysql_tables drop_mysql_database
/bin/rm -f create_postgresql_database update_postgresql_tables make_postgresql_tables
/bin/rm -f grant_postgresql_privileges drop_postgresql_tables drop_postgresql_database
/bin/rm -f create_sqlite_database update_sqlite_tables make_sqlite_tables
/bin/rm -f grant_sqlite_privileges drop_sqlite_tables drop_sqlite_database
/bin/rm -f create_sqlite3_database update_sqlite3_tables make_sqlite3_tables
/bin/rm -f grant_sqlite3_privileges drop_sqlite3_tables drop_sqlite3_database
/bin/rm -f mysql sqlite postgresql
/bin/rm -f make_catalog_backup delete_catalog_backup
make[2]: Leaving directory `/Download/bacula-2.4.4/src/cats'(cd .; /bin/rm -f Makefile)
make[1]: Leaving directory `/Download/bacula-2.4.4/src/cats'
make[1]: Entering directory `/Download/bacula-2.4.4/src/dird'if test . = .; then make realclean; fi
make[2]: Entering directory `/Download/bacula-2.4.4/src/dird'
make[2]: Leaving directory `/Download/bacula-2.4.4/src/dird'(cd .; /bin/rm -f Makefile)
make[1]: Leaving directory `/Download/bacula-2.4.4/src/dird'
make[1]: Entering directory `/Download/bacula-2.4.4/src/stored'if test . = .; then make realclean; fi
make[2]: Entering directory `/Download/bacula-2.4.4/src/stored'
make[2]: Leaving directory `/Download/bacula-2.4.4/src/stored'(cd .; /bin/rm -f Makefile)
make[1]: Leaving directory `/Download/bacula-2.4.4/src/stored'
make[1]: Entering directory `/Download/bacula-2.4.4/src/tools'if test . = .; then make realclean; fi
make[2]: Entering directory `/Download/bacula-2.4.4/src/tools'
make[2]: Leaving directory `/Download/bacula-2.4.4/src/tools'(cd .; /bin/rm -f Makefile)
make[1]: Leaving directory `/Download/bacula-2.4.4/src/tools'
make[1]: Entering directory `/Download/bacula-2.4.4/manpages'/bin/rm -f *~ 1 2 3 *.bak/bin/rm -f Makefile
make[1]: Leaving directory `/Download/bacula-2.4.4/manpages'
==>Entering directory /Download/bacula-2.4.4/platforms
make[1]: Entering directory `/Download/bacula-2.4.4/platforms'
make[2]: Entering directory `/Download/bacula-2.4.4/platforms/redhat'
make[2]: Leaving directory `/Download/bacula-2.4.4/platforms/redhat'
make[1]: Leaving directory `/Download/bacula-2.4.4/platforms'


configure 都沒有錯誤訊息就可以進行 make 的動作。

#make

make 都沒有錯誤就可以進行 make install 來安裝套件

#make install

step 3. 在安裝完後要設定 mysql 的 datebase

在解開的 bacula-2.4.4 的 src/cat 下有一個 mysql 用的資料庫產生指令 make_mysql_tables來建立 database。

#cd src/cat
# ./make_mysql_tables

step 4. 要設定 bacula_sd 的 archive 設備

我們可以將目錄位置設給 bacula 做 archive 的設備.

#mkdir /root/bacula/archive

並在 bacula-sd.conf 設定相關目錄就可以用

Device {
Name = FileStorage
Media Type = File
Archive Device = /root/bacula/archive
LabelMedia = yes
Random Access = yes
AutomaticMount = yes
RemovableMedia = no Always
Open = no
}

正確完成之後我們要再建一個 bacula 專用的帳號,並設定相關權限就算完成 bacula 的安裝。

2009年4月7日 星期二

移除Microsoft Office 2007的中文輸入法

我在Vista 64Bit版本安裝完Microsoft Office 2007後,中文輸入法就有問題,原因是沒辦法用Ctrl-Shift來切換輸入法,所以解決辦法就是只解除Microsoft Office 2007的IME 2007套件,解除完回到Vista 內建的輸入法就一除正常。

解除方式如下:
C:\>msiexec.exe /X {90120000-0028-0404-0000-0000000FF1CE}

2009年4月3日 星期五

安裝ntop上的Local Network Traffic Map

參考文件:http://www.graphviz.org/Download_linux_rhel.php

由於ntop使用的Local Network Traffic Map需要 dot 的軟體套件才可以正確的呈現.

step 1.
若是用Centos請先行設定 yum 的設定,在目錄 /etc/yum.repos.d/ 下,新增 graphviz-rhel.repo 檔案,可直接下載檔案http://www.graphviz.org/graphviz-rhel.repo

step 2.
確認yum是否設定有正確
#yum list available 'graphviz*'

step 3.
執行安裝
#yum install 'graphviz*'
若安裝沒有問題應該會有 /usr/bin/dot 這個檔案。

step 4.
設定 ntop 的Local Network Traffic Map,若有需要必須增加 ntop 的Preference設定dot.path並填入參數/usr/bin/dot

step 5.
若一切正常使可以在 ntop 看到Local Network Traffic Map


附記
若有發生以下狀況問題:

# yum install 'graphviz*' Loading "fastestmirror" plugin
Loading mirror speeds from cached hostfile
* rpmforge: fr2.rpmfind.net
* base: ftp.chu.edu.tw
* updates: rsync.atworks.co.jp
* addons: ftp.cse.yzu.edu.tw
* extras: ftp.cse.yzu.edu.tw
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package graphviz-python.i386 0:2.22.0-4.el5.rf set to be updated
--> Processing Dependency: libgv_python.so.0 for package: graphviz-python
---> Package graphviz-lua.i386 0:2.8-1.el5.rf set to be updated
--> Processing Dependency: graphviz = 2.8-1.el5.rf for package: graphviz-lua
--> Processing Dependency: libgvc.so.2 for package: graphviz-lua
---> Package graphviz-devel.i386 0:2.22.0-4.el5.rf set to be updated
---> Package graphviz-tcl.i386 0:2.22.0-4.el5.rf set to be updated
--> Processing Dependency: tk for package: graphviz-tcl
--> Processing Dependency: libtk8.4.so for package: graphviz-tcl
---> Package graphviz-perl.i386 0:2.22.0-4.el5.rf set to be updated
--> Processing Dependency: libgv_perl.so.0 for package: graphviz-perl
---> Package graphviz.i386 0:2.22.0-4.el5.rf set to be updated
--> Processing Dependency: libgs.so.8 for package: graphviz
--> Processing Dependency: librsvg-2.so.2 for package: graphviz
---> Package graphviz-php.i386 0:2.8-1.el5.rf set to be updated
--> Processing Dependency: graphviz = 2.8-1.el5.rf for package: graphviz-php
--> Processing Dependency: libgvc.so.2 for package: graphviz-php
---> Package graphviz-ocaml.i386 0:2.8-1.el5.rf set to be updated
--> Processing Dependency: graphviz = 2.8-1.el5.rf for package: graphviz-ocaml
---> Package graphviz-ruby.i386 0:2.22.0-4.el5.rf set to be updated
--> Processing Dependency: libgv_ruby.so.0 for package: graphviz-ruby
--> Processing Dependency: /usr/bin/ruby for package: graphviz-ruby
---> Package graphviz-guile.i386 0:2.22.0-4.el5.rf set to be updated
---> Package graphviz-graphs.i386 0:2.22.0-4.el5.rf set to be updated
---> Package graphviz-doc.i386 0:2.22.0-4.el5.rf set to be updated
---> Package graphviz-java.i386 0:2.22.0-4.el5.rf set to be updated
--> Running transaction check
---> Package ruby.i386 0:1.8.5-5.el5_2.6 set to be updated
---> Package graphviz-python.i386 0:2.22.0-4.el5.rf set to be updated
--> Processing Dependency: libgv_python.so.0 for package: graphviz-python
---> Package graphviz-lua.i386 0:2.8-1.el5.rf set to be updated
--> Processing Dependency: graphviz = 2.8-1.el5.rf for package: graphviz-lua
--> Processing Dependency: libgvc.so.2 for package: graphviz-lua
---> Package graphviz-perl.i386 0:2.22.0-4.el5.rf set to be updated
--> Processing Dependency: libgv_perl.so.0 for package: graphviz-perl
---> Package graphviz-php.i386 0:2.8-1.el5.rf set to be updated
--> Processing Dependency: graphviz = 2.8-1.el5.rf for package: graphviz-php
--> Processing Dependency: libgvc.so.2 for package: graphviz-php
---> Package graphviz-ocaml.i386 0:2.8-1.el5.rf set to be updated
--> Processing Dependency: graphviz = 2.8-1.el5.rf for package: graphviz-ocaml
---> Package librsvg2.i386 0:2.16.1-1.el5 set to be updated
--> Processing Dependency: libcroco >= 0.6.1 for package: librsvg2
--> Processing Dependency: libgsf-1.so.114 for package: librsvg2
--> Processing Dependency: libcroco-0.6.so.3 for package: librsvg2
--> Processing Dependency: libgsf >= 1.6.0 for package: librsvg2
---> Package graphviz-ruby.i386 0:2.22.0-4.el5.rf set to be updated
--> Processing Dependency: libgv_ruby.so.0 for package: graphviz-ruby
---> Package ghostscript.i386 0:8.15.2-9.4.el5_3.4 set to be updated
--> Processing Dependency: ghostscript-fonts for package: ghostscript
--> Processing Dependency: urw-fonts >= 1.1 for package: ghostscript
---> Package tk.i386 0:8.4.13-5.el5_1.1 set to be updated
--> Running transaction check
---> Package graphviz-python.i386 0:2.22.0-4.el5.rf set to be updated
--> Processing Dependency: libgv_python.so.0 for package: graphviz-python
---> Package graphviz-lua.i386 0:2.8-1.el5.rf set to be updated
--> Processing Dependency: graphviz = 2.8-1.el5.rf for package: graphviz-lua
--> Processing Dependency: libgvc.so.2 for package: graphviz-lua
---> Package graphviz-perl.i386 0:2.22.0-4.el5.rf set to be updated
--> Processing Dependency: libgv_perl.so.0 for package: graphviz-perl
---> Package graphviz-php.i386 0:2.8-1.el5.rf set to be updated
--> Processing Dependency: graphviz = 2.8-1.el5.rf for package: graphviz-php
--> Processing Dependency: libgvc.so.2 for package: graphviz-php
---> Package graphviz-ocaml.i386 0:2.8-1.el5.rf set to be updated
--> Processing Dependency: graphviz = 2.8-1.el5.rf for package: graphviz-ocaml
---> Package graphviz-ruby.i386 0:2.22.0-4.el5.rf set to be updated
--> Processing Dependency: libgv_ruby.so.0 for package: graphviz-ruby
---> Package urw-fonts.noarch 0:2.3-6.1.1 set to be updated
---> Package ghostscript-fonts.noarch 0:5.50-13.1.1 set to be updated
---> Package libcroco.i386 0:0.6.1-2.1 set to be updated
---> Package libgsf.i386 0:1.14.1-6.1 set to be updated
--> Finished Dependency Resolution
Error: Missing Dependency: libgv_perl.so.0 is needed by package graphviz-perl
Error: Missing Dependency: libgvc.so.2 is needed by package graphviz-php
Error: Missing Dependency: libgv_python.so.0 is needed by package graphviz-python
Error: Missing Dependency: graphviz = 2.8-1.el5.rf is needed by package graphviz-php
Error: Missing Dependency: libgv_ruby.so.0 is needed by package graphviz-ruby
Error: Missing Dependency: libgvc.so.2 is needed by package graphviz-lua
Error: Missing Dependency: graphviz = 2.8-1.el5.rf is needed by package graphviz-lua
Error: Missing Dependency: graphviz = 2.8-1.el5.rf is needed by package graphviz-ocaml

可以試試下列方法.

#wget ftp://fr2.rpmfind.net/linux/dag/redhat/el5/en/i386/dag/RPMS/graphviz-2.8-1.el5.rf.i386.rpm
#rpm -ivh graphviz-2.8-1.el5.rf.i386.rpm
#yum install graphviz.i386

應該可以解決。

2009年4月2日 星期四

在cacti安裝ntop

參考文件: http://openmaniak.com/cacti_plugins.php

step1. 套件安裝
#apt-get install ntop

step2. 設定與執行
# ntop -u ntop -w 3000
這樣子在起動ntop後,第一次只要再輸入設定admin的確password就完成了並會自動執行。

step3. 調整與使用
若有安裝防火牆!要記得打開 tcp port 3000.
另外要使 ntop 改成 deamon 模式也要進入 ntop 後調整 config.
打開IE瀏覽器 http://ntop server ip:3000便可以進入.

step4. 安裝cacti的ntop plugin
#wget http://cactiusers.org/downloads/ntop.gzip
#tar -zxvf ntop.gzip
#move ntop /cacti/plugins/

step5. 修改 cacti plugins 設定文件
#vi /cacti/include/globol.php
在正碓的位子加入
$plugins[] = 'ntop';
存檔就完成了.

ps. 若看不到ntop 的標題頁,說得把 console->user management的view ntop打開.

2009年3月26日 星期四

UBNUNTU SERVER 事後安裝 X-WINDOWS

sudo apt-get install ubuntu-desktop
sudo apt-get install gdm
sudo /etc/init.d/gdm start
sudo dpkg-reconfigure xserver-xorg

2009年3月12日 星期四

安裝Sharepoint在AD建置之後

在安裝Sharepoint後執行Dcpromo指令,會把原本的網頁無法顯示,只會出現應用程式錯誤的畫面。詳細錯誤原因可以將C:\Inetpub\wwwroot\VirtualDirectories\80\web.config中修改其中的程式碼為:customerrors mode="RemoteOnly" ,就可以看到真正的錯誤原因。

原因是C:WINDOWS\Microsoft.NET\Framework\v2.0.5.0727的目錄安全性,少加了Network Service權限在裡面。

所以要手動的在C:WINDOWS\Microsoft.NET\Framework\v2.0.5.0727目錄下執行asp_netregiis -i指令,就可以解決。

參考: http://support.microsoft.com/kb/823379/zh-tw 文件.

2009年3月11日 星期三

移除 Microsoft SQL Server Embedded Edition

當在新增移除程式看到不的"Microsoft SQL Server 2005 Embedded Edition"時,可以開啟Regedit,找尋HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall下的各個GUID,找到名為"Microsoft SQL 2005 Embedded Edition"的項目,再把其中的UninstallString的字串值Copy出來。
(它長得會類似: MsiExec.exe /X{BDD79957-5801-4A2D-B09E-852E7FA64D01} ),放在Windows Console中,在把這個字串後方加點工,變成MsiExec.exe /X{BDD79957-5801-4A2D-B09E-852E7FA64D01} callerid=ocsetup.exe,執行就可以將SSEE移除,並在移完記得要重新開機,就完成了。

Notes:
(on 32-bit platforms)
msiexec /x {CEB5780F-1A70-44A9-850F-DE6C4F6AA8FB} callerid=ocsetup.exe
(on 64-bit platforms)
msiexec /x {BDD79957-5801-4A2D-B09E-852E7FA64D01} callerid=ocsetup.exe

2009年3月10日 星期二

Windows Sharepoint Service 3.0

1. Installed Windows Server 2003

2. Installed Windows Server 2003 SP3

3. installed .NET Framework 2.0

4. Setup IIS6.0 & ASP.NET & SMTP

5. Installed MSSQL Server 2005 Express ADVANCED

6. Setup for Include ALL Component in MSSQL

7. Installed WSS 3.0 With SP

2009年1月2日 星期五

webablize 2.01 upgrade 2.20-03

1. decompress package
#cd /Downloads
#tar zxvf webalizer-2.20-03-linuxelf-x86-bin.tgz
# cd /usr/bin
backup old webalize
# mv webalizer webalizer-2.01
copy new version
# cp /Downloads/webalize /usr/bin
test new version
#./webalize -v

if got error like

problem #1
#./webalizer -v
./webalizer: error while loading shared libraries: libbz2.so.1.0: cannot open shared object file: No such file or directory

try this
#locate libbz2
u may be found libbz2.s0.1 in /usr/lib

now create missing file
#cp /usr/lib/libbz2.so.1 /usr/lib/libbz2.so.1.0

problem #2
# ./webalizer -v
./webalizer: error while loading shared libraries: libdb-4.4.so: cannot open shared object file: No such file or directory

try this
#locate libdb-4
u may be found libdb-4.3.so in usr/lib, but no libdb-4.4.so
if we can't found real libdb-4.4.so now try to make one from libdb-4.3.so
# cp -s /lib/libd-4.3.so /lib/db-4.4.so

now fixed our missing file. lets try

# ./webalizer -v
we got result like below
===============================================================
./webalizer: /lib/libdb-4.4.so: no version information available (required by ./webalizer)
Webalizer V2.20-03 (Linux 2.6.18-92.1.17.el5 i686) English
Using logfile /var/log/httpd/access_log (clf)
DNS Lookup (10): Error: Unable to open DNS cache file /var/lib/webalizer/dns_cache.db
Creating output in /var/www/usageHostname for reports is '127.0.0.1'
Reading history file... /var/lib/webalizer/webalizer.hist
Reading previous run data.. /var/lib/webalizer/webalizer.current
Saving current run data... [01/02/2009 16:10:33]
Generating report for January 2009
Saving history information...
Generating summary report
115685 records (88243 ignored) in 4 seconds, 28921/sec
#
===============================================================

note:
libbz2.s0.1.0 is package bzip2 component
libdb4.4.so is package BerkeleyDB component

資料無價

做資訊的都知道 資料備份 很重要,但當資料因不可抗力或人為失誤弄掉了!  到底會想要花多少錢來救資料? 答案常常是越少越好~  最好是 免費 .... 那誰會要去救 .... 買備份設備就跟買保險一樣,有備無患,但重要的是有沒有買對設備,有備份也要有還原測試驗証,而且最好要一段時...