Note:
The latest version of CentOS 6.x is CentOS 6.8. The following describes how to install and configure CentOS 6.8.
The server settings are as follows:
Operating system: CentOS 6.8 64-bit
IP address: 192.168.21.129
Gateway: 192.168.21.2
DNS: 8.8.8.8 8.4.4
Note:
CentOS 6.8 system images are available in 32-bit and 64-bit versions, as well as minimal versions specially optimized for servers.
If the production server is large memory (4 GB memory or above), it is recommended to install the CentOS-6.8-x86_64-minimal.iso version
Attachment: Download address of CentOS 6.8
32-bit minimal version:
Http://mirrors.aliyun.com/centos/6.8/isos/i386/CentOS-6.8-i386-minimal.iso
64-bit minimal. Version:
Http://mirrors.aliyun.com/centos/6.8/isos/x86_64/CentOS-6.8-x86_64-minimal.iso
1. To enable the image installation mode, the computer memory of CentOS 6.8 must be equal to or greater than 628 MB (minimum memory 628 MB;
2. CentOS 6.8 system installation methods include: Graphical installation mode and text installation mode;
3. CentOS 6.8 text installation mode does not support custom partitions. We recommend that you use the image installation mode;
5. CentOS 6.8 systems run in the following ways: text mode with graphic interface, graphical mode that can be operated with the mouse, without graphical interface, and direct command line operation (by default, CentOS minimal runs in text mode, there is no custom option for the system running mode during system installation );
1. Install CentOS 6.8
Boot the system with a CD, and the following interface will appear.
Interface description:
Install or upgrade an existing system # Install or upgrade an existing system
Install system with basic video driver # use the basic graphics card driver during installation
Rescue installed system # enter system repair mode
Boot from local drive # exit installation start from hard disk
Memory test # Memory detection
Select the first option, install or upgrade the existing system, and press enter.
If you have a question about whether to test the CD media, select "Skip" to Skip the test.
The following interface is displayed:
Next
Select the language: English (English) # We recommend that you install the English version on the production server.
Select U. S. English as the keyboard.
Select Item 1, basic storage device
Select the first item: Yes, ignore all data
Set the host name, which is the default value. After installation, modify the host name.
Next
Time zone selection: Asia/Shanghai
"System clock user UTC" # deselect the preceding check box. The UTC time is not used.
Set root password
Next
Note: If your password is too simple, the system will automatically prompt: your password is not safe enough, too simple/systematic
Select "Use Anyway".
Strong and complex passwords must be set in the production environment
Next
Select the last item and Create M Layout to Create a Custom partition.
Next
We can see the capacity of the hard disk. Here I show 5 GB, and now the custom partition.
Note: Before partitioning, you must plan the partitions first.
The partition here is as follows:
Hard disk 5 GB in total
Swap #1024 M, usually set to 2 times the memory
/# All remaining space
Note:
For servers in formal production, remember to partition the data disk separately to ensure data integrity in case of system problems. For example, you can divide another
/Data is used to store data.
Select Free partitions and click Create
Select Standard Partition, and click Create
File system type: swap
The Size is 1024.
Other options are available by default.
OK
Continue to select Free partitions, click Create
Select Standard Partition, and click Create
Mount point :/
File system type: ext4
Select "use all available space"
Other options are available by default.
OK
After creating the partition, as shown in the figure above, click Next
Click "Format" to Format
Select "Write changes to disk" to Write the changes to the disk.
Default
Next
Start Installation
Installation complete
Click "Reboot" to Reboot and the system restarts automatically.
System Installation complete
2. Set IP addresses, gateways, and DNS
Note: After CentOS 6.8 is installed by default, network connections are not automatically enabled!
Enter account root
Enter the password set during installation and log on to the system.
Vi/etc/sysconfig/network-scripts/ifcfg-eth0 # Edit the configuration file and add the following changes
BOOTPROTO = static # enable static IP addresses
ONBOOT = yes # enable network connection automatically
IPADDR = 192.168.21.129 # set the IP address
NETMASK = 255.255.255.0 # set the subnet mask
GATEWAY = 192.168.21.2 # set the GATEWAY
DNS1 = 8.8.8.8 # set the primary DNS
DNS2 = 8.8.4.4 # Set backup DNS
IPV6INIT = no # disable IPV6
: Wq! # Save and exit
Service ip6tables stop # stop IPV6 service
Chkconfig ip6tables off # disable IPV6 boot
Service yum-updatesd stop # Disable automatic system update
Chkconfig yum-updatesd off # enable startup prohibited
Service network restart # restart the network connection
Ifconfig # View IP addresses
3. Set the host name
Conventions:
Host name naming rules: Business. Data Center. Master/slave. Domain name
Set the host name to bbs.hz.m.osyunwei.com.
1. hostname "bbs.hz.m.osyunwei.com"
# Set the host name to bbs.hz.m.osyunwei.com.
2. vi/etc/sysconfig/network # Edit the configuration file
HOSTNAME = bbs.hz.m.osyunwei.com
# Modify localhost. localdomain to bbs.hz.m.osyunwei.com
: Wq! # Save and exit
3. vi/etc/hosts # Edit the configuration file
127.0.0.1 bbs.hz.m.osyunwei.com localhost
# Modify localhost. localdomain to bbs.hz.m.osyunwei.com
: Wq! # Save and exit
Shutdown-r now # restart the system
So far, CentOS 6.8 has been installed and configured