1:测试光盘
网上下载的CentOS5.0,刻成光盘,测试能够启动,在老黑上测试可以安装,但老黑提示只能用文本安装,当然,他不提示我也用文本形式安装。
</div>2:安装过程
整个安装的过程,我基本都是采用默认。
以前的版本这个地方显示的是空硬盘,但这里好像就已经有分区了,这个地方是没有搞明白。我就把默认的都删除
分区我采用最简单的办法,分一个swap分区,320m,根分区5g,创建一个data的分区,占用全部剩下的空间,其实你也可以是根分区是占用全部空间。
这个就选择最小化的安装,什么都不选。声明:我这里还是选了一个FTP Server,方便下一步安装LAMP环境。
上面显示,安装了399个包,占用空间是665m。这个信息,如果你是图形化安装你是看不到的。
</div> </div> </div> </div> </div> </div>3:设置centos
centos5,这个地方进行的改动,不是在安装的过程设置,而是装完系统,第一次启动的时候进行设置。我在这里就把防火墙禁用了。如果这里你不进行设置,进入系统后,可以运行setup命令进行设置,出来的是同样的界面。禁用selinux的防火墙,你还可以通过修改配置文件
</div>vi /etc/sysconfig/selinux
SELINUX=enforcing 改成--> SELINUX=disabled
这样你就可以进入系统。我们可以在这里设置启动的服务,也可以进入系统再设置。可以比较一下停用服务后内存的使用情况
运行ntsysv 或者setup,进行服务配置
只选择9项服务
acpid
anacron
auotfs
cpuspeed
crond
network
sshd
syslog
yum-updatesd
重新启动机器,你就会发现内存占用少了一半。
4:设置ssh
修改/etc/ssh/sshd.config两个地方,运行root帐户登陆和禁止使用dns,这样可以加快客户端登陆,否则ssh会做反向的dns查询。
PermitRootLogin yes
UseDNS no
service sshd restart
5:mount 光驱
其实由于我们的服务已经启动autofs,centos5已经是配置好autofs,
ls /misc/cd
你就可以看到现在光盘里的内容,如果不使用,缺省300秒就会unmount。
6:设置yum
本来打算把yum更新指向cd的,不过反复测试,没有成功。所有只能指向国内的yum,速度也很快
vi /etc/yum.repos.d/CentOS-Base.repo
######################
[base]
name=CentOS-5 - Base
repo=os
baseurl=http://centos.ustc.edu.cn/centos/5/os/$basearch/ ####注意用5不是5.1
gpgcheck=1
gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5
[update]
name=CentOS-5 - Updates
baseurl=http://centos.ustc.edu.cn/centos/5.1/updates/$basearch/
gpgcheck=1
gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5
[addons]
name=CentOS-5 - Addons
baseurl=http://centos.ustc.edu.cn/centos/5.1/addons/$basearch/
gpgcheck=1
gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5
[extras]
name=CentOS-5 - Extras
baseurl=http://centos.ustc.edu.cn/centos/5.1/extras/$basearch/
gpgcheck=1
gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5
[centosplus]
name=CentOS-5 - Plus
baseurl=http://centos.ustc.edu.cn/centos/5.1/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5
[contrib]
name=CentOS-5 - Contrib
baseurl=http://centos.ustc.edu.cn/centos/5.1/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5
###################
rpm --import http://centos.ustc.edu.cn/centos/5.1/os/i386/RPM-GPG-KEY-CentOS-5
yum update
</div> </div> </div> </div> </div>7:建立搜索的db
为了以后搜索查找文件快速,使用locate来查找文件,运行命令
</div>updatedb
8:查看log
当你安装完系统后,会在你的root的帐户下产生两个log
你可以用命令来查询自己安装了多少个rpm包
rpm -qa > rpm.txt
我用命令查询发现是装了342个包,和install.log 是一样的。
anaconda-ks.cfg
# Kickstart file automatically generated by anaconda.
install
cdrom
lang en_US.UTF-8
keyboard us
network --device eth0 --bootproto static --ip 192.168.1.168 --netmask 255.255.255.0 --gateway 192.168.1.1 --nameserver 192.168.1.1 --hostname centos
rootpw --iscrypted $1$y/t6iO5p$ilVd82kK/VfAmguaRlZ1B1
firewall --enabled --port=22:tcp
authconfig --enableshadow --enablemd5
selinux --enforcing
timezone --utc Asia/Chongqing
bootloader --location=mbr --driveorder=sda
# The following is the partition information you requested
# Note that any partitions you deleted are not expressed
# here so unless you clear all partitions first, this is