zoukankan      html  css  js  c++  java
  • window 怎么样让nginx开机自启动

    安装Nginx

    下载windows版nginx (http://nginx.org/download/nginx-1.10.0.zip),之后解压到需要放置的位置(D:xampp ginx)

    将Nginx设置为Windows服务

    需要借助"Windows Service Wrapper"小工具,项目地址: https://github.com/kohsuke/winsw

    下载地址: http://repo.jenkins-ci.org/releases/com/sun/winsw/winsw/1.18/winsw-1.18-bin.exe

    下载该工具后,将其放在 Nginx安装目录下,并重命名为nginx-service.exe,创建配置文件nginx-service.xml(名字要和工具名一样),

    创建nginx-service.exe.config(为支持NET 4.0 runtime,默认只支持NET 2.0 runtime)

    文件结构如下:

    nginx-service.xml 内容如下:

    <service>   <id>nginx</id>   <name>Nginx Service</name>   <description>High Performance Nginx Service</description>   <logpath>D:xampp ginxlogs</logpath>   <log mode="roll-by-size">     <sizeThreshold>10240</sizeThreshold>     <keepFiles>8</keepFiles>   </log>   <executable>D:xampp ginx ginx.exe</executable>   <startarguments>-p D:xampp ginx</startarguments>   <stopexecutable>D:xampp ginx ginx.exe</stopexecutable>   <stoparguments>-p D:xampp ginx -s stop</stoparguments> </service>

    nginx-service.exe.config 内容如下:

    <configuration>   <startup>     <supportedRuntime version="v2.0.50727" />     <supportedRuntime version="v4.0" />   </startup>   <runtime>     <generatePublisherEvidence enabled="false"/>    </runtime> </configuration>

    在cmd中运行如下命令安装windows服务

    D:xampp
    ginx
    ginx-service.exe install

    之后就可以在Windows服务面板中启动服务了

    浏览器中就可以正常访问了

    网址:http://blog.csdn.net/weixin_37288522/article/details/70576409

  • 相关阅读:
    linux笔记
    restful课程凌杂知识点
    Django中间件执行流程
    restful知识点之二restframework视图
    restful知识点之一CBV
    可变长参数
    函数的重点内容
    文件的高级应用及修改的两种方式
    文件的三种打开方式及with管理文件上下文
    字符编码
  • 原文地址:https://www.cnblogs.com/cxscode/p/8262319.html
Copyright © 2011-2022 走看看