文章目录
1. 环境变量配置
- 修改~/.bashrc文件中的环境变量
# 根据自身服务环境,进行配置
export NGINX_HOME=/usr/local/nginx
export path=${NGINX_HOME}/sbin
- source ~/.bashrc使文件生效
2. nginx命令
# nginx启动
root@:~# nginx
# 查询nginx版本
root@:~# nginx -v
nginx version: nginx/1.13.7
# 查看配置是否符合语法
root@:~# nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
# nginx配置重新加载(nginx的热部署)
root@:~# nginx -s reload
# nginx停止
root@:~# nginx -s stop