---
title: "CentOS 6.6系统安装配置图文教程"
author: "蘑蘑茶"
date: "2018-02-02T14:04:23Z"
tags: []
categories: ["操作系统"]
slug: "centos-6-6"
draft: false
lastmod: "2018-02-02T14:04:23Z"
id: 2410071
url: "https://xiaoming9920.iteye.com/blog/2410071"
---

截止目前CentOS 6.x最新版本为CentOS 6.6，下面介绍CentOS 6.6的具体安装配置过程

**服务器相关设置如下：**

操作系统：CentOS 6.6 64位

IP地址：192.168.21.129

网关：192.168.21.2

DNS：8.8.8.8 8.8.4.4

**备注：**

CentOS 6.6系统镜像有32位和64位两个版本，并且还有专门针对服务器优化过的minimal版本

生产服务器如果是大内存（4G以上内存），建议安装CentOS-6.5-x86\_64-minimal.iso版本

**附：CentOS 6.6下载地址**

32位minimal版本：

[http://mirror.bit.edu.cn/centos/6.6/isos/i386/CentOS-6.6-i386-minimal.iso](http://mirror.bit.edu.cn/centos/6.6/isos/i386/CentOS-6.6-i386-minimal.iso)

64位minimal.版本：

[http://mirror.bit.edu.cn/centos/6.6/isos/x86\_64/CentOS-6.6-x86\_64-minimal.iso](http://mirror.bit.edu.cn/centos/6.6/isos/x86_64/CentOS-6.6-x86_64-minimal.iso)

1、安装CentOS 6.6系统的计算机内存必须等于或者大于628M（最小内存628M），才能启用图形安装模式；

2、CentOS 6.6的系统安装方式分为：图形安装模式和文本安装模式；

3、CentOS 6.6文本安装模式不支持自定义分区，建议使用图形安装模式安装；

5、CentOS 6.6系统运行方式分为：带图形界面、可以用鼠标操作的图形化方式和不带图形界面、直接用命令行操作的文本方式（CentOS minimal版本默认是以文本方式运行，在系统安装的过程中没有系统运行方式的自定义选项）；

**一、安装CentOS 6.6**

用光盘成功引导系统，会出现下面的界面

![](http://files.jb51.net/file_images/article/201410/201410312153183.jpg)

**界面说明：**

Install or upgrade an existing system 安装或升级现有的系统

install system with basic video driver 安装过程中采用 基本的显卡驱动

Rescue installed system 进入系统修复模式

Boot from local drive 退出安装从硬盘启动

Memory test 内存检测

这里选择第一项，安装或升级现有的系统，回车。

出现是否对CD媒体进行测试的提问，这里选择“Skip”跳过测试。

![](http://files.jb51.net/file_images/article/201410/201410312153184.jpg)

出现下面的界面

![](http://files.jb51.net/file_images/article/201410/201410312153185.jpg)

Next

![](http://files.jb51.net/file_images/article/201410/201410312153186.jpg)

选择语言为：English（English） #生产服务器建议安装英文版本

Next

![](http://files.jb51.net/file_images/article/201410/201410312153187.jpg)

键盘选择为：U.S.English

Next

![](http://files.jb51.net/file_images/article/201410/201410312153188.jpg)

选择第一项，基本存储设备

Next

![](http://files.jb51.net/file_images/article/201410/201410312153189.jpg)

选择第一项：Yes，忽略所有数据

Next

![](http://files.jb51.net/file_images/article/201410/2014103121531810.jpg)

设置主机名，这里默认即可，安装完成之后再修改

Next

![](http://files.jb51.net/file_images/article/201410/2014103121531811.jpg)

时区选择：Asia/Shanghai

"System clock user UTC" #取消前面打勾，不使用UTC时间

![](http://files.jb51.net/file_images/article/201410/2014103121531812.jpg)

设置root密码

Next

![](http://files.jb51.net/file_images/article/201410/2014103121531813.jpg)

注意：如果你使用的密码过于简单，系统会自动提示：您的密码不够安全，过于简单化/系统化

这里选择“Use Anyway" 无论如何都使用

**生产环境必须设置强壮复杂的密码**

Next

![](http://files.jb51.net/file_images/article/201410/2014103121531814.jpg)

选择最后一项，Create Custom Layout 创建自定义分区

Next

![](http://files.jb51.net/file_images/article/201410/2014103121531815.jpg)

可以看到硬盘的容量，我这里显示的是20G，现在自定义分区。

注意：分区之前，自己先要规划好，怎么分区

我这里的分区如下：

硬盘总共20G

swap #2048M，一般设置为内存2倍

/ #剩余所有空间

**特别说明：**

用于正式生产的服务器，切记必须把数据盘单独分区，防止系统出问题时，保证数据的完整性。比如可以再划分一个

/data专门用来存放数据。

![](http://files.jb51.net/file_images/article/201410/2014103121531816.jpg)

选中空闲分区Free，点创建Create

选择标准分区Standard Partition，点创建Create

![](http://files.jb51.net/file_images/article/201410/2014103121531817.jpg)

文件系统类型：swap

大小Size：2048

其他选项默认即可

确定 OK

![](http://files.jb51.net/file_images/article/201410/2014103121531818.jpg)

继续选中空闲分区Free，点创建Create

![](http://files.jb51.net/file_images/article/201410/2014103121531819.jpg)

选择标准分区Standard Partition，点创建Create

![](http://files.jb51.net/file_images/article/201410/2014103121531820.jpg)

挂载点：/

文件系统类型：ext4

选中“使用全部可用空间”

其他选项默认即可

确定 OK

![](http://files.jb51.net/file_images/article/201410/2014103121531821.jpg)

创建好分区之后，如上图所示，然后点Next

![](http://files.jb51.net/file_images/article/201410/2014103121531822.jpg)

点“Format”格式化

![](http://files.jb51.net/file_images/article/201410/2014103121531823.jpg)

选择“Write changes to disk”将修改写入磁盘

![](http://files.jb51.net/file_images/article/201410/2014103121531824.jpg)

默认

Next

![](http://files.jb51.net/file_images/article/201410/2014103121531825.jpg)

开始安装

![](http://files.jb51.net/file_images/article/201410/2014103121531826.jpg)

安装完成

点“Reboot”重新引导，系统自动重启

![](http://files.jb51.net/file_images/article/201410/2014103121531827.jpg)

重启之后，出现下面登录界面

![](http://files.jb51.net/file_images/article/201410/2014103121531828.jpg)

输入账号root和密码，成功登录系统，如下图所示：

![](http://files.jb51.net/file_images/article/201410/2014103121531829.jpg)

系统安装完成

**二、设置IP地址、网关、DNS**

约定：

第一块网卡为外网

第二块网卡为内网（没有外网的机器也要将内网配置在第二块网卡上）

**说明：CentOS 6.6默认安装好之后是没有自动开启网络连接的！**

输入账号root

再输入安装过程中设置的密码，登录到系统

vi /etc/sysconfig/network-scripts/ifcfg-eth0 #编辑配置文件,添加修改以下内容

BOOTPROTO=static #启用静态IP地址

ONBOOT=yes #开启自动启用网络连接

IPADDR=192.168.21.129 #设置IP地址

NETMASK=255.255.255.0 #设置子网掩码

GATEWAY=192.168.21.2 #设置网关

DNS1=8.8.8.8 #设置主DNS

DNS2=8.8.4.4 #设置备DNS

IPV6INIT=no #禁止IPV6

:wq! #保存退出

service ip6tables stop #停止IPV6服务

chkconfig ip6tables off #禁止IPV6开机启动

service yum-updatesd stop #关闭系统自动更新

chkconfig yum-updatesd off #禁止开启启动

service network restart #重启网络连接

ifconfig #查看IP地址

**三、设置主机名**

约定：

主机名命名规范：业务.机房.主备.域名

这里设置主机名为：bbs.hz.m.osyunwei.com

1、hostname “bbs.hz.m.osyunwei.com”

#设置主机名为bbs.hz.m.osyunwei.com

2、vi /etc/sysconfig/network #编辑配置文件

HOSTNAME= bbs.hz.m.osyunwei.com

#修改localhost.localdomain为bbs.hz.m.osyunwei.com

:wq! #保存退出

3、vi /etc/hosts #编辑配置文件

127.0.0.1 bbs.hz.m.osyunwei.com localhost

#修改localhost.localdomain为bbs.hz.m.osyunwei.com

:wq! #保存退出

shutdown -r now #重启系统

**至此，CentOS 6.6系统安装配置完成**