服务器 | IP地址 |
---|---|
服务端 图形化安装 | 192.168.153.160 |
客户端 最小化安装 | 192.168.153.180 |
服务端和客户端均关闭防火墙和selinux
systemctl stop firewalld
setenforce 0
mkdir -p /media/CentOS7
mount /dev/sr0 /mnt
cp -r /mnt/* /media/CentOS7
chmod -R 777 /media/CentOS7
CentOS-Base.repo 是yum 网络源的配置文件
CentOS-Media.repo 是yum 本地源的配置文件
vim /etc/yum.repos.d/CentOS-Media.repo
修改之后内容如下:
[c7-media]
name=CentOS-$releasever - Media
baseurl=file:///media/CentOS7/
gpgcheck=0
enabled=1
gpgkey=file:///media/CentOS7/RPM-GPG-KEY-CentOS-7
vim /etc/yum.repos.d/CentOS-Base.repo
将enabled参数设为0
enabled=0
yum clean all
yum makecache
[root@host-160 ~]# yum repolist
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
repo id repo name status
c7-media CentOS-7 - Media 9,911
repolist: 9,911
参考文档:https://blog.csdn.net/m0_46674735/article/details/109709606
vim /usr/local/nginx/conf/nginx.conf
43行到47行内容修改如下
43 location / {
44 autoindex on;
45 root /media/CentOS7;
46 index index.html index.htm;
47 }
/usr/local/nginx/sbin/nginx
192.168.153.160
访问,结果如图cd /etc/yum.repos.d/
mkdir bak
mv *.repo bak
vim local.repo
local.repo文件内容如下
[local]
name=local
baseurl=http://192.168.153.160
gpgcheck=0
enabled=1
yum clean all
yum makecache
[root@host-180 yum.repos.d]# yum repolist
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
repo id repo name status
local local 9,911
repolist: 9,911
yum -y install httpd
yum -y install mariadb-server
[root@host-180 yum.repos.d]# rpm -qa|grep mariadb
mariadb-libs-5.5.64-1.el7.x86_64
使用以下命令卸载
rpm -e mariadb-libs-5.5.64-1.el7.x86_64 --nodeps
再次安装mysql即可
yum -y install mariadb-server
yum install createrepo -y
yum install mariadb-server --downloadonly --downloaddir=/media/CentOS7/Packages/
createrepo --update /media/CentOS7/Packages/
服务端和客户端都要做下面的操作:
yum clean all
yum makecache
https://blog.csdn.net/zhangshaohuas/article/details/109777538