使用Tomcat Cookbook安装tomcat7

使用Tomcat Cookbook安装tomcat7,tomcat,chef-infra,vagrant,cookbook,Tomcat,Chef Infra,Vagrant,Cookbook,在我的CentOS 6.5机器上使用vagrant Berkshellf,我试图将7指定为要安装的Tomcat版本: "tomcat" => { "base_version" => "7" } 然而,当我试图运行《流浪者条款》时,我遇到了一个错误: [2014-03-21T18:23:50+00:00] ERROR: package[tomcat7] (tomcat::default line 45) had an error: Chef

在我的CentOS 6.5机器上使用
vagrant Berkshellf
,我试图将7指定为要安装的Tomcat版本:

    "tomcat" => {
      "base_version" => "7"
    }
然而,当我试图运行《流浪者条款》时,我遇到了一个错误:

[2014-03-21T18:23:50+00:00] ERROR: package[tomcat7] (tomcat::default line 45) 
       had an error: Chef::Exceptions::Package: No version specified, 
       and no candidate version available for tomcat7
此操作码“添加对Tomcat7的支持”标记为“已修复”,但它仅显示为针对Ubuntu12.04的测试。我不确定这是否意味着(a)它没有在CentOS上测试过,或者(b)它从未在CentOS上损坏过


如何在Chef的“流浪者”盒子上使用tomcat7?

tomcat7似乎还不在centos6.5的标准/epel存储库中

[root@secure36 rfridman]# cat /etc/issue
CentOS release 6.5 (Final)

[root@secure36 rfridman]# yum search tomcat
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
 * base: mirror.atlanticmetro.net
 * epel: mirror.symnds.com
 * extras: mirror.es.its.nyu.edu
 * updates: mirror.cogentco.com
==================================================================== N/S Matched: tomcat =====================================================================
tomcatjss.noarch : JSSE implementation using JSS for Tomcat
apache-tomcat-apis.noarch : Tomcat Servlet and JSP APIs
jakarta-commons-collections-tomcat5.noarch : Jakarta Commons Collection dependency for Tomcat5
jakarta-commons-dbcp-tomcat5.noarch : DBCP dependency for Tomcat5
jakarta-commons-pool-tomcat5.x86_64 : Pool dependency for Tomcat5
jglobus-ssl-proxies-tomcat.noarch : Globus Java - SSL and proxy certificate support for Tomcat
tomcat-admin-webapps.noarch : The host-manager and manager web applications for Apache Tomcat
tomcat-docs-webapp.noarch : The docs web application for Apache Tomcat
tomcat-javadoc.noarch : Javadoc generated documentation for Apache Tomcat
tomcat-jsp-2.2-api.noarch : Apache Tomcat JSP API implementation classes
tomcat-jsvc.noarch : Apache jsvc wrapper for Apache Tomcat as separate service
tomcat-lib.noarch : Libraries needed to run the Tomcat Web container
tomcat-native.x86_64 : Tomcat native library
tomcat-servlet-3.0-api.noarch : Apache Tomcat Servlet API implementation classes
tomcat-webapps.noarch : The ROOT and examples web applications for Apache Tomcat
tomcat6.noarch : Apache Servlet/JSP Engine, RI for Servlet 2.5/JSP 2.1 API
tomcat6-admin-webapps.noarch : The host-manager and manager web applications for Apache Tomcat
tomcat6-docs-webapp.noarch : The docs web application for Apache Tomcat
tomcat6-javadoc.noarch : Javadoc generated documentation for Apache Tomcat
tomcat6-jsp-2.1-api.noarch : Apache Tomcat JSP API implementation classes
tomcat6-lib.noarch : Libraries needed to run the Tomcat Web container
tomcat6-servlet-2.5-api.noarch : Apache Tomcat Servlet API implementation classes
tomcat6-webapps.noarch : The ROOT and examples web applications for Apache Tomcat
glite-security-trustmanager-tomcat6.noarch : Java trustmanager interface supporting a GSI grid name space
tomcat.noarch : Apache Servlet/JSP Engine, RI for Servlet 3.0/JSP 2.2 API
tomcat-el-2.2-api.noarch : Expression Language v1.0 API
tomcat6-el-2.1-api.noarch : Expression Language v1.0 API

您应该尝试从源代码处编译tomcat7,或者尝试查找包含tomcat7的存储库,并将其添加到您的cookbooks配置中。

tomcat7在此处显示的列表中

yum info tomcat
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.mirror.ndchost.com
 * epel: mirror.vcu.edu
 * extras: centos.sonn.com
 * updates: mirror.atlanticmetro.net
Available Packages
Name        : tomcat
Arch        : noarch
Version     : 7.0.33
Release     : 3.el6
Size        : 86 k
Repo        : epel
Summary     : Apache Servlet/JSP Engine, RI for Servlet 3.0/JSP 2.2 API
URL         : http://tomcat.apache.org/
License     : ASL 2.0
Description : Tomcat is the servlet container that is used in the official Reference
            : Implementation for the Java Servlet and JavaServer Pages technologies.
            : The Java Servlet and JavaServer Pages specifications are developed by
            : Sun under the Java Community Process.
            : 
            : Tomcat is developed in an open and participatory environment and
            : released under the Apache Software License version 2.0. Tomcat is intended
            : to be a collaboration of the best-of-breed developers from around the world.

这个问题在tomcat的食谱中。它正在寻找tomcat7软件包。

遇到同样的问题; 我的“快速修复”:对tomcat7使用JPackage repo(就像配方要求的那样,它被称为tomcat7)

有两个问题:

  • 在CentOS上,Tomcat7包(7.0.33-3.el6)位于EPEL中,简称为“tomcat”
  • 目前,这个软件包是有缺陷的。[请参阅:较新版本(7.0.33-4.el6)修复了此问题,但目前它位于epel测试存储库中
  • 见:

    我的临时解决方案是编写一个wrapper-Chef-recipe,通过包管理器安装EPEL repo和bug-fix tomcat7包。类似于:

    # BERKSHELF
    cookbook "yum", "~> 3.2.0"
    cookbook "yum-epel", "~> 0.3.6"
    
    
    # CHEF
    override['yum']['epel-testing']['enabled'] = true
    package 'tomcat'
    

    我不能也获取二进制文件吗?我很好奇为什么您会列出(1)源代码或(2)更新yum repo作为可能的答案。当然可以。虽然如果您同时拥有x86和x64体系结构,您将需要两个二进制文件。对于每个不同的centos版本,您可以告诉我一些值得信赖的/官方的yum/rpm repo来安装tomcat7吗?