局域网yum部署
一、下载rpm包
1. CentOS7.9下载
# 安装依赖包
yum -y install yum-utils createrepo
# 下载rpm
reposync -n --repoid=base --repoid=updates --repoid=extras -p /data
2. OracleLinux7.9下载
# 安装依赖包
yum -y install yum-utils createrepo
# 下载rpm
reposync -n --repoid=ol7_latest --repoid=ol7_UEKR6 -p /data
二、创建yum仓库
1. CentOS7.9创建
createrepo -o /data/base /data/base
createrepo -o /data/extras /data/extras
createrepo -o /data/updates /data/updates
1. OracleLinux7.9创建
createrepo -o /data/ol7_latest /data/ol7_latest
createrepo -o /data/ol7_UEKR6 /data/ol7_UEKR6
三、创建yum索引
1. CentOS7.9创建
[base]
name="CentOS7.9 base"
baseurl=http://192.168.233.128/Centos7/base
gpgcheck=0
enabled=1
[extras]
name="CentOS7.9 extras"
baseurl=http://192.168.233.128/Centos7/extras
gpgcheck=0
enabled=1
[updates]
name="CentOS7.9 updates"
baseurl=http://192.168.233.128/Centos7/updates
gpgcheck=0
enabled=1
2. OracleLinux7.9创建
[ol7_latest]
name="OracleLinux7.9 ol7_latest"
baseurl=http://192.168.233.128/OracleLinux7/ol7_latest
gpgcheck=0
enabled=1
[ol7_UEKR6]
name="OracleLinux7.9 ol7_UEKR6"
baseurl=http://192.168.233.128/OracleLinux7/ol7_UEKR6
gpgcheck=0
enabled=1
四、nginx安装与配置
1.安装gcc
yum -y install gcc gcc-c++
2. 安装nginx,上传nginx、openssl、pcre、zlib软件包到/data/soft
nginx-1.24.0.tar.gz
openssl-1.1.1w.tar.gz
pcre-8.45.tar.gz
zlib-1.2.13.tar.gz
3.分别解压
tar xf openssl-1.1.1w.tar.gz
tar xf pcre-8.45.tar.gz
tar xf zlib-1.2.13.tar.gz
tar xf nginx-1.24.0.tar.gz
4.编译nginx
./configure --prefix=/data/nginx --with-http_ssl_module --with-pcre=/data/soft/pcre-8.45 --with-zlib=/data/soft/zlib-1.2.13 --with-openssl=/data/soft/openssl-1.1.1w
5.安装nginx
make && make install
6.配置nginx作为yum源
user root;
worker_processes auto;
error_log logs/error.log;
pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log logs/access.log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 4096;
# 打开浏览目录
autoindex on;
server {
listen 80;
server_name 192.168.233.128;
#charset koi8-r;
#access_log logs/host.access.log main;
root /data/software;
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
7.启动验证
/data/nginx/sbin/nginx
标签:tar,--,局域网,nginx,yum,ol7,data
From: https://www.cnblogs.com/lzexin/p/17844997.html