在Mac OS X Server 10.6上编译,安装和configurationApache 2.2.15后,一切正常。 手动启动时服务器运行正常,没有configuration问题。
然后我添加了一个启动的系统守护进程(在/库/ LaunchDaemons /),加载它,并重新启动。 再次,这似乎工作正常。
但是,由于mod_unique_id的问题,Apache不会在启动时启动,我想。 这里是apache错误日志条目:
[Tue Jun 29 09:01:29 2010] [alert] (EAI 8)nodename nor servname provided, or not known: mod_unique_id: unable to find IPv4 address of "my.server.net" Configuration Failed
在我看来,launchd在启动过程中过早地启动了这项工作,而在反向DNS查询没有完成或正确传播的时候。 如果我通过SSH手动启动Apache,它启动没有错误。 (服务器具有一个静态IP,具有完全限定的域名集。
下面是我的system.log中的一些行:
Jun 29 09:01:29 org.apache.httpd[88]: httpd: apr_sockaddr_info_get() failed for my.server.com Jun 29 09:01:29 org.apache.httpd[88]: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName Jun 29 09:01:29 emond[78]: SetUpLogs: uid = 0 gid = 0 Jun 29 09:01:29 emond[78]: SetUpLogs: opening /Library/Logs/EventMonitor/EventMonitor.error.log Jun 29 09:01:29 sandboxd[100]: kadmind(54) deny network-bind 0.0.0.0:654 Jun 29 09:01:29 sandboxd[100]: kadmind(54) deny network-bind 0.0.0.0:0 Jun 29 09:01:30 loginwindow: Login Window Application Started Jun 29 09:01:30 com.apple.launchd (org.apache.httpd): Exited with exit code: 1 Jun 29 09:01:30 configd: network configuration changed.
这里的日志非常清晰,在networkingconfiguration了有效的IP和DNS名称之前,Apache启动并且无法启动。 但是这不一致,在其他的引导中,networkingconfiguration是先完成的,但问题依然存在。
我试图将httpd.conf中的ServerNamevariables设置为服务器的IP或FQDN,没有帮助。
我有点失落,这就是我来到这里的原因。 网上的许多search也没有帮助我。
我错过了什么?
你可以通过添加如下内容来告诉launchd重新生成守护进程:
<key>KeepAlive</key> <true/>
到启动的.plist文件。 注意:确保你运行的是带有-D FOREGROUND选项的httpd,所以launchd可以正确地跟踪它的状态,也就是说你应该像这样运行它:
<key>ProgramArguments</key> <array> <string>/path/to/httpd</string> <string>-D</string> <string>FOREGROUND</string> </array>
此外,您可能想要将项目的标签(和文件名)更改为org.apache.httpd以外的内容; 在/ System / Library / LaunchDaemons中已经有了一个标签的守护进程,我不确定是否存在标签冲突的可能性。