ubuntu16.04编译自己的nginx服务器

1.下载nginx

nginx官网:nginx.org

 

tar.gz文件 解压缩命令:

tar -xzf nginx-1.14.2.tar.gz

 

2.编译nginx

./configure --preifx=/home/zopen/nginx      /home/zopen/nginx改为自己指定的位置

 

注意: 执行后会提示:error: the HTTP rewrite module requires the PCRE library

解决办法:需要安装pcre包

sudo apt-get update
sudo apt-get install libpcre3 libpcre3-dev

 

重新运行编译指令

./configure --preifx=/home/zopen/nginx      /home/zopen/nginx改为自己指定的位置

make install

 安装完成。

在/home/zopen/nginx/sbin目录下执行./nginx,开启nginx服务器,如下图所示: 

猜你喜欢

转载自www.cnblogs.com/zkfopen/p/10118627.html
今日推荐