一、先找到 nginx 的安装地址
sh
whereis nginx
二、在/etc/profile 中加入配置
打开配置文件
bash
vi /etc/profile
在配置文件末尾加入
bash
#nginx configure
export NGINX_HOME=/usr/local/nginx-1.10.2
export PATH=$PATH:$NGINX_HOME/sbin
==/usr/local/nginx-1.10.2
是你输入whereis nginx
后系统输出的路径,按照实际情况填写==
编辑完保存退出并执行
bash
source /etc/profile
三、查看 nginx 版本
bash
nginx -v