一、安装nginx
解压到指定路径:C:\iot\nginx-1.17.8
友情提示:安装路径不能出现中文
二、注册成服务
2.1 配置
进入到nginx,复制两个文件到nginx
编辑nginxservice.xml
<service>
<id>el-nginx</id>
<name>el-nginx</name>
<description>el-nginx(8000)</description>
<logpath>C:\iot\nginx-1.17.8</logpath>
<logmode>roll</logmode>
<depend></depend>
<executable>C:\iot\nginx-1.17.8\nginx.exe</executable>
<stopexecutable>C:\iot\nginx-1.17.8\nginx.exe -s stop</stopexecutable>
</service>
三、注册成服务
Win+R,输入到cmd,切换到nginx的路径,
nginxservice.exe install
Win+R,输入到services.msc
打开服务,查找el-nginx,设置成开机开机自起。
四、卸载服务
以管理员的身份运行
sc delete 服务名称