macbook lion 安装nginx

1. 下载安装PCRE:

下载地址:http://sourceforge.net/projects/pcre/files/pcre/8.20/pcre-8.20.tar.gz/download

tar xvzf pcre-8.20.tar.gz
rm pcre-8.20.tar.gz
cd pcre-8.20
./configure --prefix=/usr/local
make
sudo make install
cd ..

2. 下载安装nginx

curl  http://nginx.org/download/nginx-1.1.2.tar.gz > nginx-1.1.2.tar.gz
tar xvzf nginx-1.1.2.tar.gz
cd nginx-1.1.2
./configure --prefix=/usr/local --with-http_ssl_module --with-cc-opt="-Wno-deprecated-declarations"
make
sudo make install

3.添加nginx to your path:

export PATH=/usr/local/nginx/sbin:$PATH

4. 运行Nginx

sudo nginx

配置文件位置:

vi /usr/local/nginx/conf/nginx.conf

发表评论

电子邮件地址不会被公开。 必填项已用*标注