先在A上设置本地yum源 用来安装基础版本gcc pcre* openssl*再安装nginx
下载centos(http://mirrors.aliyun.com/centos/7.9.2009/isos/x86_64/)
上传到/usr/local/os/
挂载到/mnt/yumrepo/
mount -o loop /usr/local/os/centos-7-x86_64-everything-2009.iso /mnt/yumrepo/
创建yum源配置
vi /etc/yum.repos.d/local.repo
[base]
name=CentOS-$releasever - Base
baseurl=file:///mnt/yumrepo
enabled=1
gpgcheck=0
gpgkey=file:///mnt/yumrepo/RPM-GPG-KEY-CentOS-7
加载yum源配置
yum clean all
A用本地yum源来安装基础版本gcc pcre* openssl*再安装nginx
配置A的nginx
server {
listen 80;
server_name localhost default_server;
location / {
root /mnt/yumrepo;
index index.html index.htm;
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
其他主机引用A的yum源
vi /etc/yum.repos.d/local.repo
[local]
name = local
baseurl = http://A主机ip
enable = 1
gpgcheck = 0
yum clean all