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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM