zoukankan      html  css  js  c++  java
  • CentOS 7 系统基础配置

    系统版本:CentOS 7.2.1511 Minimal

    采用最小化系统安装,许多组件默认是不安装的,通过手工安装一些常用工具包,让系统用起来更顺手。

    1、修改机器名:

    [root@centos7-minimal /]# hostnamectl set-hostname nginx
    

    2、修改Hosts文件:

    [root@nginx /]# sed -i '$a 192.168.1.139   nginx' /etc/hosts
    

    3、关闭SELinux:

    [root@nginx /]# sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config修改

    4、修改网卡名称为"eth0":

    4.1、更改网卡配置文件设置:

    # mv /etc/sysconfig/network-scripts/ifcfg-ens6 /etc/sysconfig/network-scripts/ifcfg-eth0
    
    # vim /etc/sysconfig/network-scripts/ifcfg-eth0
    DEVICE=ens6
    DEVICE=eth0
    

    4.2、更改启动文件设置:

    # vim /etc/default/grub
    GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet"
    GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb net.ifnames=0 biosdevname=0 quiet"
    
    # grub2-mkconfig -o /boot/grub2/grub.cfg
    

    4.3、更改DNS设置:

    # vim /etc/resolv.conf
    nameserver 114.114.114.114
    

    以上设置需要重启系统后方可生效:

    [root@nginx /]# reboot
    

    5、停止Firewalld防火墙:

    [root@nginx /]# systemctl stop firewalld
    [root@nginx /]# systemctl disable firewalld
    

    6、安装iptables防火墙:

    [root@nginx /]# yum -y install iptables iptables-services iptables-devel iptables-utils
    

    7、启动iptables防火墙服务:

    [root@nginx /]# systemctl start iptables.service
    [root@nginx /]# systemctl enable iptables.service
    

    8、查看iptables服务的状态:

    [root@nginx /]# systemctl list-unit-files | grep "iptables"
    iptables.service                            enabled
    

    9.1、安装AliyunEPEL源:

    # wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
    # yum clean all
    # yum makecache
    

     9.2、安装原版EPEL源:

    [root@nginx /]# yum -y install epel-release
    [root@nginx /]# yum clean all
    [root@nginx /]# yum makecache
    

    10、安装常用软件:

    [root@nginx /]# yum -y install vim tree xz unzip wegt git curl lrzsz telnet ntpdate lshw htop iftop iotop
    

    11、安装编译源码所需的软件包:

    [root@nginx /]# yum -y install gcc gcc-c++ autoconf automake
    

    12、安装系统支撑所需的软件包:

    # yum -y install openssl openssl-devel pcre pcre-devel zlib zlib-devel
    

    至此系统维护所需要的基础软件包安装完毕。

    [THE END]

  • 相关阅读:
    使用 linux kernel +busybox 定制linux系统
    记一次golang的内存泄露
    关于Queries_per_sec 性能计数器
    NUMA导致的MySQL服务器SWAP问题分析
    Drop Table对MySQL的性能影响分析
    当MySQL数据库遇到Syn Flooding
    tcp_tw_recycle参数引发的数据库连接异常
    一例数据同步异常问题分析
    MySQL大量线程处于Opening tables的问题分析
    MySQL DeadLock故障排查过程
  • 原文地址:https://www.cnblogs.com/configure/p/9317364.html
Copyright © 2011-2022 走看看