zoukankan      html  css  js  c++  java
  • mac下安装nginx问题解决

    需要在mac上安装nginx,按照下面的博客链接一步步安装,但是碰到了些问题。下面写一下我的解决方式。

    (http://stevendu.iteye.com/blog/1535466)

    1. 安装PCRE 

    Download latest PCRE. After download go to download directory from terminal. 

    $ cd ~/Download $ tar xvzf pcre-8.12.tar.gz 

    $ cd pcre-8.12 

    $ sudo ./configure --prefix=/usr/local 

    $ sudo make

    $ sudo make  install

    -------------------------------------------------------------我是华丽的分割线----------------------------------------------------------------

    上面可能不会报错或者有什么异常,不过你可以先去目录/usr看下有没有local目录,如果没有这个目录,那就自己建一个local目录,按照上面的步骤操作一遍

    -------------------------------------------------------------我是华丽的分割线----------------------------------------------------------------

    2. 安装Nginx 

    Download latest nginx from Nginx.org. After download, let install 

    $ cd ~/Download $ tar xvzf nginx-1.0.0.tar.gz 

    $ cd nginx-1.0.0

    $ sudo ./configure --prefix=/usr/local --with-http_ssl_module --with-ld-opt="-L /usr/local/lib"

    $ sudo make

    $ sudo make install

    报错了呢,错误如下:

    ./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.

    那我就按照错误的提示,使用选项--without-http_rewrite_module试试:

    $ sudo ./configure --prefix=/usr/local --with-http_ssl_module --with-ld-opt="-L /usr/local/lib" --without-http_rewrite_module

    成功了!!! 

    3. 运行Nginx

    $ cd /usr/local/sbin

    $ sudo ./nginx

    访问http://localhost

    (第一次访问http://localhost可能会失败,那么重启一下你的nginx,再访问试试呢)

    成功的页面:

     

    4. 关闭Nginx

    $ cd /usr/local/sbin

    $ sudo ./nginx -s stop

  • 相关阅读:
    mysql-5-aggregation
    mysql-4-functions
    mysql-3-orderby
    技术之心 | 云信和TA们携手打响防疫战
    疫情下的传统商企自救|4个Tips搭建销量过亿直播间
    那些2019年会爆发的泛娱乐黑科技风口
    流量难、获客难、增长难?增长黑客思维“解救”B端业务
    【翻译】Facebook全面推出Watch Party,可多人线上同看直播视频
    深入浅出聊一聊Docker
    C++写日志方法调试
  • 原文地址:https://www.cnblogs.com/sonofelice/p/5030886.html
Copyright © 2011-2022 走看看