FreeBSD 修改主機日期
# date 1008221153 // 年月日時分(ps:西元年後兩碼)
2010年10月21日 星期四
2010年10月1日 星期五
FreeBSD 的 Console 下軟體
在 FreeBSD 的 Console 下, 有些軟題體蠻好用的, 軟體如下:
Screen: 可以讓程式在背景下執行, 下次進入後程式執行後的結果
Vim: 文字編輯器
ee: 文字編輯器
joe: 文字編輯器
mc: 檔案瀏覽管理程式
vifm: 像vim指令般的檔案瀏覽管理程式
vlock: console下的電腦鎖
zgv: console 下觀看圖檔程式,無法在AMD的機器上執行, 且一定要在終端機前才可操作, 無法由putty連入操作
Screen: 可以讓程式在背景下執行, 下次進入後程式執行後的結果
Vim: 文字編輯器
ee: 文字編輯器
joe: 文字編輯器
mc: 檔案瀏覽管理程式
vifm: 像vim指令般的檔案瀏覽管理程式
vlock: console下的電腦鎖
zgv: console 下觀看圖檔程式,無法在AMD的機器上執行, 且一定要在終端機前才可操作, 無法由putty連入操作
2010年6月23日 星期三
2010年1月8日 星期五
MySQL 在 FreeBSD 上安裝的步驟
MySQL 在 FreeBSD 上安裝的步驟: (使用 Configure 方式安裝) :
1. Download mysql-5.0.16.tar.gz
2. 建立 mysql 的群組及帳號 (使用 adduser 新增比較方便)
3. 先建立要安裝的mysql 資料庫位置:/usr/local/mysql 設定群組權限為mysql
4. su mysql
5. tar xzvf mysql-5.0.16.tar.gz
6. 先將 configure 的參設設定為一個檔案, 例如 mysql.configure.sh 在執行 /bin/sh /mysql.configure.sh ,將mysql configure,
(PS: 如果沒有設定成一個.sh檔案, 怕以後要修改或要查詢參數時無法查詢)
7. make install clean
8. 找到解壓縮檔案下的 /scripts/mysql_install_db , 將它執行 ./scripts/mysql_install_db
9. 這樣就已經安裝完畢
要如何測試MySQL呢?
1. 執行 /usr/local/mysqld_safe & , 看看是否可以啟動?
2. 啟動後打入 /usr/local/mysql/bin/mysqladmin version (檢查MySQL 的版本)
3. 執行 /usr/local/mysql/bin/mysqladmin variable (檢查MySQL 的參數)
4. 執行 /usr/local/mysql/mysqlshow (顯示資料庫)
5. 執行 /usr/local/mysql/bin/mysqladmin -u root -p shutdown (將MySQL 停止)
如何設定剛剛安裝好MySQL 的 root 密碼?
1. /usr/local/mysql/bin/mysqladmin -u root password xxxxx (xxxxx 就是你要輸入的密碼)
如何新增設定MySQL 的使用者?
1. /usr/local/mysql/bin/mysql -u root -p xxxxx
2. grant all privileges on *.* to 'xxx'@'%' identified by 'xxxxxx'; (xxx為使用者名稱 ; xxxxxx為使用者密碼 )
3. flush privileges;
MySQL 權限的修改 :
1. update user set password=password('xxxxx') where Db=xxxxx and User=yyyyy;
2. 改完後一定要執行: flush privileges;
如果出現 Can't connect to local MySQL Server through socket 'tmp/mysql.sock' .
1, ln -s /var/lib/mysql.sock /tmp/mysql.sock
1. Download mysql-5.0.16.tar.gz
2. 建立 mysql 的群組及帳號 (使用 adduser 新增比較方便)
3. 先建立要安裝的mysql 資料庫位置:/usr/local/mysql 設定群組權限為mysql
4. su mysql
5. tar xzvf mysql-5.0.16.tar.gz
6. 先將 configure 的參設設定為一個檔案, 例如 mysql.configure.sh 在執行 /bin/sh /mysql.configure.sh ,將mysql configure,
(PS: 如果沒有設定成一個.sh檔案, 怕以後要修改或要查詢參數時無法查詢)
7. make install clean
8. 找到解壓縮檔案下的 /scripts/mysql_install_db , 將它執行 ./scripts/mysql_install_db
9. 這樣就已經安裝完畢
要如何測試MySQL呢?
1. 執行 /usr/local/mysqld_safe & , 看看是否可以啟動?
2. 啟動後打入 /usr/local/mysql/bin/mysqladmin version (檢查MySQL 的版本)
3. 執行 /usr/local/mysql/bin/mysqladmin variable (檢查MySQL 的參數)
4. 執行 /usr/local/mysql/mysqlshow (顯示資料庫)
5. 執行 /usr/local/mysql/bin/mysqladmin -u root -p shutdown (將MySQL 停止)
如何設定剛剛安裝好MySQL 的 root 密碼?
1. /usr/local/mysql/bin/mysqladmin -u root password xxxxx (xxxxx 就是你要輸入的密碼)
如何新增設定MySQL 的使用者?
1. /usr/local/mysql/bin/mysql -u root -p xxxxx
2. grant all privileges on *.* to 'xxx'@'%' identified by 'xxxxxx'; (xxx為使用者名稱 ; xxxxxx為使用者密碼 )
3. flush privileges;
MySQL 權限的修改 :
1. update user set password=password('xxxxx') where Db=xxxxx and User=yyyyy;
2. 改完後一定要執行: flush privileges;
如果出現 Can't connect to local MySQL Server through socket 'tmp/mysql.sock' .
1, ln -s /var/lib/mysql.sock /tmp/mysql.sock
FreeBSD基本指令
(PS:網路上找來的, 已經忘記由何處網站轉貼!! )
FreeBSD Command Tools
第一步
我如何離線?(exit)
我如何停止電腦?(shutdown -h now)
我如何重新啟動電腦? (shutdown -r now)
我如何在單使用者模式下停止系統? (shutdown now)
我如何切換終端機? (ALT-F*)
文件
我如何取得 manual page? (man)
使用者管理 (1)
我該如何增加一個使用者? (adduser)
我如何移除使用者? (rmuser)
我如何改變我的密碼? (passwd)
"su" 指令
我如何 "su" 至 root 帳號? (su)
我如何 "su" 至其他使用者的帳號? (su username)
四處觀察
我在哪? (pwd)
我如何觀察目錄下有什?? (ls)
我如何看到以點開始的隱藏檔? (ls -a)
我如何看到更多的訊息 (存取野i,擁有者,群組,大小,日期)? (ls -l)
我如何看出那些檔是什?? (ls -F)
這些是什?檔: ".." 與 "."? (ls -aF)
四處移動
我該如何改變工作目錄? (cd)
如何回到上一層目錄? (cd ..)
我如何回到自己的工作目錄? (cd, cd ~/)
螢幕控制
我如何卷回 (在終端機中,非 X)? (The Scroll Lock Key)
我該如何清除螢幕? (clear)
文章
我如何不使用文書編輯器就可以觀看小的檔案? (more)
最普遍的文書編輯器是? (vi)
"vi" 看起來有點難,我可以從 "ee" 開始嗎? (ee)
使用者管理 (2)
我如何新增使用者至群組? (vi /etc/group)
電腦資訊
我如何能觀看開機記錄文件? (dmesg)
有什麼方法可以讓我慢慢地觀看開機記錄文件嗎? (dmesg |more)
誰
顯示誰在系統上? (who)
他們正在做什??? (w)
"w" 可以顯示出所有的處理嗎? (w)
何時
我如何顯示或設定日期時間? (date)
我如何顯示月曆? (cal)
有什?方法可以讓我慢慢地觀看月曆嗎? (cal | more)
Communications
我如何顯示 (或不顯示) 其他使用者送來的訊息? (mesg y, mesg n)
我如何傳送訊息到其使用者的螢幕? (write)
我如何送訊息到每一個人的螢幕? (wall)
我如何與他人交談 (chat)? (talk)
檔案管理
我如何建立一個空檔案? (touch)
我如何刪除檔案? (rm)
我如何建立一個目錄? (mkdir)
我如何移除一個空的目錄? (rmdir)
我如何移除一個目錄包括裏面所有的東西 (包括子目錄)? (rm -r)
我如何移除以 "-" 起頭的檔案? (rm -- -filename)
我如何拷貝檔案? (cp)
我如何拷貝整個目錄包括它所有的內容? (cp -R)
我該如何搬移檔案與目錄? (mv)
我如何改變檔案/目錄名稱? (mv)
我如何執行 rm、cp 與 mv 時,須要我的野i? (-i)
我如何執行 rm、cp 與 mv 時,不須要我的確認? (-f)
檔案連結
我如何連結一個檔案或目錄? (ln -s)
我如何 hard link 一個檔案? (ln)
檔案擁有權/存取權限
我如何觀察誰是檔案擁有者? (ls -l)
我如何觀察檔案/目錄的存取野i? (ls -l)
我如何改變檔案/目錄的使用者擁有人? (chown)
我如何改變檔案/目錄的群組擁有人?s group owner? (chgrp)
我如何改變檔案/目錄的使用者與群組擁有人? (chown user:group)
我如何改變存取野i? (chmod)
如果我擁有這個目錄,我可否修改不是我的檔案? (yes)
軟碟機裝置
我如何掛上我的軟碟? (mount)
我如何掛上 MS-DOS 格式的軟碟機? (mount -t msdos)
我如何卸下我的軟碟? (umount)
應用程式
我如何起動應用程式? (./)
我如何由檔案名稱來起動應用程式? (PATH)
我如何在背景起動應用程式? (&)
我如何知道我的 PATH 是? (echo $PATH)
所有的應用程式在那? (The FreeBSD Ports Collection)
我如何安裝一個 port? (make install clean)
那裏有編輯好的二進位文件? (The FreeBSD Packages Collection)
我如何移除應用程式? (pkg_delete)
使用者環境
使用者的 profile 檔案在那? (vi ~/.profile)
我如何改變我的 shell? (chsh)
處理管理
我如何列出處理? (ps)
我如何列找到處理? (ps -waux | grep "name of the process")
我如何砍掉處理? (kill)
磁片管理
我如何檢查可用的磁碟空間? (df)
我如何檢查每個目錄下用了多少磁碟空間? (du)
FreeBSD Command Tools
第一步
我如何離線?(exit)
我如何停止電腦?(shutdown -h now)
我如何重新啟動電腦? (shutdown -r now)
我如何在單使用者模式下停止系統? (shutdown now)
我如何切換終端機? (ALT-F*)
文件
我如何取得 manual page? (man)
使用者管理 (1)
我該如何增加一個使用者? (adduser)
我如何移除使用者? (rmuser)
我如何改變我的密碼? (passwd)
"su" 指令
我如何 "su" 至 root 帳號? (su)
我如何 "su" 至其他使用者的帳號? (su username)
四處觀察
我在哪? (pwd)
我如何觀察目錄下有什?? (ls)
我如何看到以點開始的隱藏檔? (ls -a)
我如何看到更多的訊息 (存取野i,擁有者,群組,大小,日期)? (ls -l)
我如何看出那些檔是什?? (ls -F)
這些是什?檔: ".." 與 "."? (ls -aF)
四處移動
我該如何改變工作目錄? (cd)
如何回到上一層目錄? (cd ..)
我如何回到自己的工作目錄? (cd, cd ~/)
螢幕控制
我如何卷回 (在終端機中,非 X)? (The Scroll Lock Key)
我該如何清除螢幕? (clear)
文章
我如何不使用文書編輯器就可以觀看小的檔案? (more)
最普遍的文書編輯器是? (vi)
"vi" 看起來有點難,我可以從 "ee" 開始嗎? (ee)
使用者管理 (2)
我如何新增使用者至群組? (vi /etc/group)
電腦資訊
我如何能觀看開機記錄文件? (dmesg)
有什麼方法可以讓我慢慢地觀看開機記錄文件嗎? (dmesg |more)
誰
顯示誰在系統上? (who)
他們正在做什??? (w)
"w" 可以顯示出所有的處理嗎? (w)
何時
我如何顯示或設定日期時間? (date)
我如何顯示月曆? (cal)
有什?方法可以讓我慢慢地觀看月曆嗎? (cal | more)
Communications
我如何顯示 (或不顯示) 其他使用者送來的訊息? (mesg y, mesg n)
我如何傳送訊息到其使用者的螢幕? (write)
我如何送訊息到每一個人的螢幕? (wall)
我如何與他人交談 (chat)? (talk)
檔案管理
我如何建立一個空檔案? (touch)
我如何刪除檔案? (rm)
我如何建立一個目錄? (mkdir)
我如何移除一個空的目錄? (rmdir)
我如何移除一個目錄包括裏面所有的東西 (包括子目錄)? (rm -r)
我如何移除以 "-" 起頭的檔案? (rm -- -filename)
我如何拷貝檔案? (cp)
我如何拷貝整個目錄包括它所有的內容? (cp -R)
我該如何搬移檔案與目錄? (mv)
我如何改變檔案/目錄名稱? (mv)
我如何執行 rm、cp 與 mv 時,須要我的野i? (-i)
我如何執行 rm、cp 與 mv 時,不須要我的確認? (-f)
檔案連結
我如何連結一個檔案或目錄? (ln -s)
我如何 hard link 一個檔案? (ln)
檔案擁有權/存取權限
我如何觀察誰是檔案擁有者? (ls -l)
我如何觀察檔案/目錄的存取野i? (ls -l)
我如何改變檔案/目錄的使用者擁有人? (chown)
我如何改變檔案/目錄的群組擁有人?s group owner? (chgrp)
我如何改變檔案/目錄的使用者與群組擁有人? (chown user:group)
我如何改變存取野i? (chmod)
如果我擁有這個目錄,我可否修改不是我的檔案? (yes)
軟碟機裝置
我如何掛上我的軟碟? (mount)
我如何掛上 MS-DOS 格式的軟碟機? (mount -t msdos)
我如何卸下我的軟碟? (umount)
應用程式
我如何起動應用程式? (./)
我如何由檔案名稱來起動應用程式? (PATH)
我如何在背景起動應用程式? (&)
我如何知道我的 PATH 是? (echo $PATH)
所有的應用程式在那? (The FreeBSD Ports Collection)
我如何安裝一個 port? (make install clean)
那裏有編輯好的二進位文件? (The FreeBSD Packages Collection)
我如何移除應用程式? (pkg_delete)
使用者環境
使用者的 profile 檔案在那? (vi ~/.profile)
我如何改變我的 shell? (chsh)
處理管理
我如何列出處理? (ps)
我如何列找到處理? (ps -waux | grep "name of the process")
我如何砍掉處理? (kill)
磁片管理
我如何檢查可用的磁碟空間? (df)
我如何檢查每個目錄下用了多少磁碟空間? (du)
FreeBSD 更新程式的方式
用 pkg_version -v|grep needs 找出可以更新的程式, 找出來後,
如果要更新cvsup-without-gui , 請問要如何更新呢?
Ans:用pkg_version -vIL=找出可以更新的,
然後portupgrade cvsup-without-gui即可
FreeBSD 更新 Ports Tree
cvsup -g -L 2 /root/ports-supfile
/root/ports-supfile 的內容:
# $FreeBSD: src/share/examples/cvsup/ports-supfile,v 1.33.2.3 2007/09/10 17:29:34 gabor Exp $
#
# This file contains all of the "CVSup collections" that make up the
# FreeBSD-current ports collection.
#
# CVSup (CVS Update Protocol) allows you to download the latest CVS
# tree (or any branch of development therefrom) to your system easily
# and efficiently (far more so than with sup, which CVSup is aimed
# at replacing). If you're running CVSup interactively, and are
# currently using an X display server, you should run CVSup as follows
# to keep your CVS tree up-to-date:
#
# cvsup ports-supfile
#
# If not running X, or invoking cvsup from a non-interactive script, then
# run it as follows:
#
# cvsup -g -L 2 ports-supfile
#
# You may wish to change some of the settings in this file to better
# suit your system:
#
# host=CHANGE_THIS.FreeBSD.org
# This specifies the server host which will supply the
# file updates. You must change it to one of the CVSup
# mirror sites listed in the FreeBSD Handbook at
# http://www.freebsd.org/doc/handbook/mirrors.html.
# You can override this setting on the command line
# with cvsup's "-h host" option.
#
# base=/var/db
# This specifies the root where CVSup will store information
# about the collections you have transferred to your system.
# A setting of "/var/db" will generate this information in
# /var/db/sup. You can override the "base" setting on the
# command line with cvsup's "-b base" option. This directory
# must exist in order to run CVSup.
#
# prefix=/usr
# This specifies where to place the requested files. A
# setting of "/usr" will place all of the files requested
# in "/usr/ports" (e.g., "/usr/ports/devel", "/usr/ports/lang").
# The prefix directory must exist in order to run CVSup.
# Defaults that apply to all the collections
#
# IMPORTANT: Change the next line to use one of the CVSup mirror sites
# listed at http://www.freebsd.org/doc/handbook/mirrors.html.
*default host=cvsup.tw.freebsd.org
*default base=/usr
*default prefix=/usr
*default release=cvs tag=.
*default delete use-rel-suffix
# If you seem to be limited by CPU rather than network or disk bandwidth, try
# commenting out the following line. (Normally, today's CPUs are fast enough
# that you want to run compression.)
*default compress
## Ports Collection.
#
# The easiest way to get the ports tree is to use the "ports-all"
# mega-collection. It includes all of the individual "ports-*"
# collections,
ports-all
# These are the individual collections that make up "ports-all". If you
# use these, be sure to comment out "ports-all" above.
#
# Be sure to ALWAYS cvsup the ports-base collection if you use any of the
# other individual collections below. ports-base is a mandatory collection
# for the ports collection, and your ports may not build correctly if it
# is not kept up to date.
#ports-base
#ports-accessibility
#ports-arabic
#ports-archivers
#ports-astro
......... (略)
/root/ports-supfile 的內容:
# $FreeBSD: src/share/examples/cvsup/ports-supfile,v 1.33.2.3 2007/09/10 17:29:34 gabor Exp $
#
# This file contains all of the "CVSup collections" that make up the
# FreeBSD-current ports collection.
#
# CVSup (CVS Update Protocol) allows you to download the latest CVS
# tree (or any branch of development therefrom) to your system easily
# and efficiently (far more so than with sup, which CVSup is aimed
# at replacing). If you're running CVSup interactively, and are
# currently using an X display server, you should run CVSup as follows
# to keep your CVS tree up-to-date:
#
# cvsup ports-supfile
#
# If not running X, or invoking cvsup from a non-interactive script, then
# run it as follows:
#
# cvsup -g -L 2 ports-supfile
#
# You may wish to change some of the settings in this file to better
# suit your system:
#
# host=CHANGE_THIS.FreeBSD.org
# This specifies the server host which will supply the
# file updates. You must change it to one of the CVSup
# mirror sites listed in the FreeBSD Handbook at
# http://www.freebsd.org/doc/handbook/mirrors.html.
# You can override this setting on the command line
# with cvsup's "-h host" option.
#
# base=/var/db
# This specifies the root where CVSup will store information
# about the collections you have transferred to your system.
# A setting of "/var/db" will generate this information in
# /var/db/sup. You can override the "base" setting on the
# command line with cvsup's "-b base" option. This directory
# must exist in order to run CVSup.
#
# prefix=/usr
# This specifies where to place the requested files. A
# setting of "/usr" will place all of the files requested
# in "/usr/ports" (e.g., "/usr/ports/devel", "/usr/ports/lang").
# The prefix directory must exist in order to run CVSup.
# Defaults that apply to all the collections
#
# IMPORTANT: Change the next line to use one of the CVSup mirror sites
# listed at http://www.freebsd.org/doc/handbook/mirrors.html.
*default host=cvsup.tw.freebsd.org
*default base=/usr
*default prefix=/usr
*default release=cvs tag=.
*default delete use-rel-suffix
# If you seem to be limited by CPU rather than network or disk bandwidth, try
# commenting out the following line. (Normally, today's CPUs are fast enough
# that you want to run compression.)
*default compress
## Ports Collection.
#
# The easiest way to get the ports tree is to use the "ports-all"
# mega-collection. It includes all of the individual "ports-*"
# collections,
ports-all
# These are the individual collections that make up "ports-all". If you
# use these, be sure to comment out "ports-all" above.
#
# Be sure to ALWAYS cvsup the ports-base collection if you use any of the
# other individual collections below. ports-base is a mandatory collection
# for the ports collection, and your ports may not build correctly if it
# is not kept up to date.
#ports-base
#ports-accessibility
#ports-arabic
#ports-archivers
#ports-astro
......... (略)
Apache 在 FreeBSD 上的安裝步驟
Apache2 在 FreeBSD 上安裝的步驟: (使用 Configure 方式安裝) :
1. Download httpd-2.2.10.tar.gz
2. tar xzvf httpd-2.2.10.tar.gz
3. cd httpd-2.2.10
4. /bin/sh ../httpd.configure.sh (先將要configure 的餐數設定為一個檔案)
5. make install
安裝完畢後, 執行
/usr/local/apache2/bin/apachectl start
Apache 即會啟動, 如果要停止, 執行
/usr/local/apache2/bin/apachectl stop
即會停止, 如果開始後想再次啟動,執行
/usr/local/apache2/bin/apachectl restart
即可再次啟動
以下列出為參考其他人使用的Apache configure 的參數設定:
#!/bin/bash
./configure --prefix=/usr/local/apache2 --infodir=/usr/local/apache2/info --mandir=/usr/local/apache2/man --enable-so --enable-MODULE=shared --enable-ssl --enable-mods-shared=most
1. Download httpd-2.2.10.tar.gz
2. tar xzvf httpd-2.2.10.tar.gz
3. cd httpd-2.2.10
4. /bin/sh ../httpd.configure.sh (先將要configure 的餐數設定為一個檔案)
5. make install
安裝完畢後, 執行
/usr/local/apache2/bin/apachectl start
Apache 即會啟動, 如果要停止, 執行
/usr/local/apache2/bin/apachectl stop
即會停止, 如果開始後想再次啟動,執行
/usr/local/apache2/bin/apachectl restart
即可再次啟動
以下列出為參考其他人使用的Apache configure 的參數設定:
#!/bin/bash
./configure --prefix=/usr/local/apache2 --infodir=/usr/local/apache2/info --mandir=/usr/local/apache2/man --enable-so --enable-MODULE=shared --enable-ssl --enable-mods-shared=most
Configure glib20 時出現錯誤
今天在FreeBSD上面, Configure glib20 的時候, 出現錯誤!
後來上 IRC請教一些前輩後, 告知要在 /usr/ports/devel/glib20 下, make config中, 將選項移除後, 在 make clean 在make install clean , 就可以安裝了!!
後來上 IRC請教一些前輩後, 告知要在 /usr/ports/devel/glib20 下, make config中, 將選項移除後, 在 make clean 在make install clean , 就可以安裝了!!
FreeBSD 下用來上網安裝下載 KDE4 的方法
pkg_add -r http://ftp.ncnu.edu.tw/FreeBSD/ports/i386/packages/kde/kde4-4.1.1.tbz
之前先用 cvsup 的方式更新後, 再使用 ports 的方式安裝KDE4, 一直都無法安裝成功,
常常出現錯誤, 後來上IRC詢問後, 告知可以使用 PKG 的方式安裝看看~~
安裝 KDE 的方式可以參考 :
http://www.freebsd.org/doc/en/books/handbook/x11-wm.html
or
http://www.freebsd.org/doc/zh_TW/books/handbook/ports.html
應該可以用 # pkg_add -r kde4 這樣的方式安裝, 只是還沒有試過!!
之前先用 cvsup 的方式更新後, 再使用 ports 的方式安裝KDE4, 一直都無法安裝成功,
常常出現錯誤, 後來上IRC詢問後, 告知可以使用 PKG 的方式安裝看看~~
安裝 KDE 的方式可以參考 :
http://www.freebsd.org/doc/en/books/handbook/x11-wm.html
or
http://www.freebsd.org/doc/zh_TW/books/handbook/ports.html
應該可以用 # pkg_add -r kde4 這樣的方式安裝, 只是還沒有試過!!
KDE4 在 FreeBSD 安裝好後須如何執行 ?
For KDE3:
% echo "exec startkde" > ~/.xinitrc
For KDE4:
% echo "exec /usr/local/kde4/bin/startkde" > ~/.xinitrc
Now, whenever the X Window System is invoked with startx, KDE will be the desktop.
% echo "exec startkde" > ~/.xinitrc
For KDE4:
% echo "exec /usr/local/kde4/bin/startkde" > ~/.xinitrc
Now, whenever the X Window System is invoked with startx, KDE will be the desktop.
更新 FreeBSD 6.x 版本的方式
1. freebsd-update upgrade -r 6.4-RC1
2. freebsd-update install
3. shutdown -r now
4. freebsd-update install
5. shutdown -r now
2. freebsd-update install
3. shutdown -r now
4. freebsd-update install
5. shutdown -r now
How To Upgrade FreeBSD 6.3 to 7.0 Stable Release
如何升級FreeBSD 6.3 to 7.0 的方法!!
(PS: 參考 http://www.cyberciti.biz/faq/howto-freebsd-server-upgrades/)
來至: http://www.to2100.idv.tw/?p=4641)
Step # 1: Upgrade ports
# portupgrade -faP
Step # 2: Download updated freebsd-update-upgrade tool
# fetch http://people.freebsd.org/~cperciva/freebsd-update-upgrade.tgz
# fetch http://people.freebsd.org/~cperciva/freebsd-update-upgrade.tgz.asc
# gpg --verify freebsd-update-upgrade.tgz.asc freebsd-update-upgrade.tgz
# tar -xf freebsd-update-upgrade.tgz
Step # 3: Start upgrade procedure
# sh freebsd-update.sh -f freebsd-update.conf -r 7.0-RELEASE upgrade
# sh freebsd-update.sh -f freebsd-update.conf install
# reboot
Step # 4: Install updated userland tools
# sh freebsd-update.sh -f freebsd-update.conf install
# portupgrade -faP
Step # 5: Remove all old libraries
# sh freebsd-update.sh -f freebsd-update.conf install
# reboot
Step # 6: Verify FreeBSD 7.0
# uname -a
# tail -f /var/log/messages
# tail -f /path/to/other/log/files
# egrep -i 'error|warning' /path/to/log/files
# sockstat -4 -l
(PS: 參考 http://www.cyberciti.biz/faq/howto-freebsd-server-upgrades/)
來至: http://www.to2100.idv.tw/?p=4641)
Step # 1: Upgrade ports
# portupgrade -faP
Step # 2: Download updated freebsd-update-upgrade tool
# fetch http://people.freebsd.org/~cperciva/freebsd-update-upgrade.tgz
# fetch http://people.freebsd.org/~cperciva/freebsd-update-upgrade.tgz.asc
# gpg --verify freebsd-update-upgrade.tgz.asc freebsd-update-upgrade.tgz
# tar -xf freebsd-update-upgrade.tgz
Step # 3: Start upgrade procedure
# sh freebsd-update.sh -f freebsd-update.conf -r 7.0-RELEASE upgrade
# sh freebsd-update.sh -f freebsd-update.conf install
# reboot
Step # 4: Install updated userland tools
# sh freebsd-update.sh -f freebsd-update.conf install
# portupgrade -faP
Step # 5: Remove all old libraries
# sh freebsd-update.sh -f freebsd-update.conf install
# reboot
Step # 6: Verify FreeBSD 7.0
# uname -a
# tail -f /var/log/messages
# tail -f /path/to/other/log/files
# egrep -i 'error|warning' /path/to/log/files
# sockstat -4 -l
PHP 在 FreeBSD 上的安裝步驟
PHP 在 FreeBSD 上安裝的步驟: (使用 Configure 方式安裝) :
1. Download php-5.2.6.tar.gz
2. tar xzvf php-5.2.6.tar.gz
3. cd php-5.2.6
4. /bin/sh ../php.configure.sh (php.configure.sh 要先將configure的參數先設定好)
5. make install
6. cp php.ini-dist /usr/local/php/lib/php.ini
7. 設定 /usr/local/php/lib/php.ini
(1) include_path=".:/usr/local/php"
(2) register_globals=off
(3) short_open_tag = On
8. 設定 httpd.conf
(1) LoadModule php5_module libexec/libphp5.so
(2) AddType application/x-httpd-php .php
(3) DirectoryIndex 後面加上 index.php
9. 重新啟動 Apache Server
/usr/local/apache2/bin/apachectl restart
(PS: DSO版(*.so)檔案, 放在 /usr/local/apache2/modules
10. 測試 php
/usr/local/php/bin/php -i
如果有出現php的參數設定,就表示成功了~~
以下列出為參考其他人使用的PHP configure 的參數設定: (php.configure.sh)
#!/bin/bash
./configure --prefix=/usr/local/php --mandir=/usr/local/php/man --infodir=/usr/local/php/info --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-curl=/usr/lib --with-zlib-dir=/usr/lib --with-freetype-dir=/usr/lib --enable-zend-multibyte --enable-ftp --enable-mbstring --with-iconv --enable-gd-native-ttf --with-openssl --with-mysql --with-zlib --with-gd --enable-mbstring --enable-libxml --with-regex=php
(PS:apxs 為 Apache configure 時要有下 --enable-module=so 的參數)
其他參數如:
--enable-fastcgi
--enable-mssql
--enable-pgsql
--enable-sqlite-utf8
1. Download php-5.2.6.tar.gz
2. tar xzvf php-5.2.6.tar.gz
3. cd php-5.2.6
4. /bin/sh ../php.configure.sh (php.configure.sh 要先將configure的參數先設定好)
5. make install
6. cp php.ini-dist /usr/local/php/lib/php.ini
7. 設定 /usr/local/php/lib/php.ini
(1) include_path=".:/usr/local/php"
(2) register_globals=off
(3) short_open_tag = On
8. 設定 httpd.conf
(1) LoadModule php5_module libexec/libphp5.so
(2) AddType application/x-httpd-php .php
(3) DirectoryIndex 後面加上 index.php
9. 重新啟動 Apache Server
/usr/local/apache2/bin/apachectl restart
(PS: DSO版(*.so)檔案, 放在 /usr/local/apache2/modules
10. 測試 php
/usr/local/php/bin/php -i
如果有出現php的參數設定,就表示成功了~~
以下列出為參考其他人使用的PHP configure 的參數設定: (php.configure.sh)
#!/bin/bash
./configure --prefix=/usr/local/php --mandir=/usr/local/php/man --infodir=/usr/local/php/info --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-curl=/usr/lib --with-zlib-dir=/usr/lib --with-freetype-dir=/usr/lib --enable-zend-multibyte --enable-ftp --enable-mbstring --with-iconv --enable-gd-native-ttf --with-openssl --with-mysql --with-zlib --with-gd --enable-mbstring --enable-libxml --with-regex=php
(PS:apxs 為 Apache configure 時要有下 --enable-module=so 的參數)
其他參數如:
--enable-fastcgi
--enable-mssql
--enable-pgsql
--enable-sqlite-utf8
make buildworld 和 CVSUP or CSUP 的 TAG
在執行 cvsup 或 csup 前, 都會先編輯 /usr/share/examples/cvsup/stable-supfile
其中有個 *default host=CHANGE_THIS.FreeBSD.org 可以改為
*default host=cvsup.tw.FreeBSD.org , 這是修改 CVSup 的服務主機網址,
要如何知道有哪些CVSup 的服務主機可以使用呢?
可以參考 http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/cvsup.html#CVSUP-MIRRORS
這個網站!
其中有一個 *default release=cvs tag=RELENG_7 這個TAG中, 要如何知道有哪些TAG可以使用呢?
可以參考 http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/cvs-tags.html
這個網站!
編譯前最好先執行時間對時
ntpdate -s watch.stdtime.gov.tw
make buildworld 會將一些編譯新的核心時會需要使用到的工具先編譯好,
所以要執行 make buildkernel 之前, 應該先執行 make buildworld
(PS:參考網站:http://mail.lsps.tp.edu.tw/~gsyan/freebsd2001/make-world.html )
其中有個 *default host=CHANGE_THIS.FreeBSD.org 可以改為
*default host=cvsup.tw.FreeBSD.org , 這是修改 CVSup 的服務主機網址,
要如何知道有哪些CVSup 的服務主機可以使用呢?
可以參考 http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/cvsup.html#CVSUP-MIRRORS
這個網站!
其中有一個 *default release=cvs tag=RELENG_7 這個TAG中, 要如何知道有哪些TAG可以使用呢?
可以參考 http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/cvs-tags.html
這個網站!
編譯前最好先執行時間對時
ntpdate -s watch.stdtime.gov.tw
make buildworld 會將一些編譯新的核心時會需要使用到的工具先編譯好,
所以要執行 make buildkernel 之前, 應該先執行 make buildworld
(PS:參考網站:http://mail.lsps.tp.edu.tw/~gsyan/freebsd2001/make-world.html )
準備重新安裝FreeBSD 前的備份工作
1. 根目錄下的 .cshrc :
set prompt = "%B%n@%m %/] # "
setenv LC_ALL zh_TW.UTF-8
setenv LANG zh_TW.UTF-8
setenv CLICOLOR
set COLOR
setenv LSCOLORS ExGxFxdxCxDxDxBxBxExEx
2. ACPI的問題解決檔案:
檔案:ACPI-DSDT.asl
處理步驟:
i. iasl ACPI-DSDT.asl
ii. cp DSDT.aml /boot/DSDT.aml
iii. ee /boot/loader.conf
iiii. 加入 acpi_dsdt_load="YES"
acpi_dsdt_name="/boot/DSDT.aml"
3. /etc/resolv.conf
##nameserver 172.16.1.224
nameserver 172.16.1.4
#nameserver 168.95.1.1
#nameserver 139.175.55.244
4. /etc/rc.conf
# -- sysinstall generated deltas -- # Sun Oct 26 22:24:59 2008
# added by xorg-libraries port
keymap="us.iso"
local_startup="/usr/local/etc/rc.d"
usbd_enable="YES"
# -- sysinstall generated deltas -- # Sun Oct 26 22:35:53 2008
#ifconfig_bge0="inet 192.168.11.5 netmask 255.255.255.0"
#defaultrouter="192.168.11.1"
ifconfig_bge0="inet 172.16.1.184 netmask 255.255.255.0"
defaultrouter="172.16.1.251"
hostname="web.myFreeBSD.com.tw"
iwi_enable="YES"
ipw_enable="YES"
ifconfig_iwi0="DHCP"
wlans_iwi0="wlan0"
#ifconfig_bge0="DHCP"
sshd_enable="YES"
# -- sysinstall generated deltas -- # Wed Nov 5 18:50:11 2008
saver="daemon"
5. /boot/load.conf
if_ath_load="YES"
if_wi_load="YES"
if_ipw_load="YES"
wlan_wep_load="YES"
wlan_ccmp_load="YES"
wlan_tkip_load="YES"
6. /etc/make.conf
X11BASE=${LOCALBASE}
MASTER_SITE_BACKUP?= \
ftp://freebsd.csie.ncu.edu.tw/distfiles/${DIST_SUBDIR}/\
ftp://freebsd.csie.nctu.edu.tw/pub/distfiles/${DIST_SUBDIR}/\
ftp://ftp7.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\
ftp://ftp10.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\
ftp://ftp2.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\
ftp://ftp3.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\
ftp://ftp4.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\
ftp://ftp5.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\
ftp://ftp8.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\
ftp://ftp9.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\
ftp://ftp11.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\
ftp://ftp12.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\
ftp://ftp.freebsd.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR}/
MASTER_SITE_OVERRIDE?= ${MASTER_SITE_BACKUP}
MASTER_SORT_REGEX= .tw/ .tw. .edu/ .edu.
ENABLE_SUIDPERL = true
SUP_UPDATE= yes
SUP= /usr/bin/csup
SUPFLAGS= -g -L 2
SUPHOST= cvsup12.tw.FreeBSD.org
#SUPFILE= /usr/share/examples/cvsup/standard-supfile
SUPFILE= /usr/share/examples/cvsup/stable-supfile
PORTSSUPFILE= /usr/share/examples/cvsup/ports-supfile
DOCSUPFILE= /usr/share/examples/cvsup/doc-supfile
# added by use.perl 2008-11-06 18:11:49
PERL_VER=5.8.8
PERL_VERSION=5.8.8
7. /root/ports-supfile 相同於 /usr/share/examples/cvsup/ports-supfile
(ps:以便於 csup -g -L 2 /root/ports-supfile
......省略
# Defaults that apply to all the collections
#
# IMPORTANT: Change the next line to use one of the CVSup mirror sites
# listed at http://www.freebsd.org/doc/handbook/mirrors.html.
*default host=cvsup.tw.freebsd.org
#default host=csup.freebsd.org
*default base=/usr
*default prefix=/usr
*default release=cvs tag=.
*default delete use-rel-suffix
# If you seem to be limited by CPU rather than network or disk bandwidth, try
# commenting out the following line. (Normally, today's CPUs are fast enough
# that you want to run compression.)
*default compress
......省略
8. 其他備註:
FreeBSD 大更新 6.x -> 7.x 時, 一定要執行 mergemaster
FreeBSD 刪除使用者: rmuser
FreeBSD 新增使用者: adduser
FreeBSD 新增群組: /etc/group or pw groupadd xxxx
set prompt = "%B%n@%m %/] # "
setenv LC_ALL zh_TW.UTF-8
setenv LANG zh_TW.UTF-8
setenv CLICOLOR
set COLOR
setenv LSCOLORS ExGxFxdxCxDxDxBxBxExEx
2. ACPI的問題解決檔案:
檔案:ACPI-DSDT.asl
處理步驟:
i. iasl ACPI-DSDT.asl
ii. cp DSDT.aml /boot/DSDT.aml
iii. ee /boot/loader.conf
iiii. 加入 acpi_dsdt_load="YES"
acpi_dsdt_name="/boot/DSDT.aml"
3. /etc/resolv.conf
##nameserver 172.16.1.224
nameserver 172.16.1.4
#nameserver 168.95.1.1
#nameserver 139.175.55.244
4. /etc/rc.conf
# -- sysinstall generated deltas -- # Sun Oct 26 22:24:59 2008
# added by xorg-libraries port
keymap="us.iso"
local_startup="/usr/local/etc/rc.d"
usbd_enable="YES"
# -- sysinstall generated deltas -- # Sun Oct 26 22:35:53 2008
#ifconfig_bge0="inet 192.168.11.5 netmask 255.255.255.0"
#defaultrouter="192.168.11.1"
ifconfig_bge0="inet 172.16.1.184 netmask 255.255.255.0"
defaultrouter="172.16.1.251"
hostname="web.myFreeBSD.com.tw"
iwi_enable="YES"
ipw_enable="YES"
ifconfig_iwi0="DHCP"
wlans_iwi0="wlan0"
#ifconfig_bge0="DHCP"
sshd_enable="YES"
# -- sysinstall generated deltas -- # Wed Nov 5 18:50:11 2008
saver="daemon"
5. /boot/load.conf
if_ath_load="YES"
if_wi_load="YES"
if_ipw_load="YES"
wlan_wep_load="YES"
wlan_ccmp_load="YES"
wlan_tkip_load="YES"
6. /etc/make.conf
X11BASE=${LOCALBASE}
MASTER_SITE_BACKUP?= \
ftp://freebsd.csie.ncu.edu.tw/distfiles/${DIST_SUBDIR}/\
ftp://freebsd.csie.nctu.edu.tw/pub/distfiles/${DIST_SUBDIR}/\
ftp://ftp7.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\
ftp://ftp10.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\
ftp://ftp2.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\
ftp://ftp3.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\
ftp://ftp4.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\
ftp://ftp5.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\
ftp://ftp8.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\
ftp://ftp9.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\
ftp://ftp11.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\
ftp://ftp12.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/\
ftp://ftp.freebsd.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR}/
MASTER_SITE_OVERRIDE?= ${MASTER_SITE_BACKUP}
MASTER_SORT_REGEX= .tw/ .tw. .edu/ .edu.
ENABLE_SUIDPERL = true
SUP_UPDATE= yes
SUP= /usr/bin/csup
SUPFLAGS= -g -L 2
SUPHOST= cvsup12.tw.FreeBSD.org
#SUPFILE= /usr/share/examples/cvsup/standard-supfile
SUPFILE= /usr/share/examples/cvsup/stable-supfile
PORTSSUPFILE= /usr/share/examples/cvsup/ports-supfile
DOCSUPFILE= /usr/share/examples/cvsup/doc-supfile
# added by use.perl 2008-11-06 18:11:49
PERL_VER=5.8.8
PERL_VERSION=5.8.8
7. /root/ports-supfile 相同於 /usr/share/examples/cvsup/ports-supfile
(ps:以便於 csup -g -L 2 /root/ports-supfile
......省略
# Defaults that apply to all the collections
#
# IMPORTANT: Change the next line to use one of the CVSup mirror sites
# listed at http://www.freebsd.org/doc/handbook/mirrors.html.
*default host=cvsup.tw.freebsd.org
#default host=csup.freebsd.org
*default base=/usr
*default prefix=/usr
*default release=cvs tag=.
*default delete use-rel-suffix
# If you seem to be limited by CPU rather than network or disk bandwidth, try
# commenting out the following line. (Normally, today's CPUs are fast enough
# that you want to run compression.)
*default compress
......省略
8. 其他備註:
FreeBSD 大更新 6.x -> 7.x 時, 一定要執行 mergemaster
FreeBSD 刪除使用者: rmuser
FreeBSD 新增使用者: adduser
FreeBSD 新增群組: /etc/group or pw groupadd xxxx
訂閱:
文章 (Atom)