百度360必应搜狗淘宝本站头条
当前位置:网站首页 > 技术文章 > 正文

离线安装所有可直接yum的服务(离线安装包是什么)

nanshan 2024-10-27 11:18 37 浏览 0 评论

公司场景需求:离线服务器上安装一个nginx服务
系统版本:CentOS 7.6

方法一:
使用tar包,二进制安装 略

方法二:
rpm方式
安装rpm包时,应该大家都遇到过缺少依赖包的问题,一个一个安装依赖文件,让人头疼。

这里给大家介绍一种很方便的安装方法
使用yumdownloader命令离线安装 nginx rpm服务包

1.首先找一个可以连接外网的服务器

可以ping通百度域名,确定可以上外网
[root@243-ceshi /]# ping www.baidu.com
PING www.baidu.com 
icmp_seq=1 ttl=53 time=23.5 ms
icmp_seq=2 ttl=53 time=22.8 ms
icmp_seq=3 ttl=53 time=27.3 ms
123456

2.安装插件

[root@localhost ~]# yum install yum-utils

3.创建一个存放rpm包的目录

[root@localhost ~]# mkdir /rpm

4.下载nginx rpm相关文件

[root@localhost rpm]# yumdownloader --resolve --destdir=/rpm  nginx

5.查看rpm目录下的文件

[root@243-ceshi rpm]# ls
centos-indexhtml-7-9.el7.centos.noarch.rpm  nginx-mod-http-image-filter-1.16.1-3.el7.x86_64.rpm
gd-2.0.35-27.el7_9.x86_64.rpm               nginx-mod-http-perl-1.16.1-3.el7.x86_64.rpm
gperftools-libs-2.6.1-1.el7.x86_64.rpm      nginx-mod-http-xslt-filter-1.16.1-3.el7.x86_64.rpm
libXpm-3.5.12-1.el7.x86_64.rpm              nginx-mod-mail-1.16.1-3.el7.x86_64.rpm
nginx-1.16.1-3.el7.x86_64.rpm               nginx-mod-stream-1.16.1-3.el7.x86_64.rpm
nginx-all-modules-1.16.1-3.el7.noarch.rpm   openssl11-libs-1.1.1g-2.el7.x86_64.rpm
nginx-filesystem-1.16.1-3.el7.noarch.rpm
12345678

nginx最新版本的相关依赖文件全在都rpm目录下了

6.把rpm目录下文件移到内网服务器的/rpm目录下

[root@243-ceshi /]# scp -r /rpm root@192.168.1.168:/rpm
root@192.168.1.168's password:
centos-indexhtml-7-9.el7.centos.noarch.rpm                                                100%   92KB  19.7MB/s   00:00
gd-2.0.35-27.el7_9.x86_64.rpm                                                             100%  146KB  22.7MB/s   00:00
gperftools-libs-2.6.1-1.el7.x86_64.rpm                                                    100%  272KB  26.2MB/s   00:00
libXpm-3.5.12-1.el7.x86_64.rpm                                                            100%   55KB  17.6MB/s   00:00
nginx-1.16.1-3.el7.x86_64.rpm                                                             100%  563KB  31.4MB/s   00:00
nginx-all-modules-1.16.1-3.el7.noarch.rpm                                                 100%   20KB   8.2MB/s   00:00
nginx-filesystem-1.16.1-3.el7.noarch.rpm                                                  100%   21KB   9.0MB/s   00:00
nginx-mod-http-image-filter-1.16.1-3.el7.x86_64.rpm                                       100%   30KB  12.0MB/s   00:00
nginx-mod-http-perl-1.16.1-3.el7.x86_64.rpm                                               100%   39KB  14.3MB/s   00:00
nginx-mod-http-xslt-filter-1.16.1-3.el7.x86_64.rpm                                        100%   29KB  11.9MB/s   00:00
nginx-mod-mail-1.16.1-3.el7.x86_64.rpm                                                    100%   57KB  16.6MB/s   00:00
nginx-mod-stream-1.16.1-3.el7.x86_64.rpm                                                  100%   85KB  18.1MB/s   00:00
openssl11-libs-1.1.1g-2.el7.x86_64.rpm                                                    100% 1485KB  40.6MB/s   00:00
123456789101112131415

7.进入离线服务器安装

[root@localhost /]# cd /rpm
[root@localhost rpm]# rpm -ivh * --nodeps --force
警告:nginx-1.16.1-3.el7.x86_64.rpm: 头V4 RSA/SHA256 Signature, 密钥 ID 352c64e5: NOKEY
准备中...                          ################################# [100%]
正在升级/安装...
   1:openssl11-libs-1:1.1.1g-2.el7    ################################# [  8%]
   2:nginx-filesystem-1:1.16.1-3.el7  ################################# [ 15%]
   3:libXpm-3.5.12-1.el7              ################################# [ 23%]
   4:gd-2.0.35-27.el7_9               ################################# [ 31%]
   5:gperftools-libs-2.6.1-1.el7      ################################# [ 38%]
   6:centos-indexhtml-7-9.el7.centos  ################################# [ 46%]
   7:nginx-mod-http-image-filter-1:1.1################################# [ 54%]
   8:nginx-mod-http-perl-1:1.16.1-3.el################################# [ 62%]
   9:nginx-mod-http-xslt-filter-1:1.16################################# [ 69%]
  10:nginx-mod-mail-1:1.16.1-3.el7    ################################# [ 77%]
  11:nginx-all-modules-1:1.16.1-3.el7 ################################# [ 85%]
  12:nginx-1:1.16.1-3.el7             ################################# [ 92%]
  13:nginx-mod-stream-1:1.16.1-3.el7  ################################# [100%]

12345678910111213141516171819

8.启动nginx服务

[root@localhost rpm]# systemctl start nginx
[root@localhost rpm]# systemctl status nginx
● nginx.service - The nginx HTTP and reverse proxy server
   Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; vendor preset: disabled)
   Active: active (running) since 四 2021-01-21 15:24:46 CST; 5s ago
  Process: 127308 ExecStart=/usr/sbin/nginx (code=exited, status=0/SUCCESS)
  Process: 127303 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=0/SUCCESS)
  Process: 127300 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)
 Main PID: 127318 (nginx)
    Tasks: 7
   Memory: 7.8M
   CGroup: /system.slice/nginx.service
           ├─127318 nginx: master process /usr/sbin/nginx
           ├─127319 nginx: worker process
           ├─127320 nginx: worker process
           ├─127322 nginx: worker process
           ├─127323 nginx: worker process
           ├─127324 nginx: worker process
           └─127325 nginx: worker process

1月 21 15:24:46 vrgv systemd[1]: Starting The nginx HTTP and reverse proxy server...
1月 21 15:24:46 vrgv nginx[127303]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
1月 21 15:24:46 vrgv nginx[127303]: nginx: configuration file /etc/nginx/nginx.conf test is successful
1月 21 15:24:46 vrgv systemd[1]: Started The nginx HTTP and reverse proxy server.

完成


如果有帮助,点个关注吧,还有更多运维技巧分享给您~

相关推荐

Let’s Encrypt免费搭建HTTPS网站

HTTPS(全称:HyperTextTransferProtocoloverSecureSocketLayer),是以安全为目标的HTTP通道,简单讲是HTTP的安全版。即HTTP下加入...

使用Nginx配置TCP负载均衡(nginx tcp负载)

假设Kubernetes集群已经配置好,我们将基于CentOS为Nginx创建一个虚拟机。以下是实验种设置的详细信息:Nginx(CenOS8Minimal)-192.168.1.50Kube...

Nginx负载均衡及支持HTTPS与申请免费SSL证书

背景有两台minio文件服务器已做好集群配置,一台是192.168.56.41:9000;另一台是192.168.56.42:9000。应用程序通过Nginx负载均衡调用这两台minio服务,减轻单点...

HTTPS配置实战(https配置文件)

原因现在网站使用HTTPS是规范操作之一,前些日子买了腾讯云服务,同时申请了域名http://www.asap2me.top/,目前该域名只支持HTTP,想升级为HTTPS。关于HTTPS的链接过程大...

只有IP地址没有域名实现HTTPS访问方法

一般来说,要实现HTTPS,得有个注册好的域名才行。但有时候呢,咱只有服务器的IP地址,没注册域名,这种特殊情况下,也能照样实现HTTPS安全访问,按下面这些步骤来就行:第一步,先确认公网...

超详解:HTTPS及配置Django+HTTPS开发环境

众所周知HTTP协议是以TCP协议为基石诞生的一个用于传输Web内容的一个网络协议,在“网络分层模型”中属于“应用层协议”的一种。在这里我们并不研究该协议标准本身,而是从安全角度去探究使用该协议传输数...

Godaddy购买SSL之后Nginx配置流程以及各种错误的解决

完整流程:参考地址:https://sg.godaddy.com/zh/help/nginx-generate-csrs-certificate-signing-requests-3601生成NGI...

Nginx从安装到高可用,一篇搞定(nginx安装与配置详解)

一、Nginx安装1、去官网http://nginx.org/下载对应的nginx包,推荐使用稳定版本2、上传nginx到linux系统3、安装依赖环境(1)安装gcc环境yuminstallgc...

阿里云免费证书申请,配置安装,使用tomcat,支持http/https访问

参数说明商品类型默认已选择云盾证书服务(无需修改)。云盾证书服务类型SSL证书服务的类型。默认已选择云盾SSL证书(无需修改),表示付费版SSL证书。如果您需要免费领取或付费扩容DV单域名证书【免费试...

你试过两步实现Nginx的规范配置吗?极速生成Nginx配置小工具

NGINX是一款轻量级的Web服务器,最强大的功能之一是能够有效地提供HTML和媒体文件等静态内容。NGINX使用异步事件驱动模型,在负载下提供可预测的性能。是当下最受欢迎的高性能的Web...

从零开始搭建HTTPS服务(搭建https网站)

搭建HTTPS服务的最初目的是为了开发微信小程序,因为wx.request只允许发起HTTPS请求,并且还必须和指定的域名进行网络通信。要从零开始搭建一个HTTPS的服务需要下面4...

群晖NAS使用官网域名和自己的域名配置SSL实现HTTPS访问

安全第一步,群晖NAS使用官网域名和自己的域名配置SSL实现HTTPS访问【新手导向】NAS本质还是一个可以随时随地访问的个人数据存储中心,我们在外网访问的时候,特别是在公网IP下,其实会面临着很多安...

让网站快速升级HTTPS协议提高安全性

为什么用HTTPS网络安全越来越受到重视,很多互联网服务网站,都已经升级改造为https协议。https协议下数据包是ssl/tcl加密的,而http包是明文传输。如果请求一旦被拦截,数据就会泄露产生...

用Https方式访问Harbor-1.9版本(https访问流程)

我上周在头条号写过一篇原创文章《Docker-Harbor&Docker-kitematic史上最详细双系统配置手册》,这篇算是它的姊妹篇吧。这篇文章也将用到我在头条写的另一篇原创文章的...

如何启用 HTTPS 并配置免费的 SSL 证书

在Linux服务器上启用HTTPS并配置免费的SSL证书(以Let'sEncrypt为例)可以通过以下步骤完成:---###**一、准备工作**1.**确保域名已解析**...

取消回复欢迎 发表评论: