频道栏目
首页 > 资讯 > 其他 > 正文

ubuntu下编译安装nginx-丿十年-51CTO博客

20-05-14        来源:[db:作者]  
收藏   我要投稿
ubuntu下编译安装nginx

1.安装编译需要用到的库和工具

        apt-get install build-essential libtool gcc automake autoconf make

2.安装pcre,支持重写rewrite功能

        源码下载地址:https://ftp.pcre.org/pub/pcre/
        wget https://ftp.pcre.org/pub/pcre/pcre-8.40.tar.gz 
        tar -zxvf pcre-8.40.tar.gz
        cd pcre-8.40.tar.gz
        ./configure 
        make && make install

3.安装zlib, 支持gzip压缩

        源码下载地址:http://zlib.net
        wget http://zlib.net/zlib-1.2.11.tar.gz
        tar -zxvf zlib-1.2.11.tar.gz
        cd zlib-1.2.11
        ./configure
        make && make install

4.安装ssl

        源码地址:https://www.openssl.org/source/
        wget https://www.openssl.org/source/openssl-1.0.2o.tar.gz
        tar -zxvf openssl-1.0.2o.tar.gz
        cd openssl-1.0.2o
        ./config
        make && make install

5、安装Nginx:

        源码地址:http://nginx.org/en/download.html
        wget http://nginx.org/download/nginx-1.13.12.tar.gz
        tar -zxvf nginx-1.13.12.tar.gz
        cd nginx-1.13.12.tar.gz
        ./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module

预编译:

        ./configure --sbin-path=/usr/local/nginx/nginx \
        --conf-path=/usr/local/nginx/nginx.conf \
        --pid-path=/usr/local/nginx/nginx.pid \
        --with-http_ssl_module \
        --with-pcre=/usr/local/src/pcre-8.40 \
        --with-zlib=/usr/local/src/zlib-1.2.11 \
        --with-openssl=/usr/local/src/openssl-1.0.2o

编译安装:

        make && make install

安装完成:启动目录:

        /usr/local/nginx/sbin/nginx -s reload 
            查看是否运行:
        ps-ef|grep nginx 
相关TAG标签
上一篇:一、Linux初识-12926780-51CTO博客
下一篇:MPO/MTP——数据中心布线的游戏变革者-wx5e7ad281a1001的博客-51CTO博客
相关文章
图文推荐

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训 | 举报中心

版权所有: 红黑联盟--致力于做实用的IT技术学习网站