zoukankan      html  css  js  c++  java
  • nginx 基础(windows)

    1.安装

    以服务方式运行,下载srvany.exe,instsrv.exe文件放在nginx安装目录 

    运行命令instsrv Nginxc:/nginx/srvany.exe ,这样就安装了一个Nginx的服务

    配置Nginx的运行参数

    可以直接将配置导入到注册表

    Windows Registry Editor Version 5.00
    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NGINX\Parameters]
    "Application"="D:\\nginx-1.2.7\\nginx.exe"
    "AppParameters"=""
    "AppDirectory"="D:\\nginx-1.2.7\\"
    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NGINX]
    "Description"="NGINX WEB 服务器"
    

      当停止Nginix服务后,访问浏览器仍然能看到网站。查看进程,你会发现,Nginx启动了两个nginx进程(根据nginx.conf的配置worker_processes 1;),Fork出来的进程显然没有被停止,结果就是nginx永远关不掉。写一个stop_nginx脚本来处理nginx停止的所有操作 

    Command代码@echo off   
    echo Stopping nginx service... 
    net stop nginx   
    echo Kill nginx process...   
    
    taskkill /F /IM nginx.exe > nul

    删除服务,使用命令: 

    sc delete Nginx

     测试配置是否正常

     nginx -t 

  • 相关阅读:
    PhpStrom之添加文件夹至左侧目录树
    PhpStorm下载、破解
    ASP.NET 页面执行顺序
    委托的使用 举例猫叫,老鼠逃跑,主人惊醒
    分页显示
    WebForm页面生命周期及asp.net运行机制
    json 对象和json字符串
    说走就走??
    面向多态
    mvc 过滤器篇
  • 原文地址:https://www.cnblogs.com/changqing916/p/2958995.html
Copyright © 2011-2022 走看看