nginx 添加到环境变量中

nginx热启动命令

nginx -s reload

报错
-bash: nginx: command not found
一般通过执行/usr/local/nginx/sbin/nginx -s reload,每次都要去找目录比较麻烦,所以吧nginx配置到环境变量里用nginx之类执行指令

步骤如下:
1、编辑/etc/profile

vim /etc/profile

2、在最后一行添加配置,:wq保存

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

3、使配置立即生效

source /etc/profile

posted @ 2020-03-27 16:52  nickchou  阅读(15476)  评论(0编辑  收藏  举报