1. install centos 7 Formwork machine

Get ready centos7 Mirror image

Download address :http://mirrors.aliyun.com/centos/7/isos/x86_64/

install centos

Custom hardware :

Make some changes to the hardware Support virtualization

Turn on Virtualization support :

When the configuration is complete Click ok Then turn it on

Change the passage to :

vmlinuz initrd=initrd.img inst.stage2=hd:LABEL=CentOS\x207\x20\x86_64 quiet net.ifnames=0 biosdevname=0

When you're done typing enter

Choose the language of the installation process :

The network configuration

Manual configuration IP Address

Click on Add add to IP Address Fill in the address information 10.0

To configure IP

After the configuration is complete Click on save Save configuration

Set host name

Configure the time zone :

Time zone modification :

Click on done after Choose the installation package

Language support selection

Installation package selection

After selecting the installation package , Click on Done close Continue to choose disk

Disk partition :

Add partition :

Create the first one swap Partition :

swap Partition to memory 1.5 times I think so MB

Add root partition :

Check :

Kernel backup is off :

Click on Begin installation Start installation

Step summary :

setup script Set up root password :

Click on two Done Go back to the installation screen

Restart the server

2. centos7 Template machine optimization

Network card optimization

take /etc/sysconfig/network-scripts/ifcfg-eth0 The content of network card is reduced to :


After modification, restart the network card : systemctl restart network

Network card management optimization

Change the network card management mode to NetworkManager.service

systemctl stop NetworkManager.service 
systemctl disable NetworkManager.service

Firewall optimization

systemctl stop firewalld       # Turn off firewall   
systemctl disable firewalld    # Boot does not start firewall 

close SElinux

setenforce 0

sshd Optimize

115 That's ok :#UseDNS no
 Change it to :  UseDNS no

79 That's ok :GSSAPIAuthentication yes
 Change it to : GSSAPIAuthentication no

 restart sshd service : systemctl restart sshd

yum Source optimization

yum Source optimization ( Use the CD , Connect the disc and execute the following command .):

mount /mnt
cd /etc/yum.repos.d/
mkdir test -p
\mv *.repo test
echo '[local]
gpgcheck=0' >local.repo
mount /dev/cdrom /mnt
yum makecache

Change to alicloud yum Source :

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -P /etc/yum.repos.d/ http://mirrors.aliyun.com/repo/epel-7.repo

tab Complement optimization

yum install -y bash-completion.noarch

Install common software :

yum install -y net-tools vim lrzsz wget tree screen lsof tcpdump

Bring your own mail service down

ystemctl stop postfix.service
systemctl disable postfix.service

Optimize time synchronization [ Synchronize Beijing time ]

echo '*/5 * * * * /usr/sbin/ntpdate -u ntp.api.bz' >>/var/spool/cron/root
systemctl restart crond.service

Optimization finished

shutdown -h now To turn it off . The whole optimization process is completed .

3. Clone virtual machine

Two deletions An empty

1 Empty :
> /etc/udev/rules.d/70-persistent-net.rules 

2 Delete :
 Delete two lines in the network card , No, it's not clear :