nginx 错误集锦
1)下载地址
http://nginx.org/en/download.html
找windows的下载。
2)然后解压到自己的一个目录。
3)配置环境变量,将解压到的路径加进去。
4)修改配置文件
nginx/conf/nginx.conf文件,找server ->listen 把80端口改成其他的。如:8080
5)nginx启动 直接命令 nginx
报错:
nginx: [alert] could not open error log file: CreateFile() "logs/error.log" failed (3: The system cannot find the path specified)
2018/11/17 17:43:20 [emerg] 16204#3512: CreateFile() "C:\Users\Administrator/conf/nginx.conf" failed (3: The system cannot find the path specified)
原因:启动需要配置文件,指定配置文件命令
nginx -c D:\tool\nginx-1.15.6\conf\nginx.conf
报错:
nginx: [alert] could not open error log file: CreateFile() "logs/error.log" failed (3: The system cannot find the path specified)
2018/11/17 17:44:44 [emerg] 14976#4176: invalid number of arguments in "root" directive in D:\tool\nginx-1.15.6\conf\nginx.conf:45
配置文件root指定一个目录的时候,最末尾不能是"\"
再执行命令报错
nginx: [alert] could not open error log file: CreateFile() "logs/error.log" failed (3: The system cannot find the path specified)
2018/11/17 18:00:01 [emerg] 8664#1348: CreateDirectory() "C:\Users\Administrator/temp/client_body_temp" failed (3: The system cannot find the path specified)
去建目录:C:\Users\Administrator/temp/client_body_temp
C:\Users\Administrator>nginx -c D:\tool\nginx-1.15.6\conf\nginx.conf
nginx: [alert] could not open error log file: CreateFile() "logs/error.log" failed (3: The system cannot find the path specified)
2018/11/17 18:08:27 [emerg] 10848#8284: CreateFile() "D:\logs
ginx\error.log" failed (123: The filename, directory name, or volume label syntax is incorrect)
什么鬼,还带 \n转义的???
去配置文件里改路径 error_log D:\logs\\nginx\error.log;
nginx: [alert] could not open error log file: CreateFile() "logs/error.log" failed (3: The system cannot find the path specified)
2018/11/17 18:18:29 [emerg] 10204#7268: unknown log format "main" in D:\tool\nginx-1.15.6\conf\nginx.conf:25
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log D:\logs\\nginx\access.log main;
把这里打开
nginx: [emerg] CreateFile() "C:\Users\Administrator/logs/nginx.pid" failed (3: The system cannot find the path specified)
去配置文件改pid目录,或者去创建个目录
这个是个警告
nginx: [alert] could not open error log file: CreateFile() "logs/error.log" failed (3: The system cannot find the path specified)
进到安装目录
D:\tool\nginx-1.15.6>nginx -c conf\nginx.conf
执行,没有再警告了。访问配置的localhost:8080。看看有没有效果。
————————————————
版权声明:本文为CSDN博主「李逢涛」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/hebsun/article/details/84191029
nginx 错误集锦的更多相关文章
- 场景2 nginx 错误日志格式:
nginx 错误日志格式: 2016/09/01 11:23:36 [error] 28388#0: *14549 open() "/var/www/zjzc-web-frontEnd/im ...
- SVN下错误集锦
SVN下错误集锦 一SVN下的文件被locked不能update和commit 最近做项目的时候,遇到这个问题,SVN下的文件被locked不能update和commit.其提示如下: 解决办法:执行 ...
- (转)Hadoop之常见错误集锦
Hadoop之常见错误集锦 下文中没有特殊说明,环境都是CentOS下Hadoop 2.2.0.1.伪分布模式下执行start-dfs.sh脚本启动HDFS时出现如下错误: ...
- Nginx错误页面优雅显示
一.Nginx错误页面优雅显示的原因? 当我们访问网站时,由于特殊的原因,经常会出现诸如403,404,503等错误,这极大的影响用户的访问体验,所以我们很有必要做一下错误页面的优雅显示,以提升用 ...
- Nginx 错误处理方法: bind() to 0.0.0.0:80 failed
Nginx 错误处理方法: bind() to 0.0.0.0:80 failed 今天启动window上的nginx总是报错 错误信息是bind() to 0.0.0.0:80 failed (10 ...
- nginx错误界面优化和日志管理
nginx错误界面优化 在进行web访问的时候,经常会遇到网站打不开报错的情况,nginx默认的界面并不美观,我们可以通过重定向到自定义的错误页面,提升用户体验,比如淘宝的错误页面还有商品信息和广告. ...
- Nginx 错误日志配置
1.Nginx错误日志信息介绍: error_log的语法格式及参数说明: error_log file level; 关键字 日志文件 错误日志级别 其中,关键字 ...
- 在Hadoop 2.3上运行C++程序各种疑难杂症(Hadoop Pipes选择、错误集锦、Hadoop2.3编译等)
首记 感觉Hadoop是一个坑,打着大数据最佳解决方案的旗帜到处坑害良民.记得以前看过一篇文章,说1TB以下的数据就不要用Hadoop了,体现不 出太大的优势,有时候反而会成为累赘.因此Hadoop的 ...
- drp错误集锦---“Cannot return from outside a function or method”
好久都不动的项目,今天打开项目突然是红色感叹号.详细错误表现为: 也就是说,如今MyEclipse已经不识别在JSP页面中使用的return方法了(并且不止一处这种警告),那怎么办?????顿时闹钟一 ...
随机推荐
- python初始化定长列表
>>> lst = ['x' for n in range(5)] >>> print(lst) ['x', 'x', 'x', 'x', 'x'] >> ...
- WPF实战案例-在线程内同步集合数据到UI线程
有这样一个场景,在vm中,我们为了ui的体验,会异步访问后端接口,获取数据集合,如果这个集合绑定到界面,并且在线程内,怎么处理? 有人讲:this.Dispatcher.Invoke,如果在vm内呢? ...
- pip安装超时解决方案
1 安装的后面 用-i接一些国内的镜像,下面这个是清华的,亲测比较快 pip install apache-airflow -i https://pypi.tuna.tsinghua.edu.cn/s ...
- PMM 监控 MySQL 使用钉钉告警
打开 PMM Server 页面,如图所示点进Alerting --> Notification channels 输入钉钉的信息,并且 Save Test 测试结果,没问题了 如何使用 gra ...
- Python3+Appium学习笔记01-环境配置(上)
公司可能也有关于对app自动化的一些想法,让我去研究下.当然以移动互联网的热度.对于app自动化测试技术听闻已久.也一直想要去学习.正好.这次可以在工作时间中学习.emmm.希望自己能坚持把这个系列更 ...
- RunTime.getRunTime().addShutdownHook 添加钩子
Runtime.getRuntime().addShutdownHook(shutdownHook); google了一下它的含义:在jvm中增加一个关闭的钩子,当jvm关闭的时候,会执行系统中已经设 ...
- 两种atm取款方式
1.//函数 密码 账号function User(username, password, account){ this.username = username; this.password = pa ...
- win10 LTSC 2019 激活
win 10 打开终端 1.slmgr -ipk M7XTQ-FN8P6-TTKYV-9D4CC-J462D 2.slmgr -skms kms.03k.org 3.slmgr -ato 4. slm ...
- Git始终忽略特定文件的某一行内容
笔者在编写Z Shell文件的时候经常会使用到set -x来开启调试,但不希望提交到仓库 解决方案 Git提供了一种文件过滤器,此方法可以帮助在提交时移除set -x 我们先来编写脚本,如何移除这一行 ...
- HDU 6048 - Puzzle | 2017 Multi-University Training Contest 2
/* HDU 6048 - Puzzle [ 思维,结论 ] | 2017 Multi-University Training Contest 2 题意: 类似华容道的问题, N*M 的矩阵中N*M- ...