Nginx的使用(三)把nginx和php-cgi.exe注册成windows服务
1.创建windows服务用到一个小工具WinSW:https://github.com/kohsuke/winsw/releases(下载 .exe 文件即可,根据系统选择,Win 10 选择 .NET4 版本,以下选择 .NET2 版本)
2.把php-cgi.exe注册成windows服务除了需要用到WinSW以外,还需要用到xxfpm,用来开启 PHP-CGI 多进程,下载地址:https://github.com/78/xxfpm
3.将下载到的WinSW.NET4.exe更名为nginxservice.exe,放到nginx.exe所在的目录下,在该目录下新增文件 nginxservice.xml,修改nginxservice.xml配置如下:
<service> <id>nginx</id> <name>nginx</name> <description>nginx</description> <logpath>E:\nginx-1.12.2\</logpath> <logmode>roll</logmode> <depend></depend> <executable>E:\nginx-1.12.2\nginx.exe</executable> <stopexecutable>E:\nginx-1.12.2\nginx.exe -s quit</stopexecutable> </service>
4.在E:\nginx-1.12.2\下执行 nginxservice.exe install,即可生成windows服务,卸载命令:nginxservice.exe uninstall
5.php的服务注册需要先下载xxfpm,将下载的xxfpm.exe 和 pthreadGC2.dll 扔进php-cgi.exe所在的目录
6.将下载到的WinSW.NET4.exe更名为phpservice.exe,放到php-cgi.exe所在的目录下,在该目录下新增文件 phpservice.xml,修改phpservice.xml配置如下
<service> <id>phpservice</id> <name>phpservice</name> <description>phpservice</description> <executable>xxfpm.exe</executable>
<startargument>"E:/ServerCore/php/php-cgi.exe -c E:/ServerCore/php/php.ini"</startargument> <startargument>-n</startargument> <startargument>1</startargument> <startargument>-i</startargument> <startargument>127.0.0.1</startargument> <startargument>-p</startargument> <startargument>9000</startargument> <stopexecutable>taskkill</stopexecutable>
<stopargument>/F</stopargument>
<stopargument>/IM</stopargument> <stopargument>xxfpm.exe</stopargument>
<logpath>logs</logpath> </service>
5.在 E:/ServerCore/php\下执行 phpservice.exe install,即可生成windows服务
Nginx的使用(三)把nginx和php-cgi.exe注册成windows服务的更多相关文章
- Nginx 安装成 Windows 服务
Nginx 安装成Windows 服务方法,具体方法如下 1. 下载nginx windows版本 http://www.nginx.org 2. 下载微软的2个工具: instsrv.exe.srv ...
- Nginx 安装成Windows 服务方法
1. 下载nginx windows版本 http://www.nginx.org 2. 下载微软的2个工具: instsrv.exe.srvany.exe 去微软网站下载安装Windows Serv ...
- Nginx 笔记(三)nginx 配置实例 - 反向代理、负载均衡、动静分离
个人博客网:https://wushaopei.github.io/ (你想要这里多有) 一.反向代理 反向代理准备工作: (1)在 liunx 系统安装 tomcat,使用默认端口 8080 ...
- 用 nssm 把 Nginx 安装成 Windows 服务方法
总之:用 nssm 比 srvany.exe 简便多了.1. 下载nginx windows版本:http://nginx.org/ 2. 下载 nssm :http://nssm.cc/3. 安装N ...
- Nginx之(三)Nginx配置
一个简单的配置文件如下: #定义Nginx运行的用户及用户组 user userName userGroupName; #工作进程数目,根据硬件调整,通常等于CPU数量或者2倍于CPU worker_ ...
- Nginx使用教程(三):Nginx配置性能优化之I/O和TCP配置
配置Nginx I/O <br\> Sendfile 当应用程序传输文件时,内核首先缓冲数据,然后将数据发送到应用程序缓冲区. 应用程序反过来将数据发送到目的地. Sendfile方法是一 ...
- Nginx详解三:Nginx基础篇之yum安装
Nginx快速搭建 Mainline version ----开发版:具有最新功能的版本,用于测试.研究.学习,不用于企业生成环境 Stable version----稳定版:官方认可,且通过测试的 ...
- Nginx安装成Windows服务
因为有项目使用Nginx来做负载均衡,但是Nginx的Windows版本是不提供安装成服务的,所以服务器重启后Nginx并不会伴随启动和恢复.网上查了下,这里记录下解决方法,防止遗忘. 第一步:下载W ...
- Tomcat的三种安装方式:解压版、安装版、配置成Windows服务版
https://blog.csdn.net/Jessica_XLF/article/details/81711429
随机推荐
- Docker:Docker打包Web API成镜像并上传到Docker Hub(2)
Docker官方镜像:https://hub.docker.com/: 本文将把一个webapi制作成docker镜像 一.Docker命令 打开Docker Quickstart,有以下常用的命令 ...
- windows程序设计 vs2012 新建win32项目
1.文件->新建->项目 2.选择win32项目,确定 3.下一步 4.选择windows应用程序,选中空项目,安全开发生命周期不选.点击完成. 5.空项目建好了.
- for loop
https://www.cnblogs.com/EasonJim/p/8315939.html
- 0001-20180421-自动化第一章-python基础学习笔记
======================学习python==================介绍: python种类: cpython(*),jpython,ironpython,rubypyth ...
- 20190402Linux进阶命令week1.2
Linux常用命令详解(week1_day1_2) aliasunaliasunamesuhostnamehistorywhichwcwwhowhoamipingkillseqdudffreedate ...
- saltstack 安装
centos 6.5 saltstack 2015.5.10 (Lithium) tips:上个版本2015.5.3或者5.5有个bug,Python调用salt的unzip模块报错: 安装 在配置了 ...
- pip使用豆瓣的镜像源
豆瓣镜像地址:https://pypi.douban.com/simple/ 虽然用easy_install和pip来安装第三方库很方便 它们的原理其实就是从Python的官方源pypi.python ...
- TTS 语音修复 ,缺少文件的,没注册类的
完美运行 http://bbs.nga.cn/read.php?tid=13292628&rand=492 Win7系统TTS修复-采用原生Win7提取绿色修复 一键自动修复,控制面板里有语音 ...
- Unity3D_UGUI判断鼠标或者手指是否点击在UI上
比如战斗场景,UI和3D场景同时都需要响应触摸事件,如果同时响应可能就会出现触摸UI的时候影响到了3D部分.为了解决这个问题在判断3D响应之前要先判断手指是否点击在UI上. 以前NGUI的时候都是自己 ...
- HADOOP HA 踩坑 - org.apache.hadoop.hdfs.qjournal.protocol.JournalNotFormattedException: Journal Storage Directory /mnt/data1/hadoop/dfs/journal/hdfscluster not formatted
报错:在journalnode的log中: org.apache.hadoop.hdfs.qjournal.protocol.JournalNotFormattedException: Journal ...