CentOS7离线环境编译安装Nginx

安装pcre

[root@nginx nginx]# rpm -ivh pcre-8.32-17.el7.x86_64.rpm --nodeps
[root@nginx nginx]# rpm -ivh pcre-devel-8.32-17.el7.x86_64.rpm --nodeps

安装zlib

[root@nginx nginx]# rpm -ivh zlib-1.2.7-18.el7.x86_64.rpm  --nodeps
[root@nginx nginx]# rpm -ivh zlib-devel-1.2.7-18.el7.x86_64.rpm --nodeps

安装nginx

[root@nginx nginx]# tar -xzvf nginx-1.17.8.tar.gz
[root@nginx nginx]# mv nginx-1.17.8 /usr/local/  # 移动源代码到对应目录下
[root@nginx nginx]# cd /usr/local/nginx-1.17.8/
[root@nginx nginx-1.17.8]# ./configure #编译
[root@nginx nginx-1.17.8]# make install #安装
[root@nginx nginx-1.17.8]# cd /usr/local/nginx/sbin 
[root@nginx nginx-1.17.8]# ./nginx #运行nginx
[root@nginx sbin]# /usr/local/nginx/sbin/nginx -t #检查是否安装正确
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
[root@nginx sbin]# ps -ef | grep nginx
root       5083      1  0 12:57 ?        00:00:00 nginx: master process ./nginx
nobody     5084   5083  0 12:57 ?        00:00:00 nginx: worker process
root       5087   2492  0 12:58 pts/0    00:00:00 grep --color=auto nginx

CSDN资源下载

发布了64 篇原创文章 · 获赞 2 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/weixin_46192300/article/details/104590083