方式一,只能在当前会话临时生效
PATH=/usr/local/openresty/sbin:$PATH
export PATH
方式二,永久有效
vi /etc/profile
添加export PATH=$PATH:/usr/local/openresty/bin到文件末尾,并使之生效
source /etc/profile
之后便可以直接执行nginx等命令
nginx -p `pwd` -c conf/nginx.conf -s stop
PATH=/usr/local/openresty/sbin:$PATH
export PATH
vi /etc/profile
添加export PATH=$PATH:/usr/local/openresty/bin到文件末尾,并使之生效
source /etc/profile
之后便可以直接执行nginx等命令
nginx -p `pwd` -c conf/nginx.conf -s stop