nginx 免安装包

来源:互联网 发布:idc网站php源码 编辑:程序博客网 时间:2024/05/19 22:49

在一个环境下编译安装好nginx,然后可以拷贝到其他环境使用。同时避免直接安装造成的环境冲突。

首先下载好nginx和相关插件。然后编译安装到沙盒里面。demo如下:

cd到nginx目录

./configure  --prefix=/home/aplus/nginx  --sbin-path=/home/aplus/nginx/sbin/nginx --conf-path=/home/aplus/nginx/conf/nginx.conf --error-log-path=/home/aplus/nginx/logs/error.log --pid-path=/home/aplus/nginx/logs/nginx.pid --add-module=/home/aplus/nginx/nginx-upload-module-2.2m
make
make install

然后打包 –prefix对应的目录,即可

tar -zcvf nginx.tar.gz /data/soft/nginx

ps: 之前需要安装pcre相关包

原创粉丝点击