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方法了(并且不止一处这种警告),那怎么办?????顿时闹钟一 ...
随机推荐
- docker启动 elasticsearch 修改 xmx xms 堆内存大小修改
用docker 安装的elasticsearch 5.6版本默认堆内存最大设置的2G 可以通过如下方法修改 [root@nova-92 logs]# find /var/lib/docker/ -na ...
- 微信小程序wxs如何使用
新建一个.wxs文件 <!-- 引入.wxs文件 src为相对路径,module指定当前模块的名称 --> <wxs module="filter" src=&q ...
- kali linux 安装 qq (deepin-wine)
添加deeepin-wine 依赖 /etc/apt/sources.list: # Generated by deepin-installer deb http://mirrors.aliyun.c ...
- C语言编译过程及相关文件
1,C程序编译步骤 C代码编译成可执行程序经过4步: 1)预处理:宏定义展开.头文件展开.条件编译等,同时将代码中的注释删除,这里并不会检查语法 2)编译:检查语法,将预处理后文件编译生成汇编文件 3 ...
- RabbitMQ的持久化(六)
RabbitMQ的持久化主要体现在三个方面,即交换机持久化,队列持久化及消息持久化 注意,因公司使用php-amqplib来实现RabbitMQ,故之后举例说明的代码均使用的php-amqplib,而 ...
- 打印n对括号的全部有效组合(左右括号正确匹配)Java实现
一.问题导出 今天在做算法题目的时候遇到了一道左右括号匹配的问题,问题如下: 二.问题思考 (1)这种要列出全部可能性的题目很容易想到由小到大去发现规律,用递归或者暴力搜索. 首先1的情况,一个括号只 ...
- 关于微信小程序的本地存储
微信小程序中会使用wx.setStorage(wx.setStorageSync)来存储数据,问题是:即使小程序被销毁了,本地缓存的数据仍然存在.会造成: 所以要及时清理掉本地缓存的数据.解决思路: ...
- u-boot器件驱动模型(Device&Drivers)之uclass (转)
一.剧情回顾 在上一篇链接器的秘密里面我们讲到我们用一些特殊的宏让链接器帮我们把一些初始化好的结构体列好队并安排在程序的某一个段里面,这里我例举出了三个和我们主题相关段的分布情况,它们大概如下图所示: ...
- Elasticsearch:fuzzy 搜索 (模糊搜索)
在实际的搜索中,我们有时候会打错字,从而导致搜索不到.在Elasticsearch中,我们可以使用fuzziness属性来进行模糊查询,从而达到搜索有错别字的情形. match查询具有"fu ...
- linux基础_vi和vim快捷键
(1)拷贝当前行 yy,拷贝当前行向下5行 5yy,并粘贴. (2)删除当前行 dd, 删除当前行向下的5行 5dd. (3)在文件中查找某个单词.[在命令行下使用 /+关键字,回车查找,输入n就是查 ...