【问题标题】:Apache 2.4.9 Does Not Respect PidFile DirectiveApache 2.4.9 不遵守 PidFile 指令
【发布时间】:2015-03-04 17:36:59
【问题描述】:

回复:Mac OS X Yosemite 10.10.1、Apache 2.4.9

Apache 2.4.9 似乎忽略了 PidFile 指令,并且总是在 /var/run/httpd.pid 处创建一个进程 ID 文件。这使得不可能启动多个 httpd 实例,每个实例都侦听不同的端口。例如,Apache 2.2.26 就没有这个问题。

所以你自己看看吧:

1) 修改 Apache 的“默认”Mac OS X 配置文件 /etc/apache2/httpd.conf,以包括(在 ServerRoot 之后)一个指令,例如:

PidFile "/var/log/apache2/apache.pid"

2) 如此启动 Apache:

sudo apachectl 启动

3) 观察到指定的 .pid 文件丢失,而 Apache 已创建 /var/run/httpd.pid。

如何解决?

【问题讨论】:

    标签: macos apache osx-yosemite


    【解决方案1】:

    这不是错误。您刚刚忽略了一个事实,即默认配置包括 /etc/apache2/extra/httpd-mpm.conf,它在第 12 行设置了 PidFile:

    #
    # PidFile: The file in which the server should record its process
    # identification number when it starts.
    #
    # Note that this is the default PidFile for most MPMs.
    #
    <IfModule !mpm_netware_module>
        PidFile "/private/var/run/httpd.pid"
    </IfModule>
    

    【讨论】:

      猜你喜欢
      • 2015-03-11
      • 2021-03-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-07-20
      • 2018-09-13
      • 2016-01-21
      • 1970-01-01
      相关资源
      最近更新 更多