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

  • 相关阅读:
    解决Linux中java.net.UnknownHostException: oracledb.sys.iflashbuy.com问题
    Jenkins学习九:Jenkins插件之构建MSBuild
    Fitnesse初体验
    Jenkins遇到问题三:调整jdk版本不生效的解决办法
    linux强制用户下线
    Jenkins学习八:Jenkins语言本地化
    一个完整的JENKINS下的ANT BUILD.XML文件
    -bash: rz: command not found
    Jenkins学习七:Jenkins的授权和访问控制
    Android ormlite like() function is not working
  • 原文地址:https://www.cnblogs.com/sonofelice/p/5030886.html
Copyright © 2011-2022 走看看