openresty在mac osx中的使用

2016-04-14 19:49:40
原创 2366
通过`brew install homebrew/nginx/openresty`安装openresty后按照指令`ln -sfv /usr/local/opt/openresty/*.plist ~/Library/LaunchAgents`copy 自动启动 然后使用`launchctl load ~/Library/LaunchAgents/homebrew.mxcl.openresty.plist` 加入到启动列表中,但是这并没有启动。那么如何启动呢,又如何重载 停止呢?我们来看bin目录的两个命令```resty 和 openresty``````-> % sudo openresty -hnginx version: openresty/ nginx [-?hvVtTq] [-s signal] [-c filename] [-p prefix] [-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/ -c filename : set configuration file (default: /usr/local/etc/openresty/nginx.conf) -g directives : set global directives out of configuration file``````-> % sudo resty -hPassword:resty [options] [lua-file [args]]Options: -c num Set maximal connection count (default: 64). -e prog Run the inlined Lua code in "prog". --help Print this help. --http-include path Include the specified file in the nginx http configuration block (multiple instances are supported). -I dir Add dir to the search paths for Lua libraries. --main-include path Include the specified file in the nginx main configuration block (multiple instances are supported). --nginx Specify the nginx path (this option might be removed in the future). -V Print version numbers and nginx configurations. --valgrind Use valgrind to run nginx --valgrind-opts Pass extra options to valgrindFor bug reporting instructions, please see:```很显然```sudo openresty #启动openrestysudo openresty -s stop #停止openrestysudo openresty -s reload #重载sudo openresty -s quit #退出sudo openresty -t #测试配置文件sudo openresty -T#测试配置文件并打印出来```常用功能就如此了,至于lua 让我们再说吧,毕竟我用来做web服务器
零 减 贰 =