2010年8月9日 星期一
2010年7月8日 星期四
硬碟讀取效能測試
user@Linux:~$ sudo hdparm -Tt /dev/sda
/dev/sda:
Timing cached reads: 2260 MB in 2.00 seconds = 1129.71 MB/sec
Timing buffered disk reads: 362 MB in 3.01 seconds = 120.34 MB/sec
/dev/sda:
Timing cached reads: 2260 MB in 2.00 seconds = 1129.71 MB/sec
Timing buffered disk reads: 362 MB in 3.01 seconds = 120.34 MB/sec
2010年7月6日 星期二
網站監控 網站監測
收集了一下網站監控、網站監測方面的服務
來源http://ithelp.ithome.com.tw/question/10006993
1. Service UPtime - http://www.serviceuptime.com/index.php
專業、有效果的監控服務
2. Internet Supervision- http://internetsupervision.com
提供同時來自各地的監控
3. SiteUp Time- http://www.siteuptime.com/
多樣化的檢測報表
4. ServerMOJO- http://www.servermojo.com/
免費大量的監控組數
-------------------------------------------------------------------------
免費網站監控服務
來源http://www.freegroup.org/category/free-webmaster-tools/free-web-monitor/
-------------------------------------------------------------------------
實用的11款網站監測通知工具排行榜
來源http://wangzhan.xooob.com/wz/20098/385209.html#bak
1.Alertyx
2.Howsthe
3.Host-tracker
4.Monitorx
5.chinaz的網站服務器監測服務
6.Just Uptime
7.Site Uptime
8.WebPerform
9.Hyperspin
10.Site24×7
11.mon.itor.us
-------------------------------------------------------------------------------
來源http://ithelp.ithome.com.tw/question/10006993
1. Service UPtime - http://www.serviceuptime.com/index.php
專業、有效果的監控服務
2. Internet Supervision- http://internetsupervision.com
提供同時來自各地的監控
3. SiteUp Time- http://www.siteuptime.com/
多樣化的檢測報表
4. ServerMOJO- http://www.servermojo.com/
免費大量的監控組數
-------------------------------------------------------------------------
免費網站監控服務
來源http://www.freegroup.org/category/free-webmaster-tools/free-web-monitor/
-------------------------------------------------------------------------
實用的11款網站監測通知工具排行榜
來源http://wangzhan.xooob.com/wz/20098/385209.html#bak
1.Alertyx
2.Howsthe
3.Host-tracker
4.Monitorx
5.chinaz的網站服務器監測服務
6.Just Uptime
7.Site Uptime
8.WebPerform
9.Hyperspin
10.Site24×7
11.mon.itor.us
-------------------------------------------------------------------------------
2010年6月30日 星期三
2010年6月24日 星期四
ubuntu 8.04 AMD64 安裝flash player 10.1
最近開始使用64bit的ubuntu當桌機使用,
發現flash怪怪的,
會導致瀏覽器當機,
想跟換一下flash player看看,
發現adobe flash 10.1 沒有64位元版本的deb,
只好手動安裝了。
過程如下:
#Downloading and instaling Getlibs for required libraries
$wget -O getlibs-all.deb http://frozenfox.freehostia.com/cappy/getlibs-all.deb
$sudo dpkg -i getlibs-all.deb
#Removing previous installs of flash
$sudo rm -f /usr/lib/mozilla/plugins/*flash*
$sudo rm -f ~/.mozilla/plugins/*flash*
$sudo rm -f /usr/lib/firefox/plugins/*flash*
$sudo rm -f /usr/lib/firefox-addons/plugins/*flash*
$sudo rm -rfd /usr/lib/nspluginwrapper
#Installing ia32-libs and nspluginwrapper
$sudo apt-get install ia32-libs nspluginwrapper
#echo "Getting libs"
$sudo getlibs -p libcurl3
$sudo getlibs -p libnss3-1d
$sudo getlibs -p libnspr4-0d
#echo "Installing Flash Player 10"
$wget http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_10_linux.tar.gz
$tar zxvf install_flash_player_10_linux.tar.gz
$sudo cp libflashplayer.so /usr/lib/mozilla/plugins/
$rm -rf ~/install_flash_player_10_linux/
$sudo nspluginwrapper -i /usr/lib/mozilla/plugins/libflashplayer.so
#Linking the libraries so that firefox can see them
$sudo ln -sf /usr/lib/nspluginwrapper/plugins/npwrapper.libflashplayer.so /usr/lib/mozilla/plugins/
$sudo ln -sf /usr/lib/nspluginwrapper/plugins/npwrapper.libflashplayer.so /usr/lib/firefox-addons/plugins/
發現flash怪怪的,
會導致瀏覽器當機,
想跟換一下flash player看看,
發現adobe flash 10.1 沒有64位元版本的deb,
只好手動安裝了。
過程如下:
#Downloading and instaling Getlibs for required libraries
$wget -O getlibs-all.deb http://frozenfox.freehostia.com/cappy/getlibs-all.deb
$sudo dpkg -i getlibs-all.deb
#Removing previous installs of flash
$sudo rm -f /usr/lib/mozilla/plugins/*flash*
$sudo rm -f ~/.mozilla/plugins/*flash*
$sudo rm -f /usr/lib/firefox/plugins/*flash*
$sudo rm -f /usr/lib/firefox-addons/plugins/*flash*
$sudo rm -rfd /usr/lib/nspluginwrapper
#Installing ia32-libs and nspluginwrapper
$sudo apt-get install ia32-libs nspluginwrapper
#echo "Getting libs"
$sudo getlibs -p libcurl3
$sudo getlibs -p libnss3-1d
$sudo getlibs -p libnspr4-0d
#echo "Installing Flash Player 10"
$wget http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_10_linux.tar.gz
$tar zxvf install_flash_player_10_linux.tar.gz
$sudo cp libflashplayer.so /usr/lib/mozilla/plugins/
$rm -rf ~/install_flash_player_10_linux/
$sudo nspluginwrapper -i /usr/lib/mozilla/plugins/libflashplayer.so
#Linking the libraries so that firefox can see them
$sudo ln -sf /usr/lib/nspluginwrapper/plugins/npwrapper.libflashplayer.so /usr/lib/mozilla/plugins/
$sudo ln -sf /usr/lib/nspluginwrapper/plugins/npwrapper.libflashplayer.so /usr/lib/firefox-addons/plugins/
2010年6月21日 星期一
2010年6月9日 星期三
SNMP設定
開啟防火牆 port 161
iptables -I INPUT -p udp --dport 161 -j ACCEPT
檢查SNMP服務是否有正確開啟
snmpwalk -v 2c -c public localhost
iptables -I INPUT -p udp --dport 161 -j ACCEPT
檢查SNMP服務是否有正確開啟
snmpwalk -v 2c -c public localhost
2010年6月3日 星期四
Bandwidth Monitoring Tools for Ubuntu Users
http://www.ubuntugeek.com/bandwidth-monitoring-tools-for-ubuntu-users.html
文章中介紹了下面幾個頻寬監控軟體
bmon
bwbar
bwm
bwm-ng
iftop
iperf
ipfm
speedometer
cbm
ibmonitor
pktstat
mactrack
MRTG
Cacti
文章中介紹了下面幾個頻寬監控軟體
bmon
bwbar
bwm
bwm-ng
iftop
iperf
ipfm
speedometer
cbm
ibmonitor
pktstat
mactrack
MRTG
Cacti
2010年6月1日 星期二
流量監控軟體 vnstat安裝與設定
安裝
#sudo apt-get install vnstat
設定一下權限
#sudo chmod o+x /usr/bin/vnstat
#sudo chmod o+wx /var/lib/vnstat/
啟動監控
#sudo vnstat -u -i eth0
備註 : eth0請自行修改成主機網卡
以下為vmstat指令參考
vnstat : 單純啟動
vnstat -h 過去24hr的流量統計
vnstat -d 過去30天的每日的流量統計
vnstat -m 過去12個月的每月的流量統計
vnstat -t Top 10 的流量統計
vnstat -w 過去七天、上週與本週的流量統計
vnstat -tr Traffic average
vnstat -l traffic statistics
#sudo apt-get install vnstat
設定一下權限
#sudo chmod o+x /usr/bin/vnstat
#sudo chmod o+wx /var/lib/vnstat/
啟動監控
#sudo vnstat -u -i eth0
備註 : eth0請自行修改成主機網卡
以下為vmstat指令參考
vnstat : 單純啟動
vnstat -h 過去24hr的流量統計
vnstat -d 過去30天的每日的流量統計
vnstat -m 過去12個月的每月的流量統計
vnstat -t Top 10 的流量統計
vnstat -w 過去七天、上週與本週的流量統計
vnstat -tr Traffic average
vnstat -l traffic statistics
流量監控軟體
研究了一下流量監控軟體
目前看了這幾個軟體的網站,做個筆記
* ntop
* darkstat
* MRTG
* bwm-ng
* iftop
* IPTraf
* vnstat
ntop:有網路圖形介面,統計資料,可以知道連線ip。內容很詳細,但是感覺起來會吃資源
darkstat:有網路圖形介面,統計資料,可以知道連線ip (network traffic, calculates statistics about usage)
MRTG:很老牌了,應該不用介紹
bwm-ng:文字介面,即時的流量監控(Bandwidth Monitor)
iftop:文字介面,有即時流量顯示跟顯示連線裝況 (bandwidth usage, traffic monitor)
IPtraf:文字介面,可以用網路卡、TCP/UDP、Port來分類,也有連線ip顯示(network statistics,traffic monitor)
vnstat:文字介面traffic monitor,使用kernel上面的資訊來顯示統計資料(這樣應該比較不吃資源),可顯示即時流量,時、日、週的流量統計。
只能大致寫一下,詳細說明就看上面的Link吧
目前看了這幾個軟體的網站,做個筆記
* ntop
* darkstat
* MRTG
* bwm-ng
* iftop
* IPTraf
* vnstat
ntop:有網路圖形介面,統計資料,可以知道連線ip。內容很詳細,但是感覺起來會吃資源
darkstat:有網路圖形介面,統計資料,可以知道連線ip (network traffic, calculates statistics about usage)
MRTG:很老牌了,應該不用介紹
bwm-ng:文字介面,即時的流量監控(Bandwidth Monitor)
iftop:文字介面,有即時流量顯示跟顯示連線裝況 (bandwidth usage, traffic monitor)
IPtraf:文字介面,可以用網路卡、TCP/UDP、Port來分類,也有連線ip顯示(network statistics,traffic monitor)
vnstat:文字介面traffic monitor,使用kernel上面的資訊來顯示統計資料(這樣應該比較不吃資源),可顯示即時流量,時、日、週的流量統計。
只能大致寫一下,詳細說明就看上面的Link吧
2010年5月31日 星期一
MySQL遠端連線 遠端mysqldump
要在my.cnf 中將他開啟
#vi /etc/mysql/my.cnf
找到下面兩行將他註解掉
skip-networking
bind-address=127.0.0.1
重開MySQL
#/etc/init.d/mysql restart
再來使用者也必須設定為可以遠端的權限
用 root 登入 mysql
mysql>GRANT ALL PRIVILEGES ON *.* TO 'user'@'192.168.1.1' IDENTIFIED BY 'password';
mysql>flush privileges;
遠端mysqldump
#mysqldump -uuser -h 192.168.1.200 -p test > test.sql
#vi /etc/mysql/my.cnf
找到下面兩行將他註解掉
skip-networking
bind-address=127.0.0.1
重開MySQL
#/etc/init.d/mysql restart
再來使用者也必須設定為可以遠端的權限
用 root 登入 mysql
mysql>GRANT ALL PRIVILEGES ON *.* TO 'user'@'192.168.1.1' IDENTIFIED BY 'password';
mysql>flush privileges;
遠端mysqldump
#mysqldump -uuser -h 192.168.1.200 -p test > test.sql
2010年5月26日 星期三
ubuntu ssh keygen
username@ubuntu:~$ ssh-keygen -t dsa
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/username/.ssh/id_dsa
Your public key has been saved in /home/username/.ssh/id_dsa.pub
username@ubuntu:~$ cd .ssh/
This moves you into .ssh directory where the keys were saved. Now to copy the public key to the server.
username@ubuntu:~$ scp id_dsa.pub id@serverIP:./id_dsa.pub
Logging server
username@server:~$ cd .ssh
serverusername@server:~$ touch authorized_keys2
serverusername@server:~$ chmod 600 authorized_keys2
serverusername@server:~$ cat ../id_dsa.pub >> authorized_keys2
serverusername@server:~$ rm ../id_dsa.pub
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/username/.ssh/id_dsa
Your public key has been saved in /home/username/.ssh/id_dsa.pub
username@ubuntu:~$ cd .ssh/
This moves you into .ssh directory where the keys were saved. Now to copy the public key to the server.
username@ubuntu:~$ scp id_dsa.pub id@serverIP:./id_dsa.pub
Logging server
username@server:~$ cd .ssh
serverusername@server:~$ touch authorized_keys2
serverusername@server:~$ chmod 600 authorized_keys2
serverusername@server:~$ cat ../id_dsa.pub >> authorized_keys2
serverusername@server:~$ rm ../id_dsa.pub
2010年5月5日 星期三
apache 開啟rewrite url功能
使用 Apache web server 的ReWrite 設定,
可將原本是『http://ecmall.lefthander.tw/index.php?app=goods&id=198』的url
變成『http://ecmall.lefthander.tw/goods/198』
這樣的好處是url變短了,看起來很像靜態的html
對SEO來講有很大的幫助
但是在開始寫ReWrite rule之前必須先開啟apache rewrite的module
以ubuntu為例:
只要下一個指令就好了
a2enmode rewrite
之後在apache中再寫入正規表示語法
可以參考這邊我就不多寫了
http://rental.zhupiter.com/postshow_178_1_1.html
可將原本是『http://ecmall.lefthander.tw/index.php?app=goods&id=198』的url
變成『http://ecmall.lefthander.tw/goods/198』
這樣的好處是url變短了,看起來很像靜態的html
對SEO來講有很大的幫助
但是在開始寫ReWrite rule之前必須先開啟apache rewrite的module
以ubuntu為例:
只要下一個指令就好了
a2enmode rewrite
之後在apache中再寫入正規表示語法
可以參考這邊我就不多寫了
http://rental.zhupiter.com/postshow_178_1_1.html
2010年4月20日 星期二
Ubuntu的VNC Server(x11vnc)
因為螢幕送修,想要用Notebook遠端登入我的桌機,
本來測試的是VNC,但是不太會弄,
後來google搜尋到x11vnc,看起來蠻容易的,
就試裝了一下還蠻快地
1.安裝x11vnc
sudo apt-get install x11vnc
2.安裝xinetd
sudo apt-get install xinetd
3.將x11vnc加入xinetd
sudo gedit /etc/xinetd.d/x11vnc
加入這段
----------------------------------------
service x11vnc
{
port = 5900
type = UNLISTED
socket_type = stream
protocol = tcp
wait = no
user = root
server = /usr/bin/x11vnc
server_args = -inetd -o /var/log/x11vnc.log -display :0 -auth /var/lib/gdm/:0.Xauth -many -bg
disable = no
}
--------------------------------------------
4.restart xinetd
sudo /etc/init.d/xinetd start
就完成了
本來測試的是VNC,但是不太會弄,
後來google搜尋到x11vnc,看起來蠻容易的,
就試裝了一下還蠻快地
1.安裝x11vnc
sudo apt-get install x11vnc
2.安裝xinetd
sudo apt-get install xinetd
3.將x11vnc加入xinetd
sudo gedit /etc/xinetd.d/x11vnc
加入這段
----------------------------------------
service x11vnc
{
port = 5900
type = UNLISTED
socket_type = stream
protocol = tcp
wait = no
user = root
server = /usr/bin/x11vnc
server_args = -inetd -o /var/log/x11vnc.log -display :0 -auth /var/lib/gdm/:0.Xauth -many -bg
disable = no
}
--------------------------------------------
4.restart xinetd
sudo /etc/init.d/xinetd start
就完成了
2010年4月15日 星期四
rsync 透過ssh到遠端server
一般狀況下透過ssh使用rsync:
用rsync透過ssh把DATA底下的資料傳送到遠端的主機home/user/DATA/底下,
rsync -av --delete /DATA/ -e ssh -p user@123.123.123.123:/home/user/DATA/
用rsync透過ssh把遠端的主機的home/user/DATA/底下的資料 下載到/DATA/底下
rsync -av --delete -e ssh user@123.123.123.123:/home/user/DATA/ /DATA/
如果ssh port改成1122
用rsync透過ssh把DATA底下的資料傳送到遠端的主機home/user/DATA/底下,
rsync -av --delete /DATA/ -e 'ssh -p 1122' user@123.123.123.123:/home/user/DATA/
用rsync透過ssh把遠端的主機的home/user/DATA/底下的資料 下載到/DATA/底下
rsync -av --delete -e 'ssh -p 1122' user@123.123.123.123:/home/user/DATA/ /DATA/
#2010/6/29更新
如果要加上exclude設定
rsync -e 'ssh -p 30000' -avl --delete --exclude 'sources' --exclude 'public_html/database.txt' user@123.123.123.123:/home/test /backup/
用rsync透過ssh把DATA底下的資料傳送到遠端的主機home/user/DATA/底下,
rsync -av --delete /DATA/ -e ssh -p user@123.123.123.123:/home/user/DATA/
用rsync透過ssh把遠端的主機的home/user/DATA/底下的資料 下載到/DATA/底下
rsync -av --delete -e ssh user@123.123.123.123:/home/user/DATA/ /DATA/
如果ssh port改成1122
用rsync透過ssh把DATA底下的資料傳送到遠端的主機home/user/DATA/底下,
rsync -av --delete /DATA/ -e 'ssh -p 1122' user@123.123.123.123:/home/user/DATA/
用rsync透過ssh把遠端的主機的home/user/DATA/底下的資料 下載到/DATA/底下
rsync -av --delete -e 'ssh -p 1122' user@123.123.123.123:/home/user/DATA/ /DATA/
#2010/6/29更新
如果要加上exclude設定
rsync -e 'ssh -p 30000' -avl --delete --exclude 'sources' --exclude 'public_html/database.txt' user@123.123.123.123:/home/test /backup/
2010年4月12日 星期一
ubuntu apache Virtualhost設定
兩種作法
第一種 通通寫在 /etc/apache2/sites-available/default裡面
http://blog.udn.com/nigerchen/2268669
第二種 在/etc/apache2/sites-available/分開不同的設定檔
http://www.arthurtoday.com/2009/11/apache.html
我們用第二種方式來作範例
假設這次要架的網站是 : abc.tiger.com
建立Virtual Host設定檔
在 /etc/apache2/sites-available 下,建立檔案 abc.tiger.com
sudo touch /etc/apache2/sites-available/abc.tiger.com
修改設定檔 /etc/apache2/sites-available/abc.tiger.com
VirtualHost *:80 (要用括號)
ServerAdmin admin@abc.tiger.com #管理者帳號 不一定要設定
ServerName abc.tiger.com #網域名稱
ServerAlias cloud.tiger.com #網站別名 不一定要設定
DocumentRoot /var/www/tiger/ #網站的根目錄
/VirtualHost (要用括號)
啟用虛擬網站
sudo a2ensite abc.tiger.com
重新載 Apache 的設定
sudo /etc/init.d/apache2 reload
停用這個Virtualhost
sudo a2dissite abc.tiger.com
sudo /etc/init.d/apache2 reload
第一種 通通寫在 /etc/apache2/sites-available/default裡面
http://blog.udn.com/nigerchen/2268669
第二種 在/etc/apache2/sites-available/分開不同的設定檔
http://www.arthurtoday.com/2009/11/apache.html
我們用第二種方式來作範例
假設這次要架的網站是 : abc.tiger.com
建立Virtual Host設定檔
在 /etc/apache2/sites-available 下,建立檔案 abc.tiger.com
sudo touch /etc/apache2/sites-available/abc.tiger.com
修改設定檔 /etc/apache2/sites-available/abc.tiger.com
VirtualHost *:80 (要用括號)
ServerAdmin admin@abc.tiger.com #管理者帳號 不一定要設定
ServerName abc.tiger.com #網域名稱
ServerAlias cloud.tiger.com #網站別名 不一定要設定
DocumentRoot /var/www/tiger/ #網站的根目錄
/VirtualHost (要用括號)
啟用虛擬網站
sudo a2ensite abc.tiger.com
重新載 Apache 的設定
sudo /etc/init.d/apache2 reload
停用這個Virtualhost
sudo a2dissite abc.tiger.com
sudo /etc/init.d/apache2 reload
ubuntu 安裝dovecot
安裝PHPList本來用google收退信,
但是後來換了一台主機後怎麼設定認證都不通過,
就自己奘個pop3來試試看吧!!!
在ubuntu Server 8.04上面安裝dovecot
sudo apt-get install dovecot-imapd dovecot-pop3d
編輯etc/dovecot/dovecot.conf
protocols = pop3 pop3s imap imaps #看需要用到哪些協定
基本上這樣就可以work,詳細設定請看下面網址:
https://help.ubuntu.com/8.04/serverguide/C/dovecot-server.html
但是後來換了一台主機後怎麼設定認證都不通過,
就自己奘個pop3來試試看吧!!!
在ubuntu Server 8.04上面安裝dovecot
sudo apt-get install dovecot-imapd dovecot-pop3d
編輯etc/dovecot/dovecot.conf
protocols = pop3 pop3s imap imaps #看需要用到哪些協定
基本上這樣就可以work,詳細設定請看下面網址:
https://help.ubuntu.com/8.04/serverguide/C/dovecot-server.html
2010年4月11日 星期日
調整PHPList 的 message屬性
PHPList電子報會被切掉,
要調整MySQL裡面message的屬性改成longtext
MySQL語法如下
ALTER TABLE `phplist`.`phplist_message` MODIFY COLUMN `message` LONGTEXT CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL;
要調整MySQL裡面message的屬性改成longtext
MySQL語法如下
ALTER TABLE `phplist`.`phplist_message` MODIFY COLUMN `message` LONGTEXT CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL;
用指令撈出MySQL裡面的資料
範例
撈出ucenter用戶的Email Address
echo 'SELECT email from uc_member' | mysql -B -uroot -pxxxxxx tiger_uc > Tiger.MailAddress
echo 'SELECT Table_Columns from Table_Name' | mysql -B -uUSER -pPASSWORD DataBase_Name > file_name
撈出ucenter用戶的Email Address
echo 'SELECT email from uc_member' | mysql -B -uroot -pxxxxxx tiger_uc > Tiger.MailAddress
echo 'SELECT Table_Columns from Table_Name' | mysql -B -uUSER -pPASSWORD DataBase_Name > file_name
Ubuntu 10.04 LTS (Lucid Lynx) Beta2
下載網址如下
http://releases.ubuntu.com/releases/10.04/
4/8release的
不過我應該會直接等Final版本4/29
Ubuntu 10.04 LTS (Lucid Lynx) 發行時程表
http://releases.ubuntu.com/releases/10.04/
4/8release的
不過我應該會直接等Final版本4/29
Ubuntu 10.04 LTS (Lucid Lynx) 發行時程表
2010年4月9日 星期五
一些常用的MySQL設定與指令
安裝並設定 MySQL Server 5.0.51a
執行指令: apt-get install mysql-server-5.0
設定 MySQL 預設編碼及連線參數: vim /etc/mysql/my.cnf
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
default-character-set=utf8
default-collation=utf8_general_ci
<----- br="">
[mysqld]
#
# * Basic Settings
#
<----- br=""><----- br="">character-set-server=utf8 ----->----->----->
<----- br=""><----- br=""><----- br=""><----- br="">collation-server=utf8_general_ci ----->----->----->----->
<----- br=""><----- br=""><----- br=""><----- br=""><----- br="">init-connect='SET NAMES utf8' <----- br="">
#
# * Fine Tuning
#
key_buffer = 16M
max_allowed_packet = 16M
thread_stack = 128K
thread_cache_size = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover = BACKUP
#max_connections = 100
max_connections = 500 <----- br="">
重新啟動 MySQL Server: 執行指令 /etc/init.d/mysql restart
建立新的DataBase
create database `DB_Name` default charset utf8 collate utf8_general_ci;
建立新的使用者
GRANT ALL PRIVILEGES ON DB_Name.* TO 'user_name'@localhost IDENTIFIED BY 'password';----->----->----->----->----->----->----->
執行指令: apt-get install mysql-server-5.0
設定 MySQL 預設編碼及連線參數: vim /etc/mysql/my.cnf
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
default-character-set=utf8
default-collation=utf8_general_ci
<----- br="">
[mysqld]
#
# * Basic Settings
#
<----- br=""><----- br="">character-set-server=utf8 ----->----->----->
<----- br=""><----- br=""><----- br=""><----- br="">collation-server=utf8_general_ci ----->----->----->----->
<----- br=""><----- br=""><----- br=""><----- br=""><----- br="">init-connect='SET NAMES utf8' <----- br="">
#
# * Fine Tuning
#
key_buffer = 16M
max_allowed_packet = 16M
thread_stack = 128K
thread_cache_size = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover = BACKUP
#max_connections = 100
max_connections = 500 <----- br="">
重新啟動 MySQL Server: 執行指令 /etc/init.d/mysql restart
建立新的DataBase
create database `DB_Name` default charset utf8 collate utf8_general_ci;
建立新的使用者
GRANT ALL PRIVILEGES ON DB_Name.* TO 'user_name'@localhost IDENTIFIED BY 'password';----->----->----->----->----->----->----->
2010年4月6日 星期二
ubuntu linux底下 下載mms, rtsp 影音串流檔
使用mimms
只有文字介面歐
先安裝
$sudo apt-get install mimms
用法:
$mimms mms://url.123.wmv 123.wmv
只有文字介面歐
先安裝
$sudo apt-get install mimms
用法:
$mimms mms://url.123.wmv 123.wmv
2010年4月1日 星期四
ubunt server 8.04 安裝VMware server 2.0
本來是想安裝在ubuntu 9.10但是裝了半天裝不起來,
試了很多的patch跟fix,最後還是放棄了。
就乖乖裝在ubuntu server 8.04吧
$ sudo aptitude install build-essential
$ sudo apt-get install linux-headers-`uname -r` build-essential #裝此 Linux 版本的 C header file
下載VMware server ...略
$ tar xzvf VMware-server-2.0.2-203138.x86_64.tar.gz #解壓縮
$ cd /vmware-server-distrib
$ sudo ./vmware-install.pl
如果要看比較詳細的介紹可以點選底下的好文推薦
好文推薦
試了很多的patch跟fix,最後還是放棄了。
就乖乖裝在ubuntu server 8.04吧
$ sudo aptitude install build-essential
$ sudo apt-get install linux-headers-`uname -r` build-essential #裝此 Linux 版本的 C header file
下載VMware server ...略
$ tar xzvf VMware-server-2.0.2-203138.x86_64.tar.gz #解壓縮
$ cd /vmware-server-distrib
$ sudo ./vmware-install.pl
如果要看比較詳細的介紹可以點選底下的好文推薦
好文推薦
usb自動掛載
在ubuntu server底下,插入USB裝置是不會自動掛載的,
最近想偷懶在測試的server上面裝上桌面環境,
裝了桌面環境現在又想加上自動掛載的功能。
步驟很簡單
$sudo apt-get install usbmount
就這樣一行指令解決
其他相關設定在這個檔案裡
/etc/usbmount/usbmount.conf
可以參考底下這篇文章
http://soft.zdnet.com.cn/software_zone/2007/0927/526898.shtml
最近想偷懶在測試的server上面裝上桌面環境,
裝了桌面環境現在又想加上自動掛載的功能。
步驟很簡單
$sudo apt-get install usbmount
就這樣一行指令解決
其他相關設定在這個檔案裡
/etc/usbmount/usbmount.conf
可以參考底下這篇文章
http://soft.zdnet.com.cn/software_zone/2007/0927/526898.shtml
2010年3月31日 星期三
ubuntu server安裝桌面環境(二) 有中文系統歐
如果是ubuntu server想安裝桌面環境
又想使用中文系統可以參考這篇
ubuntu BASE + LXDE指南
http://wiki.ubuntu-tw.org/index.php?title=%E5%AE%89%E8%A3%9D_Ubuntu_Base_%2B_LXDE_%E6%8C%87%E5%8D%97_(%E7%89%B9%E5%88%A5%E9%81%A9%E5%90%88%E4%BD%8E%E9%9A%8E%E7%A1%AC%E9%AB%94)
又想使用中文系統可以參考這篇
ubuntu BASE + LXDE指南
http://wiki.ubuntu-tw.org/index.php?title=%E5%AE%89%E8%A3%9D_Ubuntu_Base_%2B_LXDE_%E6%8C%87%E5%8D%97_(%E7%89%B9%E5%88%A5%E9%81%A9%E5%90%88%E4%BD%8E%E9%9A%8E%E7%A1%AC%E9%AB%94)
2010年3月30日 星期二
ubuntu server 安裝桌面
GNOME桌面環境
ubuntu:~$ sudo apt-get install ubuntu-desktop
輕巧的桌面環境Xfce
ubuntu:~$ sudo apt-get install xubuntu-desktop
KDE桌面環境
ubuntu:~$ sudo apt-get install kubuntu-desktop
另外有個輕量化的桌面LXDE
ubuntu:~$ sudo vi /etc/apt/sources.list
...
deb http://ppa.launchpad.net/lxde/ubuntu hardy main
deb-src http://ppa.launchpad.net/lxde/ubuntu hardy main
...
ubuntu:~$ sudo apt-get install lxde
------------------------------------------------------------
另外一個方式
sudo apt-get update
安裝 X windows系統
sudo apt-get install x-window-system-core。
安裝登錄管理器
sudo apt-get install gdm (xdm/gdm/kdm都可以,看個人喜好)
安裝桌面環境
sudo apt-get install ubuntu-desktop
啟動gdm
sudo /etc/init.d/gdm start
sudo dpkg-reconfigure xserver-xorg
ubuntu-desktop/kubuntu-desktop/xubuntu-desktop分別是安裝 GNOME、KDE、XFCE 桌面環境
另外還有windows管理器
sudo apt-get install fluxbox/icewm/enlightenment/fvwm
ubuntu:~$ sudo apt-get install ubuntu-desktop
輕巧的桌面環境Xfce
ubuntu:~$ sudo apt-get install xubuntu-desktop
KDE桌面環境
ubuntu:~$ sudo apt-get install kubuntu-desktop
另外有個輕量化的桌面LXDE
ubuntu:~$ sudo vi /etc/apt/sources.list
...
deb http://ppa.launchpad.net/lxde/ubuntu hardy main
deb-src http://ppa.launchpad.net/lxde/ubuntu hardy main
...
ubuntu:~$ sudo apt-get install lxde
------------------------------------------------------------
另外一個方式
sudo apt-get update
安裝 X windows系統
sudo apt-get install x-window-system-core。
安裝登錄管理器
sudo apt-get install gdm (xdm/gdm/kdm都可以,看個人喜好)
安裝桌面環境
sudo apt-get install ubuntu-desktop
啟動gdm
sudo /etc/init.d/gdm start
sudo dpkg-reconfigure xserver-xorg
ubuntu-desktop/kubuntu-desktop/xubuntu-desktop分別是安裝 GNOME、KDE、XFCE 桌面環境
另外還有windows管理器
sudo apt-get install fluxbox/icewm/enlightenment/fvwm
2010年3月22日 星期一
Windows 7 KB971033
Windows 7 編號 KB971033 的更新先不要安裝
http://chinese.engadget.com/2010/02/25/windows-7-activation-technologies-update-now-live-ready-to-be-d/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed:+engadget/chinese+(Engadget+Chinese)&utm_content=Google+Reader
http://chinese.engadget.com/2010/02/25/windows-7-activation-technologies-update-now-live-ready-to-be-d/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed:+engadget/chinese+(Engadget+Chinese)&utm_content=Google+Reader
2010年3月17日 星期三
2010年3月12日 星期五
How to uninstall openjdk 如何移除openjdk
我這邊裝的是1.6版的
以ubuntu為例
sudo apt-get remove openjdk-6-jre
以CentOs為例
yum remove java-1.6.0-openjdk
如果是1.4.2版,我是這樣移除掉,不知道方式是不是正確的
yum remove java-1.4.2
以ubuntu為例
sudo apt-get remove openjdk-6-jre
以CentOs為例
yum remove java-1.6.0-openjdk
如果是1.4.2版,我是這樣移除掉,不知道方式是不是正確的
yum remove java-1.4.2
2010年3月10日 星期三
用fstab自動mount NFS
修改 /etc/fstab這個檔案
#NFS主機與分享的資料夾 本機路徑 格式 後面我就不知道了要在查查看
192.168.10.22:/nfs/test /mnt/test nfs rsize=8192,wsize=8192,timeo=14,intr
#NFS主機與分享的資料夾 本機路徑 格式 後面我就不知道了要在查查看
192.168.10.22:/nfs/test /mnt/test nfs rsize=8192,wsize=8192,timeo=14,intr
使用 autofs 掛載 NFS 檔案系統
要先安裝autofs
以ubuntu為例
#sudo apt-get install autofs
安裝完畢
修該/etc/auto.master
#sudo nano /etc/auto.master
以我的機器為例我希望/mnt/nfs第下的資料夾來作autofs
所以加上這行
/mnt/nfs /etc/auto.nfs
之後修改/etc/auto.nfs 這個檔案要自己create歐
我要去mount 192.168.10.9上面的/nfs/101 在本機的/mnt/nfs上面
#sudo nano etc/auto.nfs
加上這行
nas -rw,bg,soft,rsize=32768,wsize=32768 192.168.10.9:/nfs/101
重新啟動autofs
#sudo /etc/init.d/autofs restart
先進去資料夾才會有自動掛載的動作
#cd /mnt/nfs/nas
用df指令查看
#df
Filesystem 1K-blocks Used Available Use% Mounted on
192.168.10.99:/nfs/101 5859033472 79112536 5779920936 2% /mnt/nfs/nas
看到這行就表示OK了
以ubuntu為例
#sudo apt-get install autofs
安裝完畢
修該/etc/auto.master
#sudo nano /etc/auto.master
以我的機器為例我希望/mnt/nfs第下的資料夾來作autofs
所以加上這行
/mnt/nfs /etc/auto.nfs
之後修改/etc/auto.nfs 這個檔案要自己create歐
我要去mount 192.168.10.9上面的/nfs/101 在本機的/mnt/nfs上面
#sudo nano etc/auto.nfs
加上這行
nas -rw,bg,soft,rsize=32768,wsize=32768 192.168.10.9:/nfs/101
重新啟動autofs
#sudo /etc/init.d/autofs restart
先進去資料夾才會有自動掛載的動作
#cd /mnt/nfs/nas
用df指令查看
#df
Filesystem 1K-blocks Used Available Use% Mounted on
192.168.10.99:/nfs/101 5859033472 79112536 5779920936 2% /mnt/nfs/nas
看到這行就表示OK了
2010年3月9日 星期二
ubuntu 查看硬碟UUID
幫公司主機裝了一顆硬碟,
所以要設定/etc/fstab,
發現ubuntu是用UUID來設定的。
上網查了一下UUID的查詢方式
#ls -l /dev/disk/by-uuid/
就出現下列結果
lrwxrwxrwx 1 root root 10 2010-01-30 17:07 7dc69aa0-499f-4ba5-b064-3fca2c1f62ca -> ../../sda1
lrwxrwxrwx 1 root root 10 2010-01-30 17:07 a06fce26-920e-4ece-9b1c-ded6e4f0abb3 -> ../../sda2
lrwxrwxrwx 1 root root 10 2010-01-30 17:07 c450e37f-03ce-4f84-8dfb-3828c9f7c4a3 -> ../../sdb1
那我要把sdb1開機時自動掛載到/mnt/disk
就要修改/etc/fstab
加上這行
UUID=c450e37f-03ce-4f84-8dfb-3828c9f7c4a3 /mnt/disk ext3 default 0 0
就搞定了
所以要設定/etc/fstab,
發現ubuntu是用UUID來設定的。
上網查了一下UUID的查詢方式
#ls -l /dev/disk/by-uuid/
就出現下列結果
lrwxrwxrwx 1 root root 10 2010-01-30 17:07 7dc69aa0-499f-4ba5-b064-3fca2c1f62ca -> ../../sda1
lrwxrwxrwx 1 root root 10 2010-01-30 17:07 a06fce26-920e-4ece-9b1c-ded6e4f0abb3 -> ../../sda2
lrwxrwxrwx 1 root root 10 2010-01-30 17:07 c450e37f-03ce-4f84-8dfb-3828c9f7c4a3 -> ../../sdb1
那我要把sdb1開機時自動掛載到/mnt/disk
就要修改/etc/fstab
加上這行
UUID=c450e37f-03ce-4f84-8dfb-3828c9f7c4a3 /mnt/disk ext3 default 0 0
就搞定了
2010年3月8日 星期一
disable root ssh ubuntu
為了主機安全,應該關掉root可以遠端登入
作法如下
$sudo nano /etc/ssh/sshd_config
PermitRootLogin yes
改成PermitRootLogin no
作法如下
$sudo nano /etc/ssh/sshd_config
PermitRootLogin yes
改成PermitRootLogin no
ubuntu ssh keygen
username@ubuntu:~$ ssh-keygen -t dsa
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/username/.ssh/id_dsa
Your public key has been saved in /home/username/.ssh/id_dsa.pub
username@ubuntu:~$ cd .ssh/
This moves you into .ssh directory where the keys were saved. Now to copy the public key to the server.
username@ubuntu:~$ scp id_dsa.pub serverusername@serverIP:./id_dsa.pub
Logging server
username@server:~$ cd .ssh
serverusername@server:~$ touch authorized_keys2
serverusername@server:~$ chmod 600 authorized_keys2
serverusername@server:~$ cat ../id_dsa.pub >> authorized_keys2
serverusername@server:~$ rm ../id_dsa.pub
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/username/.ssh/id_dsa
Your public key has been saved in /home/username/.ssh/id_dsa.pub
username@ubuntu:~$ cd .ssh/
This moves you into .ssh directory where the keys were saved. Now to copy the public key to the server.
username@ubuntu:~$ scp id_dsa.pub serverusername@serverIP:./id_dsa.pub
Logging server
username@server:~$ cd .ssh
serverusername@server:~$ touch authorized_keys2
serverusername@server:~$ chmod 600 authorized_keys2
serverusername@server:~$ cat ../id_dsa.pub >> authorized_keys2
serverusername@server:~$ rm ../id_dsa.pub
RHCE考試異動
Red Hat原廠宣布:從2009/5/1起RHCE考試更改考試流程
更改內容如下:
考試時間縮短為3.5小時,下午1:00開始考試
考試內容將「實機除錯」及「安裝設定」兩者合而為一
另外可以用中文考試
我之前可是考英文的
更改內容如下:
考試時間縮短為3.5小時,下午1:00開始考試
考試內容將「實機除錯」及「安裝設定」兩者合而為一
另外可以用中文考試
我之前可是考英文的
網路效能測試工具 iperf
要有兩台電腦
一台當server , 一台作client
安裝方式
#sudo apt-get install iperf
裝好了,蠻簡單的
兩台都要安裝歐
測試方式如下
一台當server,一台當client
server端 # iperf -s
client端 #iperf -c 192.168.0.199 -t 60 -i 2
一台當server , 一台作client
安裝方式
#sudo apt-get install iperf
裝好了,蠻簡單的
兩台都要安裝歐
測試方式如下
一台當server,一台當client
server端 # iperf -s
client端 #iperf -c 192.168.0.199 -t 60 -i 2
Linux自動更新
因為工作上同時需要管理Red hat 跟ubuntu,
所以系統跟新yum跟apt都會用到
YUM為例
#vi /etc/crontab
40 12 * * * root yum -y update && yum clean packages
APT為例
#vi /etc/crontab
40 12 * * * root /usr/bin/apt-get update && /usr/bin/apt-get -y dist-upgrade
這樣晚上12:40主機就會自動更新了
所以系統跟新yum跟apt都會用到
YUM為例
#vi /etc/crontab
40 12 * * * root yum -y update && yum clean packages
APT為例
#vi /etc/crontab
40 12 * * * root /usr/bin/apt-get update && /usr/bin/apt-get -y dist-upgrade
這樣晚上12:40主機就會自動更新了
2010年3月4日 星期四
SAMSUNG 推出Linux 為基礎的自主作業系統 bada
SAMSUNG 發展自有平台的野心
http://mag.udn.com/mag/digital/storypage.jsp?f_ART_ID=236428
SAMSUNG推出以 Linux 為基礎的自主作業系統 bada,
繼Andriod後是否又有另外的Linux作業系統殺入手機市場,
請大家拭目以待‧
兩岸華人要加油了,兩岸的資訊產業大多在幫歐美大廠代工硬體,
不敢出自己的作業系統,深怕得罪歐美大廠。
賺的了一時,但未來在哪?
http://mag.udn.com/mag/digital/storypage.jsp?f_ART_ID=236428
SAMSUNG推出以 Linux 為基礎的自主作業系統 bada,
繼Andriod後是否又有另外的Linux作業系統殺入手機市場,
請大家拭目以待‧
兩岸華人要加油了,兩岸的資訊產業大多在幫歐美大廠代工硬體,
不敢出自己的作業系統,深怕得罪歐美大廠。
賺的了一時,但未來在哪?
2010年3月1日 星期一
Google Chrome OS 初體驗

我是利用VirtualBox來開啟Chrome OS,
速度非常快,
用Gmail帳號登入就可以使用了。
下次要來試試看自己Build的版本
自己build的話可以試試看底下這篇的介紹
Getting and Building a Chromium-Based OS
2010年2月23日 星期二
Apache stress test 壓力測試
裝了一台小SERVER,
不曉得耐不耐操,
也是試試看可以讓幾個人同時上線,
search了一下apache本身的套件就有這個功能,
ab(ApacheBench)。
ApacheBench 主要是用來測試 apache 執行效率.
使用範例:
ex: 要執行 10000 次的 connection, 25 次的 concurrent (並行, 同時).
#ab -n 10000 -c 20 http://localhost/test.php
ex: 要執行 100次的 connection, 100 次的 concurrent
#ab -n 100 -c 100 http://localhost/test.php
不曉得耐不耐操,
也是試試看可以讓幾個人同時上線,
search了一下apache本身的套件就有這個功能,
ab(ApacheBench)。
ApacheBench 主要是用來測試 apache 執行效率.
使用範例:
ex: 要執行 10000 次的 connection, 25 次的 concurrent (並行, 同時).
#ab -n 10000 -c 20 http://localhost/test.php
ex: 要執行 100次的 connection, 100 次的 concurrent
#ab -n 100 -c 100 http://localhost/test.php
2010年2月7日 星期日
查看Linux版本
以我用的主機來看
看核心版本
# cat /proc/version
Linux version 2.6.24-19-server (buildd@yellow) (gcc version 4.2.3 (Ubuntu 4.2.3-2ubuntu7)) #1 SMP Wed Jun 18 14:44:47 UTC 2008
看核心版本
# uname -r
2.6.24-19-server
看發行版本
# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 8.04.1
Release: 8.04
Codename: hardy
看核心版本
# cat /proc/version
Linux version 2.6.24-19-server (buildd@yellow) (gcc version 4.2.3 (Ubuntu 4.2.3-2ubuntu7)) #1 SMP Wed Jun 18 14:44:47 UTC 2008
看核心版本
# uname -r
2.6.24-19-server
看發行版本
# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 8.04.1
Release: 8.04
Codename: hardy
2010年1月25日 星期一
ubuntu 重抓網路卡
把硬碟搬到別台電腦去開機,
發現網路卡不work了。
查看/proc/net/dev,抓到的網路卡是eth*
手動將/etc/udev/rules.d/70-persistent-et.rules這個檔案刪除,重新啟動後,他就會重抓網卡了
發現網路卡不work了。
查看/proc/net/dev,抓到的網路卡是eth*
手動將/etc/udev/rules.d/70-persistent-et.rules這個檔案刪除,重新啟動後,他就會重抓網卡了
訂閱:
文章 (Atom)