网上搜索安装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. MySQL命令行登陆,远程登陆MySQL

    注: MySQL图形界面管理工具[navicat 10.1.8中文绿色版] 下载地址:http://www.t00y.com/file/18393836 备用地址:http://ProCircle.q ...

  2. android开发学习——day5

    活动跳转部分代码显式intent @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(saved ...

  3. Install nginx on centos

    1. 安装wget. sudo yum -y install wget 2. 下载nginx发布代码. sudo wget http://nginx.org/download/nginx-1.8.0. ...

  4. JVM(二)JVM的结构

    1.JVM的结构包括 (1)类加载器 (2)执行引擎 (3)运行时数据区 (4)本地库接口 类加载器:包括启动类加载器.扩展类加载器.应用程序类加载器.自定义加载器. 执行引擎:在执行JAVA代码的时 ...

  5. php插入数据含有特殊符号的处理方法

    我们在向mysql写入数据时,比如: mysql_query(”update table set `title`=’kuhanzhu’s blog’”); http://www.cnblogs.com ...

  6. ecshop 安装出错gd_version

    678: static function gd_version()

  7. Java 中的队列 Queue

    一.队列的定义 我们都知道队列(Queue)是一种先进先出(FIFO)的数据结构,Java中定义了java.util.Queue接口用来表示队列.Java中的Queue与List.Set属于同一个级别 ...

  8. vue代码上传服务器后背景图片404解决方法

    问题:代码上传服务器后,图片404,使用的font-awesome图标也是404 解决办法: 如果你用了vue-cil,那么在build目录下找到utils.js中的ExtractTextPlugin ...

  9. php中判断mysql查询返回结果集是否为空

    我是php的新手,对于判断 $query = "SELECT * FROM driver; $result = mysql_query($query) or die(mysql_error( ...

  10. Solidity类型转换

    类型转换,是一个十分重要,常用的手段. 一.隐式转换 隐式转换,就是当一个运算符能支持不同类型,编译器会隐式的尝试将一个操作数的类型,转为另一个操作数的类型,赋值同理. 条件是:值类型间的互相转换只要 ...