首页 > 系统服务 > 详细

linux 非root用户安装nginx

时间:2019-12-11 15:48:45      阅读:576      评论:0      收藏:0      [点我收藏+]

第一步:首先下载依赖包

下载地址 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

原文:https://www.cnblogs.com/Hackerman/p/12022596.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!