centos7 最小化后安装配置
1.关闭selinux
vi /etc/sysconfig/selinux SELINUX=disabled :wq
2.配置网卡(最小化安装后ifconfig无法使用)
vi /etc/sysconfig/network-scripts/ifcfg-ens33 ONBOOT=yes :wq service network restart
3.测试网卡是否正常
ip addr 或者 ping -c2 www.baidu.com
4.更新yum
yum -y update 联网后安装ifconfig yum -y install net-tools
5.绑定静态IP
vim /etc/sysconfig/network-scripts/ifcfg-ens33 IPADDR=192.168.88.128 #设置当前IP地址 GATEWAY=192.168.88.2 #网关地址 设置为虚拟机的网关IP NETMASK=255.255.255.0 DNS1=114.114.114.114 DNS2=8.8.8.8 :wq service network restart
6.常用工具的安装
yum -y install curl telnet vim wget lrzsz //修改vim配置 vim ~/.vimrc set encoding=utf-8 " 文件编码 set number " 显示行号 set tabstop=4 " tab宽度为4 set softtabstop=4 " 设置一次可以删除4个空格 set expandtab " tab转换为空格 set nowrap " 不自动换行 set showmatch " 显示括号配对情况 syntax on " 开启语法高亮 //设置history 大小 vim /etc/profile HISTORY=100 :wq //安装常用依赖关系 yum -y install gcc gcc-c++ make autoconf wget lrzsz libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5-devel libidn libidn-devel openssl openssl-devel libxslt-devel libevent-devel libtool libtool-ltdl bison gd gd-devel vim-enhanced pcre-devel zip unzip ntpdate sysstat patch bc expect rsync
防火墙设置:
systemctl status firewalld.service systemctl start firewalld.service systemctl enable firewalld.service firewall-cmd --zone=public --list-ports firewall-cmd --zone=public --add-port=80/tcp --permanent firewall-cmd --zone=public --add-port=3306/tcp --permanent firewall-cmd --zone=public --list-ports firewall-cmd --reload firewall-cmd --zone=public --list-ports
虚拟机设置: