网上搜索安装nginx的方法,按照步骤在 http://nginx.org/en/download.html 下载了安装包,并配置了conf/nginx.conf,将nginx的根目录添加进了环境变量path中;

打开命令行,进入 'D:\nginx-1.15.3\conf' 目录,执行如下命令验证配置文件的正确性:

nginx -t -c nginx.conf

结果提示错误:

nginx: the configuration file 'D:\nginx-1.15.3\conf/nginx.conf syntax is ok
nginx: [emerg] CreateDirectory() "'D:\nginx-1.15.3\conf/temp/client_body_temp" failed (3: The system cannot find the path specified)
nginx: configuration file 'D:\nginx-1.15.3\conf/nginx.conf test failed

并且运行如下命令:

nginx -t

也是出现错误提示:

nginx: [emerg] CreateFile() "'D:\nginx-1.15.3\conf/conf/nginx.conf" failed (3: The system cannot find the path specified)
nginx: configuration file 'D:\nginx-1.15.3\conf/conf/nginx.conf test failed

百思不得其解,后来在命令行上退出 conf 目录,回到根目录 'D:\nginx-1.15.3' ,如下运行命令:

D:\nginx-1.15.3> nginx -t -c conf\nginx.conf

则显示配置文件正确:

nginx: the configuration file D:\nginx-1.15.3/conf\nginx.conf syntax is ok
nginx: configuration file D:\nginx-1.15.3/conf\nginx.conf test is successful

并且,运行命令:

D:\nginx-1.15.3> nginx -t

显示nginx安装正常

nginx: the configuration file D:\nginx-1.15.3/conf/nginx.conf syntax is ok
nginx: configuration file D:\nginx-1.15.3/conf/nginx.conf test is successful

nginx 常用命令:

验证配置是否正确: nginx -t

查看Nginx的版本号:nginx -V

启动Nginx:start nginx

快速停止或关闭Nginx:nginx -s stop

正常停止或关闭Nginx:nginx -s quit

配置文件修改重装载命令:nginx -s reload

Windows7安装nginx后,'nginx -t -c nginx.conf' 命令出现 “could not open error log file: CreateFile() "logs/error.log" failed” 错误的原因的更多相关文章

  1. Centos7安装nginx后提示“Welcome to nginx on Fedora!”,conf.d目录下无default.conf文件

    问题描述 在腾讯云centos7上安装nginx sudo yum install nginx 打开默认网页显示 Welcome to nginx on Fedora! 且 /etc/nginx/co ...

  2. 本地安装apk后直接打开,按下Home键再重新打开,然后按下返回键时页面展示错误的处理方法

    情景: 1.下载apk到手机本地,点击本地apk开始安装 2.安装完成后,一般会有 “完成” 和 “打开” 两个按钮,点击 “完成” 按钮时是没有问题的,不管它 3.点击 “打开” 按钮,进入到首页( ...

  3. centos8 yum安装nginx后启动不了nginx

    起动报下列错误 移动到安装目录下起动报下列错误,说是端口被占用 输入journalctl -xe命令查看,发现如下: 这个是一个什么错误,度娘一下SElinux 输入sestatus查看下SElinu ...

  4. linux python3 安装scrapy 后提示 -bash: scrapy: 未找到命令

    https://blog.csdn.net/dangsh_/article/details/79613210

  5. 安装Maven后使用cmd 执行 mvn -version命令 报错JAVA_HOME should point to a JDK not a JRE

    1. 可以执行maven指令,说明maven的配置没错 2. 打开cmd,在cmd输入: set JAVA_HOME=D:\Program Files\Java\jdk1.8.0_91 3. 再测试是 ...

  6. Homebrew安装Mysql后的两步必要的命令

    linxmousedeiMac:~ linxmouse$ mysql.server start Starting MySQL .. SUCCESS! linxmousedeiMac:~ linxmou ...

  7. Openresty安装及使用配置(OPENRESTY+NGINX)

    Openresty 简介 Openresty是一个基于NGINX和Lua的高性能Web平台,内部有大量的Lua库和第三方模块,能够很方便的搭建处理高并发,扩展性高的Web平台和动态网关,充分利用 Ng ...

  8. nginx之旅(第一篇):nginx下载安装、nginx启动与关闭、nginx配置文件详解、nginx默认网站

    一.nginx下载安装 版本nginx 1.15.5 系统环境centos7.5(本机ip192.168.199.228) 关闭selinux 和防火墙firewall 1.下载 wget http: ...

  9. nginx安装 nginx: [emerg] getpwnam(“www”) failed 错误

    inux 64系统中安装nginx1.3时如果出现错误:nginx: [emerg] getpwnam(“www”) failed解决方法1:      在nginx.conf中 把user nobo ...

随机推荐

  1. WebForm - 文本框回车事件

    document.getElementById("Pwd").onkeyup = function (e) { ) { fun_Login(); } };

  2. sql练习(针对Mysql)

    创建表: DROP TABLE DEPT; --部门表 CREATE TABLE DEPT( DEPTNO int PRIMARY KEY, DNAME ) , --部门名称 LOC ) ---部门地 ...

  3. Python:抓取百度SERP搜索结果页的网站标题信息

    比如,你想采集标题中包含“58同城”的SERP结果,并过滤包含有“北京”或“厦门”等结果数据. 该Python脚本主要是实现以上功能. 其中,使用BeautifulSoup来解析HTML,可以参考我的 ...

  4. 垃圾回收(GC)相关算法笔记

    GC需要完成的3件事情: 哪些内存需要回收? 什么时候回收? 如何回收? 引用计数算法 给对象中添维护一个计数器,每当引用这个对象时,计数器加1:当引用失效时,计数器值减1:当计数器值为0时,表示这个 ...

  5. 移动键盘 滚动input

    window.addEventListener('resize', function () { if(document.activeElement.tagName === 'INPUT'){ docu ...

  6. SpringMVC之表单校验

    SpringMVC已经实现了对Java校验API(JSR-303)的支持,通过使用该API可以实现对数据的校验.要使用SpringMVC的Java校验API并不需要任何配置,只要引入其实现即可.本文使 ...

  7. git第二节----git clone与git tag

    @git 远程克隆(clone)仓库,将远程工程clone到本地仓库:默认克隆远程master 分支 git clone  https://github.com/kaokaozhu/Test.git ...

  8. 基于Hadoop2.6.5(HA)的HBase2.0.5配置

    1.配置 在CentOS7Three上配置,注意:一定要安装bin包,不能安装src包 /usr/local/hbase/hbase-2.0.5/conf 编辑hbase-env.sh,替换成如下配置 ...

  9. UVa 12657 Boxes in a Line(数组模拟双链表)

    题目链接 /* 问题 将一排盒子经过一系列的操作后,计算并输出奇数位置上的盒子标号之和 解题思路 由于数据范围很大,直接数组模拟会超时,所以采用数组模拟的链表,left[i]和right[i]分别表示 ...

  10. GCD之Source

    参考:http://blog.csdn.net/lengshengren/article/details/12905811