一、创建虚拟机
二、安装CentOS8.5映像
选择语言,Boot版本对中文的支持不是很好,建议直接选择English(US)的,这里选择中文以进行对照演示
1.安装位置
2.网络配置(VM虚拟网络配置对应)
3.设置安装源
4.软件选择
5.设置根密码(密码如果过于简单,需要点击两次完成确认)
三、配置yum源
1.去配置文件夹,备份原repos文件夹
cd /etc
mv yum.repos.d/ yum.repos.d.bak
touch yum.repos.d
cd yum.repos.d
2.下载阿里云CentOS-Base.repo文件
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
非阿里云用户修改:
sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo
3.清除缓存,建立新缓存
yum -y clean all
yum -y makecache
yum repolist # 查看yum仓库信息
4.安装必要软件进行测试
yum -y install wget
yum -y install vim
yum info vim # 查看软件的版本等信息
5.阿里云CentOS-Base.repo文件内容(如有需要可以根据其内容自行发挥)
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
[base]
name=CentOS-8.5.2111 - Base - mirrors.aliyun.com
baseurl=http://mirrors.aliyun.com/centos-vault/8.5.2111/BaseOS/$basearch/os/
gpgcheck=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official
#additional packages that may be useful
[extras]
name=CentOS-8.5.2111 - Extras - mirrors.aliyun.com
baseurl=http://mirrors.aliyun.com/centos-vault/8.5.2111/extras/$basearch/os/
gpgcheck=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-8.5.2111 - Plus - mirrors.aliyun.com
baseurl=http://mirrors.aliyun.com/centos-vault/8.5.2111/centosplus/$basearch/os/
gpgcheck=0
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official
[PowerTools]
name=CentOS-8.5.2111 - PowerTools - mirrors.aliyun.com
baseurl=http://mirrors.aliyun.com/centos-vault/8.5.2111/PowerTools/$basearch/os/
gpgcheck=0
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official
[AppStream]
name=CentOS-8.5.2111 - AppStream - mirrors.aliyun.com
baseurl=http://mirrors.aliyun.com/centos-vault/8.5.2111/AppStream/$basearch/os/
gpgcheck=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official
四、网卡配置文件位置
/etc/sysconfig/network-scripts/ifcfg-ens33
重启虚拟机,重启网卡
五、远程连接配置
firewall-cmd --state # 查看防火墙状态
或
systemctl status firewalld # 查看防火墙详细状态
systemctl stop firewalld # 关闭防火墙(启动start,重启restart)
firewall-cmd --reload # 刷新防火墙
firewall-cmd --query-port=3306/tcp # 查看3306端口是否开放
firewall-cmd --zone=public --add-port=3306/tcp --permanent # 开放3306端口,刷新或重启防火墙生效
firewall-cmd --zone=public --add-port=xxxx-xxxx/tcp --permanent # 开放一段端口,刷新或重启防火墙生效
firewall-cmd --zone=public --remove-port=3306/tcp --permanent # 关闭3306端口,刷新或重启防火墙生效
firewall-cmd --zone=public --remove-port=xxxx-xxxx/tcp --permanent # 关闭一段端口,刷新或重启防火墙生效
firewall-cmd --zone=public --list-ports # 查看开放端口列表
netstat -lnpt # 查看监听的端口
netstat -lnpt |grep 3306 # 查看3306端口被哪一个进程占用
六、服务配置
systemctl enable service # 设置服务自启动
systemctl disable service # 禁止服务自启动
七、权限管理
# 递归修改文件权限
chmod -R 777 dir/
原文地址:https://blog.csdn.net/weixin_43789456/article/details/131571588
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若转载,请注明出处:http://www.7code.cn/show_27620.html
如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱:suwngjj01@126.com进行投诉反馈,一经查实,立即删除!
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。