CentOS_6.8安装

centos 安装32位库 centos 6.8安装_linux


• 这里有5个选项,从上到下依次是:

①安装或者升级现有的系统。

②安装带有基础显示设备的系统。

③救援模式。

④从本地驱动器启动。

⑤内存测试。

因为本次要安装文本模式的系统,所以这里选择第一个和第二个选项都可以,具体选择哪个根据自己的要求来选择,如果想要带图形的,可以选择第二项。

是否检测光盘镜像文件,默认是‘OK’,这里选择‘Skip’,跳过检测,回车。

centos 安装32位库 centos 6.8安装_CentOS_02


centos 安装32位库 centos 6.8安装_CentOS_03


centos 安装32位库 centos 6.8安装_自定义_04


centos 安装32位库 centos 6.8安装_centos 安装32位库_05


centos 安装32位库 centos 6.8安装_centos 安装32位库_06


centos 安装32位库 centos 6.8安装_centos 安装32位库_07


centos 安装32位库 centos 6.8安装_centos 安装32位库_08


centos 安装32位库 centos 6.8安装_linux_09


CentOS6系列的LOGO,下一步。

centos 安装32位库 centos 6.8安装_自定义_10


选择系统语言,默认为‘English’,下一步。

centos 安装32位库 centos 6.8安装_linux_11


键盘布局选择,默认为‘美国英语式’,下一步。

centos 安装32位库 centos 6.8安装_centos 安装32位库_12


安装系统存储类型,是基本存储,还是指定的存储,这里选择基本存储,下一步

centos 安装32位库 centos 6.8安装_自定义_13


是否忽略数据,选择是,如果是生产环境,注意数据的备份

centos 安装32位库 centos 6.8安装_linux_14


定义主机的名字,这里可以配置网络这里就跳过了,直接下一步。

centos 安装32位库 centos 6.8安装_CentOS_15


centos 安装32位库 centos 6.8安装_linux_16


centos 安装32位库 centos 6.8安装_自定义_17


centos 安装32位库 centos 6.8安装_centos 安装32位库_18


centos 安装32位库 centos 6.8安装_自定义_19


centos 安装32位库 centos 6.8安装_CentOS_20


centos 安装32位库 centos 6.8安装_centos 安装32位库_21


时区选择,选择上海,下一步。

centos 安装32位库 centos 6.8安装_linux_22

输入root密码,就是管理员密码,下一步

centos 安装32位库 centos 6.8安装_linux_23


centos 安装32位库 centos 6.8安装_centos 安装32位库_24


以那种类型进行安装系统,每一项都有说明,想了解的可以自己实验一下看看,这里选择自定义,手动分区安装,下一步

centos 安装32位库 centos 6.8安装_自定义_25


centos 安装32位库 centos 6.8安装_自定义_26


进入自定义分区,提示将要初始化硬盘,选择将修改写入磁盘

centos 安装32位库 centos 6.8安装_centos 安装32位库_27


建立‘/boot’分区,类型选择ext4,大小默认200MB,其实50MB也够了,但是现在硬盘容量都很大,你分1GB也没有关系,分好容量后,点击确定

centos 安装32位库 centos 6.8安装_CentOS_28


建立‘swap’分区,swap分区是通过文件系统类型这一项选择出来的,大小设定为物理内存的2倍,生产环境中一般的服务器内存都很大,动辄就是几十GB,几百JB,如果按照2倍的物理内存来分配,那岂不是很大,很恐怖,所以这里有一个规则:

①内存大小在8GB以下,按照2倍的内存大小进行分配swap分区容量;

②内存大小在8GB以上,swap分区容量统一为16GB

centos 安装32位库 centos 6.8安装_centos_29


最后建立‘/’分区,容量大小选择使用全部可用空间,生产环境要根据要求来分配

centos 安装32位库 centos 6.8安装_centos 安装32位库_30


分区完成,下一步

centos 安装32位库 centos 6.8安装_自定义_31


开始格式化,会提示警告,选择格式化,进入格式化

centos 安装32位库 centos 6.8安装_linux_32


centos 安装32位库 centos 6.8安装_centos_33


centos 安装32位库 centos 6.8安装_centos_34


格式化完成,开始安装引导程序,默认,下一步

centos 安装32位库 centos 6.8安装_centos 安装32位库_35


这里就是开始安装程序,可以根据自己的需要进行选择安装,我在这里选择minimal,最小化安装,下一步,就开始安装了

开始安装软件包,软件包数量越多,安装的时间就越长,最后就是等待了

centos 安装32位库 centos 6.8安装_centos_36


上半部分是系统定制的不同的系统安装类型选择项,默认是“Desktop”,这里我们选择“Minimal”,即最小化安装,下半部分是在上面系统安装类型确定后,额外想添加的软件包组选择项,我们选择“Customize now”即立即自定义。

centos 安装32位库 centos 6.8安装_centos 安装32位库_37


自定义额外的包组界面,我们首先需要选择左边的大的分类,然后在勾选右边对应的小的包组。注意:右边小包组里的内容默认即可。

centos 安装32位库 centos 6.8安装_linux_38


1、根据经验,选择安装包时应该按最小化原则,即不需要的或者不确定是否需要的就不安装,这样可以最大程度上确保系统安全。

2、如果安装过程落了部分包组或者其他伙伴安装时没选,再安装后可以按如下方式补上安装时未安装的包组:

yum groupinstall “Compatibility libraries” “Base” “Development tools” “debugging Tools” “Dial-up Networking Support” -y

yum groupinstall “debugging Tools” “Dial-up Networking Support”

可以通过yum groupinfo 包组查看具体安装的组件。

3、下面安装6.5后登陆系统的时候查看选包的情况:

yum grouplist:

Installed Groups:

Base
Compatibility libraries
Debugging Tools
Development tools
E-mail server
Graphical Administration Tools
Hardware monitoring utilities
Legacy UNIX compatibility
Networking Tools
Performance Tools
Perl Support
Scientific support
Security Tools
*可以看到除了我们选择的外,系统还是默认安装了一些额外的软件包组。
注意:不要使用yum的删除功能删除软件,会删除相关依赖,导致意外问题。

centos 安装32位库 centos 6.8安装_centos_39


centos 安装32位库 centos 6.8安装_centos_40


centos 安装32位库 centos 6.8安装_centos_41


centos 安装32位库 centos 6.8安装_centos_42


centos 安装32位库 centos 6.8安装_自定义_43


centos 安装32位库 centos 6.8安装_CentOS_44


centos 安装32位库 centos 6.8安装_自定义_45


centos 安装32位库 centos 6.8安装_CentOS_46


centos 安装32位库 centos 6.8安装_centos_47


centos 安装32位库 centos 6.8安装_CentOS_48


跟改配置:

vi /etc/sysconfig/network-scripts/ifcfg-eth0

ONBOOT=yes

centos 安装32位库 centos 6.8安装_linux_49

启动或者重启网卡
ifup eth0
/etc/init.d/network restart这个更好,可以tab补全
==等价 service network restart
/etc/init.d/iptables stop//防火墙

centos 安装32位库 centos 6.8安装_CentOS_50


centos 安装32位库 centos 6.8安装_linux_51


安装没用选用的安装包

yum install tree nmap sysstat lrzsz dos2unix telnet –y

centos 安装32位库 centos 6.8安装_centos 安装32位库_52


yum -y update

升级所有包,改变软件设置和系统设置,系统版本内核都升级

yum -y upgrade

升级所有包,不改变软件设置和系统设置,系统版本升级,内核不改变

yum install lrzsz -y
yum install telnet -y
yum install nmap -y
yum install dos2unix –y

centos 安装32位库 centos 6.8安装_自定义_53


关闭SELinux功能

//先备份,再修改文件

[root@localhost ~]# cp /etc/selinux/config /etc/selinux/config.dx.20161109

[root@localhost ~]# sed -i ‘s#SELINUX=enforcing#SELINUX=disabled#g’ /etc/selinux/config

[root@localhost ~]# grep =disabled /etc/selinux/config

SELINUX=disabled

//重启后生效

centos 安装32位库 centos 6.8安装_centos 安装32位库_54


getenforce 查看SELINUX是否生效

setenforce 设置SELINUX是否生效

[root@localhost ~]# setenforce
usage: setenforce [ Enforcing | Permissive | 1 | 0 ]
[root@localhost ~]# setenforce 0
[root@localhost ~]# getenforce
Permissive
临时修改则修改 setenforce 0
一直生效则修改配置文件

关闭系统不必要的自启动
Linux系统启动后必须启动的服务选项
sshd ssh连接
rsyslog 系统日志,通过dmesg查看
network 网络服务
crond 计划和任务
sysstat 系统监控工具

centos 安装32位库 centos 6.8安装_centos 安装32位库_55

chkconfig --list|grep 3:on|awk '{print "chkconfig " $1 " off"}'|grep -Ev "sshd|network|rsyslog|crond|sysstat"|bash

检查 chkconfig --list|grep 3:on

centos 安装32位库 centos 6.8安装_linux_56


centos 安装32位库 centos 6.8安装_linux_57

cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bk

centos 安装32位库 centos 6.8安装_centos_58


sed -ir '13 iPort 52113\nListenAddress 192.168.1.150\nPermitRootLogin no\nUseDNS no\nPermitEmptyPasswords no\nGSSAPIAuthentication no\n' /etc/ssh/sshd_config

centos 安装32位库 centos 6.8安装_centos_59


vim /etc/ssh/sshd_config

###By DX#2017-03-23###
Port 52113
ListenAddress 192.168.1.132
PermitRootLogin no
UseDNS no
PermitEmptyPasswords no
GSSAPIAuthentication no
###By DX#2016-11-11###

centos 安装32位库 centos 6.8安装_CentOS_60


修改完毕配置后需要重启以下服务

[root@localhost ssh]# /etc/init.d/sshd restart

[root@localhost ssh]# /etc/init.d/sshd reload

备份yum源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
更改yum源到http://mirrors.aliyun.com/
下载新的CentOS-Base.repo 到/etc/yum.repos.d/
CentOS 5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
运行yum makecache生成缓存
yum clean all
yum makecache