如何在没有网络连接的CentOs7上以root权限安装Nginx?
我需要在没有互联网连接的目标上安装 Nginx,如何在离线模式下安装具有所有依赖项的 Nginx?预先感谢您的回答。
I need to install Nginx on my target which there is no internet connection, how can I install Nginx with all dependencies in an offline mode?? thanks in advance for your answers.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我最近经历了这个过程,这就是我在 centos7 上的工作:
你需要一个在线 Linux 服务器来下载依赖项。您可以使用虚拟机或其他任何东西。
在您的在线服务器上创建一个 .sh 文件并将下面的脚本复制到其中。 (我将其命名为 download_dependency)
然后在包含 download_dependency.sh 的同一目录中运行下面的命令:
在我的例子中,我运行了下面的代码(将其留空以查看选项):
它应该开始下载,完成后您应该看到 nms -dependency-rhel7.tar.gz 在您的目录中。
将该文件(.tar.gz)复制到您的离线目标。
现在在您的目标计算机上,转到复制文件的目录并运行以下代码:
安装后,您可以使用 systemctl 启动 nginx:
您的 nginx 服务现在必须正在运行!
I have recently gone through this procedure and this is what worked for me on centos7:
You need an online Linux server to download dependencies. You can use virtual machines or anything else.
On your online server create a .sh file and copy script below in it. (I named it download_dependencies)
Then on the same directory that contains download_dependencies.sh run command below:
In my case, I ran code below (leave it blank to see options):
It should start to download and when it finished you should see nms-dependencies-rhel7.tar.gz in your directory.
Copy that file(.tar.gz) to your offline target.
Now on your target machine, go to directory which you copied your file and run the code below:
After installation you can start nginx using systemctl:
Your nginx service must be running now!
您可以在另一个系统中下载 tar 文件并复制
您尝试过此链接吗?
https://gist.github.com/taufiqibrahim/d7f697de6bb8b93ca348a5b94d6adbfc
you can download tar file in another system and copy
did you try this link?
https://gist.github.com/taufiqibrahim/d7f697de6bb8b93ca348a5b94d6adbfc