Linux~CentOS7的基础配置和常用软件
一、基础配置
- 修改网络IP
vi /etc/sysconfig/network-scripts/ifcfg-ens33
# 修改的内容
BOOTPROTO="static"
# 添加的内容
IPADDR=192.168.10.100
GATEWAY=192.168.10.2
DNS1=192.168.10.2
- 设置主机名
vi /etc/hostname
# 修改的内容
node
- 设置网络映射
vi /etc/hosts
# 添加的内容
192.168.10.100 node
- 重启虚拟机
reboot
- 配置阿里云镜像
# 备份
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
# 下载
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
# 生成缓存
yum makecache
# 非阿里云用户运行
sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo
- 关闭防火墙
# 关闭防火墙
systemctl stop firewalld
# 关闭防火墙自启
systemctl disable firewalld.service
- 关闭selinux
vi /etc/selinux/config
# 修改的内容
SELINUX=disabled
- 创建软件安装的路径和文件夹
# 软件安装目录
mkdir -p /export/server
# 安装包的目录
mkdir -p /export/software
# 软件运行数据保存的目录
mkdir -p /export/data
# 软件运行日志
mkdir -p /export/logs
二、安装常用的软件
- epel-release(第三方源)
yum install -y epel-release
- net-tool(Linux网络基础)
yum install -y net-tools
- vim(编辑器)
yum install -y vim
- tree(查看目录树)
yum install -y tree
- lrzsz(上传下载需要的包)
yum install -y lrzsz