一切福田,不離方寸,從心而覓,感無不通。

在Mac上安装Nginx

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 install

 

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

 

3. 运行Nginx

$ cd /usr/local/sbin

$ sudo ./nginx

访问http://localhost

 

4. 关闭Nginx

$ cd /usr/local/sbin

$ sudo ./nginx -s stop

 

from:http://stevendu.iteye.com/blog/1535466