• windows设置nginx开机自启


    windows设置nginx开机自启

    1、首先下载nginx 下载地址
    自己选择想下的版本,这里我下载的1.19版本的
    2、将nginx设置为windows服务
    需要借助工具:下载地址
    下载该工具后,将其放在 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:windowsServerchangfeng ginx-1.19.0logs</logpath>
    <log mode="roll-by-size">
    <sizeThreshold>10240</sizeThreshold>
    <keepFiles>8</keepFiles>
    </log>
    <executable>D:windowsServerchangfeng ginx-1.19.0 ginx.exe</executable>
    <startarguments>-p D:windowsServerchangfeng ginx-1.19.0</startarguments>
    <stopexecutable>D:windowsServerchangfeng ginx-1.19.0 ginx.exe</stopexecutable>
    <stoparguments>-p D:windowsServerchangfeng ginx-1.19.0 -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,右键以管理员身份运行:输入 nginx-service.exe install


    再打开服务设置为自动启动即可

    ————————————————
    版权声明:本文为CSDN博主「wj_java_programmer」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
    原文链接:https://blog.csdn.net/qq_41793064/article/details/106522433

  • 相关阅读:
    L3002 特殊堆栈
    L3007 天梯地图
    L3004 肿瘤诊断
    Linux常用笔记
    微信红包测试用例
    Ubuntu21 bluetooth connects to freebuds pro freebuds耳机Ubuntu21连接失败
    Freebuds Connnect Problem in the Windows Freebuds耳机windows10连接失败
    Ubuntu21 kernal5.13 Nvidia960M驱动安装系统安装
    Linux进程间通信
    Zeppelin返回503问题
  • 原文地址:https://www.cnblogs.com/zkwarrior/p/15065458.html
Copyright © 2020-2023  润新知