`
stephen830
  • 浏览: 2964993 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

mac 上安装nginx

 
阅读更多

 

由于会用到gcc编译,本机已经装过xcode,因此已经有了gcc。

检测是否装过gcc:  gcc -v

 

 

1. 安装PCRE

 

下载最新的 PCRE. ,是perl类库,这是用于nginx的rewrite规则解析。

pcre-8.34.tar

解压后

cd ~

cd pcre-8.34

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

sudo make

sudo make install

 

2. 安装nginx

下载最新的 nginx 从网站 Nginx.org

nginx-1.5.8.tar

解压后

cd ~

cd nginx-1.5.8

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

sudo make

sudo make install

 

至此,nginx已经安装完毕,下面启动验证下。

 

启动nginx

cd /usr/local/sbin

sudo ./nginx

 

打开浏览器访问 http://localhost

 

关闭nginx

 

sudo ./nginx -s stop

 

 

 

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics