欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

Ubuntu 1610下源码安装nginx的步骤 ubuntu15.04 linux ubuntu 16.04

程序员文章站 2022-05-01 11:01:55
...

1. 下载源码:

$ cd /usr/downloads
$ wget -c http://nginx.org/download/nginx-1.8.1.tar.gz
$ tar -xvf nginx-1.8.1.tar.gz
$ cd nginx-1.8.1

2. 安装依赖:pcre

1) 首次尝试安装
$ cd ..
$ wget -c ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre2-10.21.tar.gz
$ tar -xvf pcre2-10.21.tar.gz
$ ./configure
$ make & make install
$ pcre2grep --help
> "error while loading shared libraries: libpcre8.so.0 cannot find"
$ ls /usr/local/lib            #查看是否存在该so文件
$ sudo /sbin/ldconfig -v   #更新共享库文件的索引
2) 再次执行检查:
$ ./configure --with-pcre=/usr/software/pcre2-10.21     #ok
$ sudo make
> pcre.h 文件找不到
$ sudo ../pcre2-10.21/configure
## 发现 nginx 中引用的是 pcre.h,而pcre2-10.21释放的是pcre2.h, 好吧,被自己不认真给坑了
3) 切换 pcre 版本:
$ wget -c ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.38.zip
$ unzip pcre-8.38.zip
$ cd pcre-8.38
$ sudo ./configure
$ sudo make & make install

3. 安装nginx

$ cd ../nginx-1.8.1
$ sudo ./configure
$ sudo make & make install
# 一切ok

4. 配置

* 未完待续 *

').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

以上就介绍了Ubuntu 1610下源码安装nginx的步骤,包括了ubuntu方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

相关标签: ubuntu