【问题标题】:How to restart apache server through cygwin and ssh如何通过cygwin和ssh重启apache服务器
【发布时间】:2013-07-13 18:16:40
【问题描述】:

场景是这样的:我在 Windows 7 机器上安装了一个 Apache Web 服务器。同一台机器上安装了cygwin,cygwin配置了ssh。这使我可以远程 ssh 进入 cygwin,然后通过 cygwin,我可以访问这台计算机上的其他文件(甚至那些不在 cygdrive 中的文件)。

我的问题:如果我通过 ssh 远程访问它,如何通过 cygwin 重新启动 Web 服务器?可能吗?谢谢

【问题讨论】:

  • 是的,只需找到并执行应该在 apache 二进制文件目录中的 apachectl 程序。 apachectl restart 是我认为您需要的确切命令行(已经有一段时间了,不是 100% 确定)
  • 我的bin目录下没有apachectl或apache2ctl...你知道怎么找到这个文件吗?
  • 它通常是 Apache 发行版的一部分,但也许它们在 Windows 下以不同的方式解决进程控制管理。如果您将 Apache 安装为服务(很有可能)net stop xxx 后跟 net start xxx,其中 xxx 是 Apache 服务的名称应该可以工作。

标签: apache cygwin


【解决方案1】:

如果你的服务叫Apache,那么像这样:

ssh machine "net stop Apache; net start Apache"

有时它被称为Apache2httpd,具体取决于您的发行版。

【讨论】:

    【解决方案2】:

    在linux中是

    $ sudo service apache2 restart
    or
    $ sudo /etc/init.d/apache2 restart
    

    见:http://httpd.apache.org/docs/2.2/platform/windows.html#winsvchttp://httpd.apache.org/docs/2.2/platform/windows.html#wincons

    【讨论】:

      【解决方案3】:

      你可以试试这个

      $ service httpd restart
      

      $ /etc/init.d/httpd restart
      

      【讨论】:

        猜你喜欢
        • 2012-08-17
        • 2010-12-19
        • 2017-12-11
        • 1970-01-01
        • 2019-04-24
        • 2021-01-25
        • 1970-01-01
        • 2021-03-09
        • 2018-01-28
        相关资源
        最近更新 更多