您的位置:首页 > 其它

全面记录硬盘安装FreeBSD 7.0过程

2008-08-06 15:35 507 查看
freebsd 6.2 安装配置笔记
http://blog.zhangjianfeng.com/article/588

FreeBSD 使用手册
http://www.freebsd.org/doc/zh_CN/books/handbook/
http://www.freebsd.org/doc/en/books/handbook/index.html

使用FreeBSD作为桌面操作系统
http://wiki.freebsdchina.org/doc/x/freebsd_desktop

1. 下载文件
ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/ISO-IMAGES/7.0/

2. 文件准备
a. 解压顺序 3->2->1
b.把\packages的INDEX文件用写字板打开,查找替换目标"||1"替换成"|"查找"||2"替换成"|"等,之后保存.
c.以上文件放到C盘根目录下(试过放\freebsd不行)

3. 修改menu.lst
title install FreeBSD 7
find --set-root /7.0-RELEASE-i386-bootonly.iso
map --mem /7.0-RELEASE-i386-bootonly.iso (hd32)
map --hook
chainloader (hd32)
boot

4. 安装过程仿照如下
FreeBSD 7.0 全程图解安装手册
http://www.ittang.com/2008/0309/4832.html

5. ADSL安装
#cd /etc/ppp
#vi ppp.conf
#################################################################
# PPP Sample Configuration File
# Originally written by Toshiharu OHNO
# Simplified 5/14/1999 by wself@cdrom.com
#
# See /usr/share/examples/ppp/ for some examples
#
# $FreeBSD: src/etc/ppp/ppp.conf,v 1.10 2004/11/19 17:12:56 obrien Exp $
#################################################################

default:
set log Phase Chat LCP IPCP CCP tun command
ident user-ppp VERSION (built COMPILATIONDATE)

# Ensure that "device" references the correct serial port
# for your modem. (cuad0 = COM1, cuad1 = COM2)
#
set device PPPoE:fxp0
set speed sync
set mru 1492
set mtu 1492
set ctsrts off
set timeout 30 # 3 minute idle timer (the default)
disable lqr
deny lqr
add default HISADDR # Add a (sticky) default route
enable dns # request DNS info (for resolv.conf)

adsl:
#
# edit the next three lines and replace the items in caps with
# the values which have been assigned by your ISP.
#
set authname gzDSL********
set authkey ********
set dial
set login
set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.0 0.0.0.0
nat enable yes

手动拨号
#ppp –ddial Chinanet
#ifconfig -a

开机自动拨号
#vi /etc/rc.conf

# -- sysinstall generated deltas -- # Sun Jun 15 04:19:07 2008
# Created: Sun Jun 15 04:19:07 2008
# Enable network daemons for user convenience.
# Please make all changes to this file, not to /etc/defaults/rc.conf.
# This file now contains just the overrides from /etc/defaults/rc.conf.
hostname="snail."
ifconfig_fxp0="inet 192.168.0.8 netmask 255.255.255.0"
gateway_enable="YES"
ppp_enable="YES"
ppp_mode="ddial"
ppp_nat="YES"
ppp_profile="adsl"
named_enable="YES"
inetd_enable="YES"
keymap="us.iso"
linux_enable="YES"
moused_enable="YES"
sshd_enable="YES"
#gdm_enable="YES"

参考文章
http://blog.opensource.org.cn/horuslee/2006/02/freebsdadsl.html

#vi /etc/resolv.conf
nameserver 202.96.128.166
nameserver 61.144.56.101

6. 安装Xorg, gnome & kde
#sysinstall
configure -> package -> DOS -> All -> xorg-xxx -> 回车 -> install
a.#Xorg -cofnig xorg.conf.new
#cp xorg.conf.new /etc/X11/xorg.conf
b. #echo "exec startkde" > ~/.xinitrc
#echo "exec gnome-session" ~/.xinitrc
&#vi /etc/rc.conf
gdm_enable="YES"

cd /usr/ports/x11/xorg
makeinstallclean
或
pkg_add-r xorg

Gnome安装与使用

gnome2: /usr/ports/x11/gnome2
gnome2-lite: /usr/ports/x11/gnome2-lite

7. 新建用户的组为"wheel"
8. hostname后面必须多加一点,如“51nb.”
9. chsh -s /usr/local/bin/bash
10. Ports & Package
[FreeBSD Ports & Package & make]
http://www.study-area.org/freebsd/how_to_use_ports_package/how_to_use_ports.htm

#cd /usr/ports
#make search key="xxx"

分享:使用wget/axel加速你的port下载
http://www.freebsdchina.org/forum/topic_25246.html
http://freebsd.lab.mlc.edu.tw/ports.htm
cd /usr/ports

fetch ftp://freebsd.csie.nctu.edu.tw/pub/CVSup/cvsupfile-ports
cvsup -g -L 2 cvsupfile-ports

参考链接
http://bbs.chinaunix.net/viewthread.php?tid=643200
http://www.freebsd.org/doc/zh_CN/books/handbook/ports-using.html
http://freebsd.lab.mlc.edu.tw/ports.htm
http://lixiang.cn/?q=node/8

Package是一套將以經整理好的軟體安裝進FreeBSD的系統裡的軟體,主要下列功能:
pkg_add 安裝一個pkg套件
pkg_create 創造一個pkg套件
pkg_info 查詢一個pkg套件資料
pkg_update 升級一個pkg套件
pkg_check 檢查一個pkg套件的加密簽章(cryptographic signature)
pkg_delete 刪除一個pkg套件
pkg_sign 插入加密簽章(cryptographic signature)至一個pkg套件
pkg_version 創造一個pkg套件

11. fcitx
http://blog.csdn.net/fengfangfang/archive/2006/02/26/610208.aspx

12.我要一個彩色的ls世界 [ 可以跳過此步驟到第4步驟 ]
FreeBSD的ls真是沉悶,為什麼不能帶點彩色呢?
參考文獻:
http://www.huangdong.com/freebsd/tips/colorls.html" target=_blank>http://www.huangdong.com/freebsd/tips/colorls.htmlhttp://www.huangdong.com/freebsd/tips/colorls.html" target=_blank>http://www.huangdong.com/freebsd/tips/colorls.html
注意事項:千萬別裝完APACHE服務器後再進行這個步驟,否則服務器目錄消失了別怪我。(我的悲慘經歷)
進行如下步驟:
www#cd /usr/ports/misc/gnuls
www#make;make install;make clean??
[ 說明:要保證系統與外網連接,系統會自動從網絡上下載該源代碼進行安裝。]
安裝好後,執行命令 vi /etc/profile
添加如下一行內容
alias ls=gnuls --color
保存退出。
通過shutdown –r now命令遠程啟動機器,過幾分鐘後,機器的SSH服務會自動執行,我們可以用ssh客戶端軟件進行遠程登陸。
*** #vi .bash_profile
alias ls='ls -A -G'也可以达到目标

13.定制系統內核
系統啟動後自動運行的進程有sendmail,鑒於sendmail漏洞太多,且已經有了安全性更好的postfix和qmail替代品,我們執行如下命令來取消sendmail的自動運行進程。
www#vi /etc/rc.conf
找到sendmail_enable=YES那行,更改為sendmail_enable=NONE,執行:wq!命令保存退出。
http://www.bbs-tw.net.cn/thread-35833-1-1.html

14 .login_conf
#Users who do not wish to use monetary units or time formats
#of China can manually change each variable
me:\
:lang=zh_CN.UTF-8:\
:setenv=LC_ALL=zh_CN.UTF-8:\
:setenv=LC_COLLATE=zh_CN.UTF-8:\
:setenv=LC_CTYPE=zh_CN.UTF-8:\
:setenv=LC_MESSAGES=zh_CN.UTF-8:\
:setenv=LC_MONETARY=zh_CN.UTF-8:\
:setenv=LC_NUMERIC=zh_CN.UTF-8:\
:setenv=LC_TIME=zh_CN.UTF-8:\
:charset=UTF-8:\
:xmodifiers="@im=SCIM": #Set SCIM as the XIM Input Server

http://blog.1zsoft.com/cat28.html
下面15-17均可参照此链接
15. sudo是一种比较安全权限分配方案。如果你想让某个用户执行root账号的权限,但又不想让他直接成为root账号,可以使用sudo来解决这个问题。

1. 安装sudo
cd /usr/ports/security/sudo; make install clean;
2. 添加sudoers
使用visudo命令来编辑#vi /usr/local/etc/sudoers文件。

%wheel ALL=(ALL) NOPASSWD: ALL
这样设置就是允许wheel组的用户可以执行任何命令而不需要密码。:)

16. 让root账号可以远程登录
Freebsd默认安装之后,默认是禁止root账号直接ssh登录的。可以通过修改/etc/ssh/sshd_config文件,将其中的 PermitRootLogin改成yes,然后重新启动ssh服务就可以了。/etc/rc.d/sshd restart

17. 让普通用户可以使用bash Freebsd默认安装之后用户的shell是sh,平时都已经习惯了使用bash。通过下面的步骤可以配置用户来使用bash作为shell。
1. 安装bash。 cd /usr/ports/shells/bash; make install clean
这样安装完之后,bash会被安装在/usr/local/bin/目录下面。
2. 在/bin目录下面做一个符号连接。
ln -f /usr/local/bin/bash /bin
3. 修改 /etc/shells文件,将bash增加进去,这样在添加用户的时候就可以指定使用bash作为shell了。否则的话,会警告pwd_mkdb: warning, unknown root shell
4. 如果已经添加过的用户,可以使用chsh命令来修改默认的shell.

18.显示root的路径
http://mail.lsps.tp.edu.tw/~gsyan/freebsd2001/newsetup.html
vi root/.cshrc
將 set prompt = "`hostname -s`# " 這行改成:

set prompt = "[%n@%m %/]# "

19. #freebsd桌面字体美化
http://www.yuanma.org/data/2006/1130/article_1886.htm

20 Firefox plugin
http://www.math.colostate.edu/~reinholz/freebsd/firefox_plugins.html

21 ports/119053: update www/linux-flashplugin7
http://lists.freebsd.org/pipermail/freebsd-ports-bugs/2007-December/132984.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: