重要提醒:以下均为模拟全新环境教程。如有业务或数据,请勿操作。
重要提醒:以下均为模拟全新环境教程。如有业务或数据,请勿操作。
重要提醒:以下均为模拟全新环境教程。如有业务或数据,请勿操作。
本人对linux一无所知,只是因为这个项目才针对性查了一些资料,还是一知半解,非常业余,但也因此记录比较详细,但有些中文描述不对或不准确,也请见谅。
需要准备的工具请自行准备,我只列了自己使用的版本,其它版本也可以,根据自己需要准备:
- vmware workstation pro 17.5
- CentOS-8.5.2111-x86_64-dvd1.iso
- 安装vmware(略)
- 新建虚拟机(看图,不做说明或在图中说明)
- 安装CentOS 8.5(看图,不做说明或在图中说明)
- 基础配置
#查看本机网络配置(如前期未配置,自行配置网络)
#配置网络可以正常访问互联网
#临时关闭SELinux
[root@localhost ~]# setenforce 0
#永久关闭SELinux(重启生效)
[root@localhost ~]# sed -i 's/SELINUX=enforcing/SELINUX=disabled/g'
#临时关闭防火墙(选做,或在后期设置防火墙规则)
[root@localhost ~]# systemctl stop firewalld.service
#永久关闭防火墙(选做,或在后期设置防火墙规则)
[root@localhost ~]# systemctl disable firewalld.service
#备份repo原文件,使用国内源,这里使用的是阿里的,可根据你的自己情况选择国内其它源
[root@localhost ~]# cd /etc/yum.repos.d
[root@localhost yum.repos.d]# mkdir bak
[root@localhost yum.repos.d]# mv CentOS-* bak
[root@localhost yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
#查看文件文件中源已切换为阿里的地址(选做)
[root@localhost yum.repos.d]# vim /etc/yum.repos.d/CentOS-Base.repo
#返回用户目录(非必须,选做)
[root@localhost ~]# cd
#安装 yum-utils
[root@localhost ~]# yum install -y yum-utilis
#安装dnf
[root@localhost ~]# yum install -y dnf
#先安装 epel 仓库
[root@localhost ~]# yum install -y epel-release
#更新yum
[root@localhost ~]# yum update -y
#安装Apache以及其扩展包
[root@localhost ~]# yum install -y httpd httpd-manual mod_ssl mod_perl
#更新yum软件包缓存
[root@localhost ~]# yum makecache
#返回用户目录(非必须,选做)
[root@localhost ~]# cd
#启用并启动 Apache HTTP 服务器
[root@localhost ~]# systemctl enable httpd && systemctl start httpd