源码包管理

源码包管理


1. 下载源码包
[root@qls ~]# wget  http://nginx.org/download/nginx-1.18.0.tar.gz

[root@qls ~]# ll
total 1016
-rw-r--r-- 1 root root 1039530 Apr 21 22:33 nginx-1.18.0.tar.gz

2. 解压软件包 
[root@qls ~]# tar  xf  nginx-1.18.0.tar.gz 
[root@qls ~]# ll
total 1016
drwxr-xr-x 8 user05 1001     158 Apr 21 22:09 nginx-1.18.0
-rw-r--r-- 1 root   root 1039530 Apr 21 22:33 nginx-1.18.0.tar.gz


3. 进入这个目录,进行预编译操作   编译设置  
[root@qls nginx-1.18.0]# ./configure   --prefix=/opt/nginx-1.18.0   --with-http_ssl_module
checking for OS
 + Linux 3.10.0-957.el7.x86_64 x86_64
checking for C compiler ... not found

./configure: error: C compiler cc is not found		#报错   缺少编译软件 gcc



#安装依赖
[root@qls nginx-1.18.0]# yum install  -y  gcc



#再次执行报错 
./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.


#解决:
[root@qls nginx-1.18.0]# yum install  -y  pcre  pcre-devel 


#再次执行报错
./configure: error: SSL modules require the OpenSSL library.
You can either do not enable the modules, or install the OpenSSL library
into the system, or build the OpenSSL library statically from the source
with nginx by using --with-openssl=<path> option.


#解决:
[root@qls nginx-1.18.0]# yum  install  -y  openssl  openssl-devel


4. 编译
[root@qls nginx-1.18.0]# make


5. 将编译的结果拷贝到指定的位置 
[root@qls nginx-1.18.0]# make  install


[root@qls nginx-1.18.0]# ll /opt/
drwxr-xr-x 6 root root   54 Jul 31 16:54 nginx-1.18.0


6. 做个软链接
[root@qls ~]# ln -s  /opt/nginx-1.18.0/  /opt/nginx


7. 启动 
[root@qls ~]# /opt/nginx/sbin/nginx 


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值