首页 > 系统相关 >centos7离线安装nginx ssl

centos7离线安装nginx ssl

时间:2023-03-17 18:57:51浏览次数:42  
标签:nginx -- 离线 module Perl centos7 ssl perl 安装包

1 将nginx的安装包上传到服务器的/home/software目录

然后输入命令 tar -zxvf nginx-1.21.5.tar.gz 命令将其解压
输入命令 mkdir -p /usr/local/nginx 创建nginx的安装目录
输入 cd nginx-1.21.5/ 进入nginx的解压目录

然后运行./configure --prefix=/usr/local/nginx --with-http_ssl_module命令
如果报错

./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=<path> option.

  

则是缺少openssl

安装openssl

 下载OpenSSL源代码 首先,您需要从OpenSSL官方网站(https://www.openssl.org/)下载最新的OpenSSL源代码,并将其解压缩到您想要安装Nginx的目录中。

 

然后执行: ./configure --with-http_ssl_module --with-openssl=/home/software/openssl-3.1.0 

make
make install

执行make的时候有可能出错

 

原因是没有perl环境,执行命令 perl -v 查看是否有perl环境
离线安装perl
下载 Perl 安装包

首先,您需要从 Perl 官方网站(https://www.perl.org/)下载 Perl 的安装包,并将其复制到目标计算机上。

注意:请确保您下载的安装包与您的操作系统和架构相对应。

解压 Perl 安装包

解压缩 Perl 安装包到您选择的目录中(我上传到/home/software目录),例如:

./Configure -des -Dprefix=/path/to/perl
make
make test
make install

注意:将“/path/to/perl”替换为您想要安装 Perl 的目录。

 

配置 PATH 环境变量

添加 Perl 的二进制文件路径到系统的 PATH 环境变量中。您可以在您的 shell 配置文件(例如“~/.bashrc”)中添加以下行:

export PATH=/path/to/perl/bin:$PATH
然后,运行以下命令使更改生效:
source ~/.bashrc
确认 Perl 已成功安装并可用:
perl -v

 

然后就可以继续执行nginx的安装步骤了

然后运行./configure --prefix=/usr/local/nginx --with-http_ssl_module命令
然后分别运行
make
make install
nginx启动命令/usr/local/nginx/sbin/nginx
nginx停止命令/usr/local/nginx/sbin/nginx -s stop

 

标签:nginx,--,离线,module,Perl,centos7,ssl,perl,安装包
From: https://www.cnblogs.com/james-roger/p/17227847.html

相关文章

  • centos7 关闭swap分区
    关闭swap分区swapoff-ased-ri's/.*swap.*/#&/'/etc/fstab修改后,通过free-m命令查看结果:$free-mtotalusedfreeshared......
  • Docker安装Centos7
    dockerrun-itd--namecentos22024-p22021:21-p22022:22-p22024:23-p22025:25-p22080:80-p27000:7000-p27001:7001-p27002:7002-p27003:7003-p27004......
  • sipp3.6 on centos7安装部署
      概述在VOIP软交换的开发过程中,必然需要对软交换进行批量压测。SIP压测工具一般都是sipp,免费,开源,功能足够强大,配置灵活,优点多。环境centos7.9cmake3.6sippv3.......
  • centos7分区扩容(新增盘)
    新增⼀块60G硬盘,根分区及data分区各增加30G空间⼀、初始⼤⼩[root@localhost~]#df-ThFilesystemTypeSizeUsedAvailUse%Mountedondev......
  • Linux安装python3 Centos7
    Linux安装python3Linux自带python2环境,以下是python3的安装步骤一、python3安装包下载地址:https://www.python.org/downloads/release/python-380/也可以使用wget命令下......
  • NGINX配置SSL支持
    前言在文章-腾讯云申请免费SSL证书中,我们已经申请好了SSL证书.那么现在,我们就要配置全站SSL了!......
  • Centos7系统在开启进入系统报错:Give root password for maintenance(or type Control-D
    报错信息:在进入系统时,不能正常进入系统,出现了Giverootpasswordformaintenance(ortypeControl-Dtocontinue):的报错。 报错原因:1、在之前写入的/etc/fstab文件有......
  • centos7 最小化安装ifconfig不可用,无法上网
    原因:在虚拟机中以最小化方式安装centos7,后无法上网,因为centos7默认网卡未激活;而且在sbin目录中没有ifconfig文件,这是因为centos7已经不使用ifconfig命令了,已......
  • 爬虫相关 requests高级用法、解析json、ssl认证(了解)、使用代理(重要)、超时设置、
    requests高级用法解析json#发送http请求,返回的数据会有xml格式,也有json格式importrequestsdata={'cname':'','pid':'','keyword':'500','page......
  • 安装Centos7初始化操作系统
    设置静态网络1、设置静态网络,一是用来不让地址飘忽不定,二来是为了访问外网。命令如下:[root@localhost~]#vim/etc/sysconfig/network-scripts/ifcfg-ens33修改内容......