zoukankan      html  css  js  c++  java
  • 使用srvany.exe将任何程序作为Windows服务运行

    使用srvany.exe将任何程序作为Windows服务运行

    学习了:http://wangye.org/blog/archives/42/

    https://www.cnblogs.com/huangcong/p/5761557.html

     

    在windows下也可以把zookeeper注册为服务启动。就是在d:www下运行:
    instsrv.exe zookeeper d:wwwsrvany.exe
    然后写一个注册表文件。内容如下:
    Windows Registry Editor Version 5.00
    
    [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServiceszookeeperParameters]
    "Application"="D:\www\zookeeper-3.4.12\bin\zkServer.cmd"
    "AppParameters"=""
    "AppDirectory"="D:\www\zookeeper-3.4.12"

     =====================================================================

    还可以带参数,redis启动的时候带的参数;

    cd /d d:wwwmysql5.5in
    echo install mysql
    mysqld -install
    net start mysql
    
    cd /d d:www
    instsrv nginx d:wwwsrvany.exe
    instsrv php5 d:wwwsrvany.exe
    instsrv.exe redis d:wwwsrvany.exe
    
    regedit -s service.reg
    
    cd d:wwwmemcached
    memcached -d install
    net start memcached
    
    echo "all done"
    Windows Registry Editor Version 5.00
    
    [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesNGINXParameters]
    "Application"="d:\www\nginx\nginx.exe"
    "AppParameters"=""
    "AppDirectory"="d:\www\nginx\"
    
    [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServices
    edisParameters]
    "Application"="d:\www\redis\redis-server.exe"
    "AppParameters"="d:\www\redis\redis.conf"
    "AppDirectory"="d:\www\redis\"
    
    [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesphp5Parameters]
    "Application"="d:\www\php-5.6.36\php-cgi.exe"
    "AppParameters"="-b 127.0.0.1:9000 -q"
    "AppDirectory"="d:\www\php-5.6.36\"
  • 相关阅读:
    ASP.NET Web API 记录请求响应数据到日志的一个方法
    EF删除集中方法对比
    CSS 的优先级机制[总结]
    sql备份命令
    sql两张表关联更新字段
    VSCode隐藏node_modules目录
    C# RSACryptoServiceProvider加密解密签名验签和DESCryptoServic
    模拟退火(转)
    HNOI2006-鬼谷子的钱袋
    HNOI2006-公路修建问题(二分答案+并查集)
  • 原文地址:https://www.cnblogs.com/stono/p/9039053.html
Copyright © 2011-2022 走看看