nginx -t 检查配置文件地址
nginx.conf 文件中 user root;
nginx -t 检查配置文件地址
上线:需要注意的地方
1.如何找到配置文件
方式一:cd /etc/ngnix
方式二:ngnix -t 查询配置文件位置
2.更改配置文件 vim
1). user => root
2). locatiob root => /root/www/
cd /etc/nginx
nginx -t
vim nginx.conf
user nginx-->user root
http-->server-->location
配置web服务器
nginx -t
将本地文件上传到远程服务器:scp
具体用法:
`scp -r {本地目录的文件} {服务器用户名@远程服务器ip:{远程服务器的文件目录}}`
scp -r ./demo/* root@47.94.255.230:/root/www
CentOS系统管理命令:
# 安装scp命令 yum install openssh-client # 查看进程 ps -ef | grep nginx # 验证nginx配置文件语法 nginx -t # 关闭nginx服务进程 nginx -s stop # 开启nginx服务进程 nginx -s reload
pwd命令:
配置服务器
打开nginx.conf文件:vim nginx.conf
退出编辑
location配置
--nginx配置文件
nginx -t
--配置nginx.conf
1、use nginx 改为 use root
2、http > server > location
location / { //根访问地址,可/***
root /root/www/; //网站存放路径
index index.html index.htm; //网站默认访问页面
}
配置nginx
1、找到配置文件nginx.conf,可使用下述命令查询配置文件的路径
nginx -t
2、将 user nginx 改为 user root
3、找到 http > server > location ,可查看到网站的根目录以及网站存放的本地路径,还可对网站入口地址等进行配置