星空网 > 软件开发 > ASP.net

ubuntu15.10_x64 安装 nginx

 

浏览器到 http://nginx.org/en/download.html

下载 stable version的nginx 如nginx-1.10.1.tar.gz,这是一个nginx源码包,需要经过编译和安装才能使用。

解压命令: tar –zxvf  nginx-1.10.1.tar.gz

cd nginx解压后的源码目录 :  ./configure 命令
 

   问题一:gcc和gcc++ 编译器未安装

   ./configure: error:    C compiler cc is not found
   解决:安装gc++
    sudo apt-get install gcc
    sudo apt-get install gcc++

   
    问题二: http模块缺少prce正则表达式库
    ./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.
    解决:安装pcre库

    sudo apt-get install libpcre3 libpcre3-dev

 

   问题三: http gzip 模块缺少  zlib库
    ./configure: error: the HTTP gzip module requires the zlib library.
    You can either disable the module by using --without-http_gzip_module
    option, or install the zlib library into the system, or build the zlib library
    statically from the source with nginx by using --with-zlib=<path> option.
    解决:安装zlib库

    $ sudo apt-get install zlib1g
    $ sudo apt-get install zlib1g.dev

 

再次:./configure

编译 make

安装 make install

 

进入nginx安装目录

cd /usr/local/

ls  可以看到nginx,则代表nginx在ubuntu上安装成功了

进入  cd /usr/local/nginx/sbin

sudo ./nginx  启动nginx

 

若nginx没有启动成功,很可能是80端口被占用了(ubuntu15默认安装了apache2),更换一下端口即可(编辑conf/nginx.conf文件  80改为81)

http://localhost

 

 

引申:《nginx 在ubuntu 上的启动,停止,重启》




原标题:ubuntu15.10_x64 安装 nginx

关键词:ubuntu

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

亚马逊广告怎么优化,这8条准则要牢记!:https://www.ikjzd.com/articles/129500
Amazon如何做推广:https://www.ikjzd.com/articles/129501
提升亚马逊广告表现的7个技巧:https://www.ikjzd.com/articles/129503
旺季选品思路,旺季爆单抄近路!:https://www.ikjzd.com/articles/129504
受裁员和收入下降影响,英国将经历最差圣诞销售季?:https://www.ikjzd.com/articles/129506
解析|亚马逊卖家如何申请操作站内Deal?:https://www.ikjzd.com/articles/129507
十月北方旅游最佳去处?:https://www.vstour.cn/a/365184.html
缅甸电子签证口岸 缅甸电子签证在线申请:https://www.vstour.cn/a/365185.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流