develop
操作系统版本:Slackware 12.1
1 硬件
配置10块网卡,分别映射到/dev/vmnet0 - /dev/vmnet9。
2 安装基础系统
只安装a/目录下的软件包,采用expert模式,全部安装。
配置lilo,安装在MBR中。
3 安装帮助包
安装man、info等帮助系统:
- ap/groff-1.19.2-i486-1
- ap/man-1.6f-i486-1
- ap/man-pages-2.79-noarch-1
- ap/texinfo-4.8-i486-1
4 安装文件比较工具
- ap/diffutils-2.8.1-i486-3
5 安装文件打开查看工具
- ap/lsof-4.78-i486-1
6 安装基本网络包
- n/gnupg2-2.0.9-i486-1
- n/iptables-1.4.0-i486-1
- n/iputils-s20070202-i486-2
- n/lftp-3.7.0-i486-1(optional)
- n/mailx-12.3-i486-1
- n/net-tools-1.60-i486-2
- n/netkit-ftp-0.17-i486-1
- n/network-scripts-12.1-noarch-1
- n/openssh-5.0p1-i486-1
- n/openssl-0.9.8g-i486-1
- n/tcpdump-3.9.8-i486-1
7 安装库文件
- l/glibc-2.7-i486-10
- l/glibc-i18n-2.7-noarch-10
- l/glibc-profile-2.7-i486-10
- l/ncurses-5.6-i486-3
- l/zlib-1.2.3-i486-2
8 安装开发工具包
- d/autoconf-2.61-noarch-1
- d/automake-1.9.6-noarch-1
- d/binutils-2.17.50.0.17-i486-1
- d/bison-2.3-i486-1
- d/cvs-1.11.22-i486-1
- d/flex-2.5.33-i486-3
- d/gcc-4.2.3-i486-1
- d/gcc-g++-4.2.3-i486-1(optional)
- d/gdb-6.8-i486-1
- d/gettext-tools-0.17-i486-2
- d/kernel-headers-2.6.24.5_smp-x86-2
- d/libtool-1.5.24-i486-1
- d/m4-1.4.11-i486-1
- d/make-3.81-i486-1
- d/perl-5.8.8-i486-6
- d/python-2.5.2-i486-1
9 配置网络
执行netconfig配置网络:
# netconfig
netconfig只能配置第一块网卡,其余9块编辑/etc/rc.d/rc.inet1.conf手工设置。
编辑/etc/rc.d/rc.inet1,修改网卡数量。将:
MAXNICS=6
改为:
MAXNICS=10
10 nfs配置
develop作为整个测试环境的开发机,除了提供编译服务外,还作为其他系统的文件服务器,以避免重复拷贝,浪费空间。
这里使用nfs提供文件服务,需要安装如下软件包:
- n/nfs-utils-1.1.2-i486-1
- n/portmap-6.0-i486-1
使用lftp从宿主机上获得相关脚本模板和系统更新包,统一放在/newpkg目录下。
编辑/etc/exports,增加:
/newpkg *(ro)
启动nfs服务:
# chmod +x /etc/rc.d/rc.nfsd # /etc/rc.d/rc.nfsd start
注意:客户机需要先启动rpc服务,才能挂载nfs分区。如:
# sh /etc/rc.d/rc.rpc start # mount -t nfs 172.31.1.240:/newpkg /mnt
或者使用mount的nolock选项(只读模式),可以不启动rpc:
# mount -t nfs -o nolock 172.31.1.240:/newpkg /mnt
nfs存在动态端口问题,如果使用防火墙iptables,需要特殊处理。这里只是在测试环境下使用nfs,实际应用中不使用,所以没有在后面的iptables脚本中对nfs进行专门处理。当需要nfs服务时,临时关闭iptables。
11 防火墙配置
有关各个iptables脚本的详细内容见:Iptables脚本。
这里使用客户机脚本rc.iptables-client.ref:
# cd /etc/rc.d # cp /newpkg/rc.iptables-client.ref rc.iptables # chmod a+x rc.iptables
修改/etc/rc.d/rc.S文件,把/newpkg/rc.S.ref模板内容粘贴到rc.S的末尾。
12 设置内核参数
有关脚本的详细内容见:Sysctl脚本。
# cd /etc/rc.d # cp /newpkg/rc.sysctl.ref rc.sysctl # chmod a+x rc.sysctl
编辑/etc/rc.d/rc.M,把/newpkg/rc.M.ref模板内容粘贴到rc.inet2的前面。
13 制作sshfs安装包
编译sshfs,需要安装如下的软件包:
- d/pkg-config-0.23-i486-2
- l/fuse-2.7.3-i486-1
- l/glib2-2.14.6-i486-4
从sshfs主页fuse.sourceforge.net获得源代码sshfs-fuse-2.1.tar.gz,并从SlackBuilds获得制作脚本sshfs-fuse.tar.gz。
编译:
# cd /sources # tar xzvf sshfs-fuse.tar.gz # cd sshfs-fuse # cp /downloads/sshfs-fuse-2.1.tar.gz . # ./sshfs-fuse.SlackBuild # cd /tmp # cp sshfs-fuse-2.1-i486-1_SBo.tgz /newpkg
简单使用方法:
server端不需要安装sshfs,在client端安装即可。如果client没有安装fuse,则需要一并安装:
# installpkg fuse-2.7.3-i486-1 # installpkg sshfs-fuse-2.1-i486-1_SBo.tgz
mount:
$ sshfs hostname:directory mountpoint
umount:
$ fusermount -u mountpoint
更多使用方法可参见sshfs的man手册。在一些场合,可以使用sshfs代替nfs,从而避免nfs本身的一些缺陷。
14 安装补丁
# cd /newpkg/packages # upgradepkg *.tgz