Linux环境准备
1、更改主机名
# hostnamectl set-hostname
2、设置IP地址
# /etc/
TYPE=Ethernet ##网卡类型
DEVICE=ens33 ##网卡设备名称 ( 命令 : ip a )
BOOTPROTO=static ##启动方式静态 dhcp 动态
NAME=ens33
ONBOOT=yes ##开机启动
IPADDR=192.168.100.XXXXX ##IP地址,填写自己的ip段地址。
NETMASK=255.255.255.0 ##子网掩码
GATEWAY=192.168.100.1 ##默认网关
DNS1=114.114.114.114
DNS2=8.8.8.8
3、防火墙设置
1)关闭firewald防火墙(可选)
# systemctl stop firewalld.service
# systemctl disable firewalld.server
//如果安装了兼容性工具net-tools可以使用如下命令:
# service firewalld stop
# chkconfig firewalld off
2)关闭selinux(建议关闭)
//一般建议关闭selinux,不然安装你修改一些软件配置路径不符合selinux规范可能会报错软件启动不了。
//临时关闭:
# setenforce off
//永久性关闭:
# sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
# sed -i '/SELINUX=/p' /etc/selinux/config
//要生效需要重启
# shutdown -r now
4、yum源配置(阿里源)
[root@centos8 ~]# cat /etc/yum.repos.d/aliyun.repo
[aliyun]
baseurl=http://mirrors.aliyun.com/centos/7/os/x86_64/
enabled=1
gpgcheck=0
[epel]
baseurl=https://mirrors.aliyun.com/epel/7Server/x86_64/
enabled=1
gpgcheck=0
//清空缓存
[root@centos8 ~]# yum makecache
5、安装编译插件
# yum install gcc pcre-devel openssl-devel wget GeoIP GeoIP-devel GeoIP-data -y