Centos 安装nginx
一、添加Nginx到YUM源
# sudo rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
二、安装nginx
# sudo yum install -y nginx
三、启动nginx
# sudo systemctl start nginx.service
四、开机启动
# sudo systemctl enable nginx.service
五、nginx配置信息
网站文件默认目录:/usr/share/nginx/html 网站默认站点配置:/etc/nginx/conf.d/default.conf 自定义Nginx站点配置文件存放目录:/etc/nginx/conf.d/ Nginx全局配置:/etc/nginx/nginx.conf nginx启动:# nginx -c nginx.conf
常用操作:
start nginx //启动 nginx -s stop // stop是快速停止nginx,可能并不保存相关信息 nginx -s quit // quit是完整有序的停止nginx,并保存相关信息 nginx -s reload // 当配置信息修改,需要重新载入这些配置时使用此命令 nginx -s reopen // 重新打开日志文件 nginx -v // 查看Nginx版本
相关推荐
yserver 2020-08-15
nginxs 2020-11-14
Guanjs0 2020-11-13
小木兮子 2020-11-11
yserver 2020-11-11
ssihc0 2020-11-11
windle 2020-11-10
HanksWang 2020-11-10
liuchen0 2020-11-10
Freshairx 2020-11-10
ccschan 2020-11-10
liwf 2020-11-10
Guanjs0 2020-11-09
AderStep 2020-11-09
zrtlin 2020-11-09
mqfcu 2020-11-10