用csup更新port tree
//建立設定檔
#ee /etc/make.conf
//加入下列文字
DISTDIR = "/usr/home/distfiles"
MASTER_SITE_BACKUP?= \
http://ftp.tw.freebsd.org/FreeBSD/distfiles/${DIST_SUBDIR}/ \
ftp://ftp1.tw.freebsd.org/pub/distfiles/${DIST_SUBDIR}/ \
ftp://ftp.tku.edu.tw/OS/FreeBSD/distfiles/${DIST_SUBDIR}/ \
ftp://cvsup.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/
MASTER_SITE_OVERRIDE?= ${MASTER_SITE_BACKUP}
SUP_UPDATE= yes
SUP= /usr/bin/csup
SUPFLAGS= -4 -L 2 -z
SUPHOST= cvsup4.tw.freebsd.org (換伺服器更新,可解決版本問題)
SUPFILE= /usr/share/examples/cvsup/stable-supfile
PORTSSUPFILE= /usr/share/examples/cvsup/ports-supfile
//更新方法一
cd /usr/src
cp /usr/share/examples/cvsup/stable-supfile .
ee stable-supfile
更改此行 *default host=cvsup.tw.FreeBSD.org
cp /usr/share/examples/cvsup/ports-supfile .
ee ports-supfile
更改此行 *default host=cvsup6.tw.FreeBSD.org
要更新 /src 內容, 直接執行
csup stable-supfile
要更新 ports , 直接執行
csup ports-supfile 或 csup -h cvsup6.tw.FreeBSD.org ports-supfile (-h 指定站台)
//更新方法二
//更新ports tree
# cd /usr/ports
# make update
//更新src
# cd /usr/src
# make update
2011年6月27日 星期一
2011年1月5日 星期三
2010年11月20日 星期六
恢復 FreeBSD 的 root 密碼
當在 FreeBSD 忘記了 root 密碼時,可以在開機時進入 single user mode 及重新設定密碼,方法如下:
1. 重新開啟 FreeBSD 主機。
2. 在 "Welcome to FreeBSD!" 開啟選單中按 "4" 選擇 "Boot FreeBSD in single user mode"。
3. 然後會看到 "When prompted Enter full pathname of shell or RETURN for /bin/sh:",直接按 Enter。
4. 這時便會直接進入 single user mode,輸入以下指令重新掛載根目錄 "/" 為可讀寫:
# mount -u /
# mount -a
5. 用 passwd 重新設定 root 密碼:
# passwd
6. 最後重新啟動即可:
# sync;sync;sync;reboot
1. 重新開啟 FreeBSD 主機。
2. 在 "Welcome to FreeBSD!" 開啟選單中按 "4" 選擇 "Boot FreeBSD in single user mode"。
3. 然後會看到 "When prompted Enter full pathname of shell or RETURN for /bin/sh:",直接按 Enter。
4. 這時便會直接進入 single user mode,輸入以下指令重新掛載根目錄 "/" 為可讀寫:
# mount -u /
# mount -a
5. 用 passwd 重新設定 root 密碼:
# passwd
6. 最後重新啟動即可:
# sync;sync;sync;reboot
2010年9月26日 星期日
2010年9月23日 星期四
安裝phpMyAdmin
===========安裝phpMyAdmin===========
#cd /usr/ports/databases/phpmyadmin
#make install clean
===========編輯httpd.conf=============
//限制phpMyAdmin的使用
#ee /usr/local/etc/apache22/httpd.conf
//最底下加入Alias語法
Alias /phpmyadmin/ "/usr/local/www/phpMyAdmin/"
<Directory "/usr/local/www/phpMyAdmin/">
Options none
AllowOverride Limit
Order Deny,Allow
Deny from all
Allow from 127.0.0.1 .example.com
//允許登入的 IP,想讓123.45.x.x的使用者登入,可增加123.45.即可
</Directory>
//更改完成,需重新啟動Apache
#/usr/local/etc/rc.d/apache22 restart
==========設定phpMyAdmin設定檔 config.inc.php==========
#cd /usr/local/www/phpMyAdmin/
#cp libraries/config.default.php config.inc.php
//到安裝資料夾下,複製預設檔案,成為config.inc.php
#ee config.inc.php
//編輯設定檔config.inc.php
//找到
$cfg['PmaAbsoluteUri'] = '';
//可改成$cfg['PmaAbsoluteUri'] = 'http://www.test.com/testadmin';
$cfg['Servers'][$i]['auth_type'] = 'cookie'; //約177行
//將cookie改成http
//存檔完成。
#cd /usr/ports/databases/phpmyadmin
#make install clean
===========編輯httpd.conf=============
//限制phpMyAdmin的使用
#ee /usr/local/etc/apache22/httpd.conf
//最底下加入Alias語法
Alias /phpmyadmin/ "/usr/local/www/phpMyAdmin/"
<Directory "/usr/local/www/phpMyAdmin/">
Options none
AllowOverride Limit
Order Deny,Allow
Deny from all
Allow from 127.0.0.1 .example.com
//允許登入的 IP,想讓123.45.x.x的使用者登入,可增加123.45.即可
</Directory>
//更改完成,需重新啟動Apache
#/usr/local/etc/rc.d/apache22 restart
==========設定phpMyAdmin設定檔 config.inc.php==========
#cd /usr/local/www/phpMyAdmin/
#cp libraries/config.default.php config.inc.php
//到安裝資料夾下,複製預設檔案,成為config.inc.php
#ee config.inc.php
//編輯設定檔config.inc.php
//找到
$cfg['PmaAbsoluteUri'] = '';
//可改成$cfg['PmaAbsoluteUri'] = 'http://www.test.com/testadmin';
$cfg['Servers'][$i]['auth_type'] = 'cookie'; //約177行
//將cookie改成http
//存檔完成。
訂閱:
文章 (Atom)