linux 非root用户安装nginx

摘要:
解压缩[bdctool@localhostsetup]$tar-zxvfnginx1.12.2.tar.gz[bdctool@localhostsetup ]$ ./ configure--with-http_studb_status_Module--prefix=/opt/aspire/product/bdctol/nginx报告错误/configure:

第一步:首先下载依赖包

下载地址 pcre(www.pcre.org),zlib(www.zlib.org),openssl(www.openssl.org)

第二步:上传那个nginx的安装包

下载nginx安装包,解压

[bdctool@localhost setup]$ tar  -zxvf nginx-1.12.2.tar.gz

[bdctool@localhost setup]$ ./configure  --with-http_stub_status_module --prefix=/opt/aspire/product/bdctool/nginx  

 报错

./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.

3、还是安装一下pcre吧

[bdctool@localhost setup]$ unzip  pcre-8.10.zip

[bdctool@localhost setup]$ cd  pcre-8.10

[bdctool@localhost pcre-8.10]$ ./configure    --prefix=/opt/aspire/product/bdctool/nginx/zzw_other/pcre-8.10 (自定义目录)

[bdctool@localhost pcre-8.10]$ make

[bdctool@localhost pcre-8.10]$ make install

4、再来安装nginx,首先./configure(这里是个坑,可以不操作,继续往下看--转载注)

 [bdctool@localhost nginx-1.12.2]$./configure  --with-http_stub_status_module  --prefix=/opt/aspire/product/bdctool/nginx  --with-pcre=/opt/aspire/product/bdctool/nginx/zzw_other/pcre-8.10

注意:上面命令--prefix=路径为nginx想要安装到的目录, --with-pcre=路径为pcre安装到的目录。

5、修改 --with-pcre=后的路径为pcre的解压后的源路径,重新./configure 

 [bdctool@localhost nginx-1.12.2]$./configure  --with-http_stub_status_module  --prefix=/opt/aspire/product/bdctool/nginx  --with-pcre=/opt/aspire/product/bdctool/setup/pcre-8.10(注意这个是pcre的源码路径

原文路径:https://blog.csdn.net/lzs_xiaoze/article/details/85632144

6,执行make 命令

7,执行make install 命令来着

免责声明:文章转载自《linux 非root用户安装nginx》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇day 08 awk sed作业json前后台传值下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

Nginx Upstream模块源码分析(上)

Upstream模块是一个很重要的模块,很多其他模块都会使用它来完成对后端服务器的访问, 达到反向代理和负载均衡的效果。例如Fastcgi、Memcached、SessionSticky等。 如果自己实现这部分功能,采用传统的实现方式,很可能会阻塞Nginx降低其性能,因为Nginx是全异步非阻塞的。 所以要想不破坏其优美的架构,就得按照其规范实现很...

Nginx作为静态web服务器——缓存原理

浏览器缓存 ​ 客户端无缓存的情况下 ​ 客户端有缓存的情况下 ​ 校验过期机制 ​ 本地客户端会检查Cache-Control(max-age)缓存是否过期,(max-age)为过期时间 Last-Modified 上次修改时间 配合If-Modified-Since或者If-Unmodified-Since使用 对比上次修改时间验证资源是否需要更...

使用kubeadm部署K8S v1.17.0集群

环境信息 操作系统:CentOS Linux release 7.7.1908 (Core) docker:19.03.8 kubernetes:v1.17.0 集群信息 hostname IP k8s-master 192.168.87.10 k8s-node01 192.168.87.11 一、准备工作(所有节点执行) 1.1、...

详解封装源码包成RPM包

源码编译安装是最常用安装软件方式,可是面对工作量巨大时候就需要我们的RPM包上场了,统一的模块,一键安装。在面对一定数量的服务器上,RPM就可以为我们节省大量的时间。 RPM可以在网上下载,但是当我们需要用到特殊模块时,这些网上的RPM就显得那么的苍白无力了。所以自行封装打包成了一和需求。现在就介绍如何封装打包。 打包流程 1)准备源码软件 2)安装r...

四十二、LAMP与LNMP web架构深度优化实战-第一部

1.nginx.conf配置文件基本参数优化 1.1 隐藏nginx header内版本号信息 一些特定的系统及服务漏洞一般都和特定的软件版本号有关,我们应尽量隐藏服务器的敏感信息(软件名称及版本等信息),这样黑客无法猜到有漏洞的服务是否是对应服务的版本,从而确保web服务最大的安全。 [root@djw1 ~]# curl -I 192.168.0.10...

nginx 及 tomcat 端口冲突问题

nginx 监听 80 转发 8088 tomcat 原先通过80 及 8088 都能访问,区别是 80就走nginx转发,8088则直接走tomcat 证据为: 80端口,nginx强行过滤掉css和js后,页面出来无样式和响应,而走8088的话,直接走tomcat,页面完整 再回到主题:原先80及8088都能访问,突然就不能访问了,百思不得其解,最后...