在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
?
?
参考:
Install Nginx on Mac OS X 10.6.7
1.1.14 compilation fails on Mac OS X 10.7.2