网上搜索安装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. Flask-WTF

    Flask-WTF 提供了简单地 WTForms 的集成. 官方文档:http://www.pythondoc.com/flask-wtf/index.html 功能 集成 wtforms. 带有 c ...

  2. odoo配置界面设置字段默认值

    转自国外牛人博客:http://ludwiktrammer.github.io/odoo/custom-settings-odoo.html Defining custom settings in O ...

  3. oracle RAC 跨网段客户端访问 报ORA-12170

    场景描述: 服务器所在网段为20,在同一网段的机器客户端远程连接SCAN IP 可以正常访问,当时更换了网段之后,15网段的机器通过oracle客户端连接服务器SCAN ip 无法正常访问,telne ...

  4. Linux系统修改防火墙配置

    防火墙配置文件位置 /etc/sysconfig/iptables 需要开放端口,请在里面添加一条内容即可: 1 -A RH-Firewall-1-INPUT -m state --state NEW ...

  5. setup&hold

    setup time:建立时间,也就是在时钟上升沿到来前,数据需要稳定的时间.hold time:保持时间,指的是在时钟上升沿到来后,数据还需要保持的时间.实际上设置setup time和hold t ...

  6. jdbc mysql driver 6.0.2

    url = jdbc:mysql://localhost:3306/hibernate?useUnicode=true&characterEncoding=UTF-8&useLegac ...

  7. k8s服务网关ambassador部署

    1.ambassador是datawire开源的服务网关,很好的支持kubernetes.具体详细介绍参考官网:https://www.getambassador.io/about/why-ambas ...

  8. k-近邻算法(KNN)

    最近邻算法可以说是最简单的分类算法,其思想是将被预测的项归类为和它最相近的项相同的类.我们通过简单的计算比较即将被预测的项与已有训练集中各项的距离(差距),选择其中差距最小的一项,该项的类别即为我们即 ...

  9. Spring @ResponseStatus

    @ResponseStatus这个注解确实是个令我头疼的注解. 先记录下@ResponseStatus注解的定义. 记录几个得到的信息:@ResponseStatus声明在方法.类上, Spring3 ...

  10. MFC RichText 滚动条问题

    一共涉及两个问题: 1.如何更加轻快的在RichText不覆盖之前的文本而添加新的文本 CString text("add text\n"); //想插入的文本,为了使下次输入我们 ...