一.简单命令的使用
查看nginx版本:在sbin目录下 ./nginx -v
启动nginx之前检查配置文件是否有误在sbin目录下: ./nginx -t
启动nginx服务: ./nginx
停止服务: ./nginx -s stop
启动查看进程: ps -ef|grep nginx
添加防火墙制定端口:firewall-cmd --zone=public --add-port=3306/tcp --permanent
重新加载防火墙:firewall-cmd --reload
关闭指定端口:firewall-cmd --zone=public --remove-port=80/tcp --permanent
查看开放的端口:firewall-cmd --zone=public --list-ports
nginx重新加载配置文件: ./nginx -s reload
配置nginx的环境变量
1.vim /etc/profile
JAVA_HOME=/usr/local/jdk1.8.0_361
PATH=/usr/local/nginx/sbin: $JAVA_HOME/bin:$PATH
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tool.jar
export JAVA_HOME CLASSPATH PATH
2. source /etc/profile