不灭的焱

革命尚未成功,同志仍须努力下载JDK17

作者:Albert.Wen  添加时间:2021-09-21 00:21:12  修改时间:2024-04-19 02:08:22  分类:电脑/软件使用  编辑
启动OpenResty
openresty
关闭OpenResty
openresty -s stop
重启OpenResty
openresty -s reload
Nginx配置文件
# 增加了虚拟网站配置引入代码:include  vhost/*.conf;
vim /usr/local/etc/openresty/nginx.conf
cd /usr/local/etc/openresty/vhost

干脆做一个软连接:

ln -s /usr/local/etc/openresty/vhost  /Users/wenjianbao/

本地上传文件(upload)目录,也做个 软连接:

ln -s /Users/wenjianbao/www/upload/  /usr/local/Cellar/openresty/1.19.9.1_2/nginx/html/upload
Nginx路径
/usr/local/Cellar/openresty/1.19.9.1_2/nginx
默认网站路径
cd /usr/local/Cellar/openresty/1.19.9.1_2/nginx/html
错误日志文件
/usr/local/var/log/nginx/error.log

 

进入官网,提示:OpenResty 1.19.9.1已发布。

1、brew模式安装

brew tap openresty/brew
brew install openresty

2、实际安装路径:

/usr/local/Cellar/openresty/1.19.9.1_2

3、查看版本号:

$ openresty -V
nginx version: openresty/1.19.9.1
built by clang 12.0.5 (clang-1205.0.22.11)
built with OpenSSL 1.1.1l  24 Aug 2021
TLS SNI support enabled
configure arguments: --prefix=/usr/local/Cellar/openresty/1.19.9.1_2/nginx --with-cc-opt='-O2 -I/usr/local/include -I/usr/local/opt/pcre/include -I/usr/local/opt/openresty-openssl111/include' --add-module=../ngx_devel_kit-0.3.1 --add-module=../echo-nginx-module-0.62 --add-module=../xss-nginx-module-0.06 --add-module=../ngx_coolkit-0.2 --add-module=../set-misc-nginx-module-0.32 --add-module=../form-input-nginx-module-0.12 --add-module=../encrypted-session-nginx-module-0.08 --add-module=../srcache

4、已做了一个软链接:

/usr/local/bin/openresty

5、常用命令

wenjianbao@Wjb-Mac ~ % openresty -help 
nginx version: openresty/1.19.9.1
Usage: nginx [-?hvVtTq] [-s signal] [-p prefix]
             [-e filename] [-c filename] [-g directives]

Options:
  -?,-h         : this help
  -v            : show version and exit
  -V            : show version and configure options then exit
  -t            : test configuration and exit
  -T            : test configuration, dump it and exit
  -q            : suppress non-error messages during configuration testing
  -s signal     : send signal to a master process: stop, quit, reopen, reload
  -p prefix     : set prefix path (default: /usr/local/Cellar/openresty/1.19.9.1_2/nginx/)
  -e filename   : set error log file (default: /usr/local/var/log/nginx/error.log)
  -c filename   : set configuration file (default: /usr/local/etc/openresty/nginx.conf)
  -g directives : set global directives out of configuration file

(1) 启动

wenjianbao@Wjb-Mac ~ % openresty   

(2) 重启

wenjianbao@Wjb-Mac ~ % openresty -s reload

(3) 关闭

wenjianbao@Wjb-Mac ~ % openresty -s stop 

默认网站目录:

/usr/local/Cellar/openresty/1.19.9.1_2/nginx/html