Centos 7最小化安装后配置
- 关闭SELINUX
vi /etc/sysconfig/selinux SELINUX=disabled :wq
- 配置网卡(最小化安装后ifconfig无法使用),该配置的前提是采用 NAT模式
vi /etc/sysconfig/network-scripts/ifcfg-enp0s3 ONBOOT=yes :wq service network restart # 检查网卡 ip addr 或者 ping -c2 www.baidu.com
- 更新yum
yum -y update
- 联网后安装ifconfig
yum -y install net-tools
- 安装常用工具
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
- 设置时区为上海时区
ll /etc/localtime // 如果不为上海时区则执行 rm -rf /etc/localtime ln -s /etc/localtime /usr/share/zoneinfo/Asia/Shanghai
- 安装依赖关系
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
- 安装TMUX终端复用软件
wget https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz wget https://github.com/tmux/tmux/releases/download/2.3/tmux-2.3.tar.gz // 编译安装 tar xzf libevent-2.1.8-stable.tar.gz cd libevent-2.1.8-stable ./configure make make install // 安装 tar xzf tmux-2.3.tar.gz cd tmux-2.3 CFLAGS="-I/usr/local/include" LDFLAGS="-L//usr/local/lib" ./configure make make install // 创建软连接 32位系统: ln -s /usr/local/lib/libevent-2.1.so.6 /usr/lib/libevent-2.1.so.6 64位系统: ln -s /usr/local/lib/libevent-2.1.so.6 /usr/lib64/libevent-2.1.so.6
- 修改yum源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup cd /etc/yum.repos.d/ wget http://mirrors.163.com/.help/CentOS6-Base-163.repo yum makecache yum -y update