首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Chef不会在Centos中安装apache2

Chef不会在Centos中安装apache2
EN

Stack Overflow用户
提问于 2013-02-01 19:23:38
回答 1查看 3.2K关注 0票数 0

我正在尝试通过在Centos盒中创建一个LAMP堆栈来弄清楚Chef和Vagrant是如何工作的。使用Chef进行置备时,Apache2安装会显示以下错误:

代码语言:javascript
复制
[2013-02-01T11:00:13+00:00] INFO: package[apache2] installing httpd-2.2.15-15.el6.centos.1 from base repository

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

Error executing action `install` on resource 'package[apache2]'

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


Chef::Exceptions::Exec

----------------------

 returned 1, expected 0


Resource Declaration:

---------------------

# In /tmp/vagrant-chef-1/chef-solo-1/cookbooks/apache2/recipes/default.rb

 20: package "apache2" do
 21:   package_name node['apache']['package']
 22: end
 23: 

Compiled Resource:

------------------

# Declared in /tmp/vagrant-chef-1/chef-solo-1/cookbooks/apache2/recipes/default.rb:20:in `from_file'

package("apache2") do
  package_name "httpd"
  retries 0
  recipe_name "default"
  cookbook_name :apache2
  version "2.2.15-15.el6.centos.1"
  action :install
  retry_delay 2
end

[2013-02-01T11:00:56+00:00] ERROR: Running exception handlers
[2013-02-01T11:00:56+00:00] ERROR: Exception handlers complete
[2013-02-01T11:00:56+00:00] FATAL: Stacktrace dumped to /tmp/vagrant-chef-1/chef-stacktrace.out
[2013-02-01T11:00:56+00:00] FATAL: Chef::Exceptions::Exec: package[apache2] (apache2::default line 20) had an error: Chef::Exceptions::Exec:  returned 1, expected 0
Chef never successfully completed! Any errors should be visible in the
output above. Please fix your recipes so that they properly complete.

我注释掉了Apache2配方,并尝试只安装PHP,但这给出了相同的错误。然而,MYSQL配方可以正常工作,而且安装也很好

基本盒子是用Veewee CentOS-6.3-i386-minimal创建的,这是我使用的食谱:

代码语言:javascript
复制
include_recipe "yum"
include_recipe "apache2"
include_recipe "apache2::mod_php5"
include_recipe "apache2::mod_rewrite"
include_recipe "php"
include_recipe "php::module_mysql"
include_recipe "mysql::server"

所有使用过的食谱都是opscode-cookbooks的最新版本。我不知道如何解决这个问题,是yum找不到软件包的错误,还是de cookbooks中的一些错误的安装代码?

之前安装的Debian盒子与相同的食谱(Apt而不是Yum)工作没有问题。

任何帮助都是非常感谢的。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-02-01 21:46:26

感谢@DracoAter的救命建议。

Ssh`d进入vagrant,并尝试使用yum手动安装软件包。这给出了以下错误:

代码语言:javascript
复制
error: unpacking of archive failed on file /var/www/icons/poweredby.png;510bc31b: cpio: symlink

我的Vagrantfile里有这个

代码语言:javascript
复制
config.vm.share_folder "www", "/var/www", "./www"

这显然阻止了yum对该目录的访问。因此,删除该行可以修复httpd的安装。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14645229

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档