3

我在我的数字海洋帐户中使用 Chef 来构建一个液滴/实例。我的服务器是 Ubuntu 12.04 x64 。在我的 Cheffile 我有

...
site 'http://community.opscode.com/api/v1'

cookbook 'apache2',
    :git =>'https://github.com/opscode-cookbooks/apache2'
....

在我的节点 json 中:

...
"apache": {
"default_modules" : 
  ["status","alias","auth_basic","autoindex","dir","env","mime","negotiation","setenvif"]
  },
...
"run_list": [
"recipe[gearman]",
"recipe[postgresql::server]",
"recipe[php]",
"recipe[apache2]",
"recipe[apache2::mod_php5]",
"recipe[mysql]",
"recipe[mysql::server]"

]

由于 authz 的一些错误,我不得不限制模块。但是现在,我总是收到错误

 * The apache2 configtest failed.
STDERR: Output of config test was:
AH00526: Syntax error on line 11 of /etc/apache2/apache2.conf:
Invalid command 'LockFile', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.

我的配置有什么问题导致错误:

  • Apache 传统设置(包含所有模块?)
  • LockFile 的模板错误?
4

3 回答 3

5

看起来这可能是 chef 和 A​​pache2 配方的一个已知问题。

请参阅操作码问题跟踪器上的相关票证。

https://tickets.opscode.com/browse/COOK-3837

https://tickets.opscode.com/browse/COOK-3838

https://tickets.opscode.com/browse/COOK-3900

现在你也许可以尝试通过覆盖属性来安装 2.2 版的 apache

default['apache']['package']
于 2014-02-07T08:04:19.513 回答
3

我已经找到了一个临时的解决方法,至少在食谱更新之前。

替换位于apache2/templates/apache2.conf.erb的配置中的以下部分。

LockFile /var/lock/apache2/accept.lock

有了这个:

Mutex file:${APACHE_LOCK_DIR} default
于 2014-05-17T17:25:34.860 回答
2

我有类似的问题,我只是想使用 chef-solo 用 apache2 流浪我的 ubuntu/trusty64。确切地说是 Ubuntu 14 和 Apache 2.4。

它在以下之后起作用:

  1. 按照上面jmreicha的回答
  2. 删除从http://httpd.apache.org/docs/current/upgrading.html开始从 2.4 中删除的模块“mod_authz_default”

很遗憾,我认为这个基本配置应该可以开箱即用。如上所述,这里计划从 apache2.2 迁移到 apache2.4:https ://tickets.opscode.com/browse/COOK-3900

于 2014-05-25T21:07:23.970 回答