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

nginx 添加到环境变量中

相关文章:

  • 2022-12-23
  • 2021-07-30
  • 2021-08-20
  • 2021-12-14
  • 2021-05-10
  • 2022-02-14
  • 2021-09-29
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-09
  • 2022-12-23
  • 2021-08-13
  • 2021-11-28
  • 2022-12-23
相关资源
相似解决方案