mac 安装 openresty

1.环境homebrew 1.3.1

在hombrew 默认路径为 /usr/local/opt

1.step

brew update

2.step

brew install pcre openssl

3.step

brew install homebrew/nginx/openresty

4.step

brew tap homebrew/nginx

5.step

brew install homebrew/nginx/openresty

6.step

PATH=/usr/local/opt/openresty/nginx/sbin:$PATH

7.step

export PATH

Hello world

mkdir ~/work
cd ~/work
mkdir logs/ conf/

创建配置文件

worker_processes  1;        #nginx worker 数量
error_log logs/error.log;   #指定错误日志文件路径
events {
    worker_connections 1024;
}

http {
    server {
        listen 6767;
        location / {
            default_type text/html;
            content_by_lua {
                ngx.say("HelloWorld")
            }
        }
    }
}
nginx -p `pwd`/ -c conf/nginx.conf
curl  127.0.0.1:6767
hello world

你可能感兴趣的:(mac 安装 openresty)