yum安装tomcat8 CentOS 6

问题描述 投票:1回答:2

我想保留在yum生态系统中,以便我可以更轻松地捕获更新,因此想要将更高版本的tomcat安装到我的CentOS 6.9机器上。但是当然CentOS 6.9并没有通过yum为tomcat6提供任何tomcat:

sudo yum search tomcat
Loaded plugins: auto-update-debuginfo, fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base: mirror.jaleco.com
 * epel: reflector.westga.edu
 * epel-debuginfo: reflector.westga.edu
 * extras: mirror.jaleco.com
 * rpmforge: mirror.lstn.net
 * rpmfusion-free-updates: mirror.math.princeton.edu
 * rpmfusion-free-updates-debuginfo: mirror.math.princeton.edu
 * rpmfusion-nonfree-updates: mirror.math.princeton.edu
 * rpmfusion-nonfree-updates-debuginfo: mirror.math.princeton.edu
 * updates: ftp.osuosl.org
===================================================== N/S Matched: 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.i686 : 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.i686 : Tomcat native library
tomcat-native-debuginfo.i686 : Debug information for package tomcat-native
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-admin-webapps.noarch : The host-manager and manager web applications for Apache Tomcat
tomcat6-debuginfo.i686 : Debug information for package tomcat6
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-log4j.noarch : Log4J support for Apache Tomcat
tomcat6-servlet-2.5-api.noarch : Apache Tomcat Servlet API implementation classes
tomcat6-webapps.noarch : The ROOT and examples web applications for Apache Tomcat
tomcatjss.noarch : JSSE implementation using JSS for Tomcat
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.noarch : Apache Servlet/JSP Engine, RI for Servlet 2.5/JSP 2.1 API
tomcat6-el-2.1-api.noarch : Expression Language v1.0 API

那么让我安装任何我想使用yum的tomcat版本最安全的方法是什么?我是否需要偶尔添加另一个存储库?

3/4/2019更新,基于user3788685的建议:

sudo yum-config-manager --enable epel-testing
Loaded plugins: auto-update-debuginfo, fastestmirror, refresh-packagekit
=============================================================================================== repo: epel-testing ===============================================================================================
[epel-testing]
bandwidth = 0
base_persistdir = /var/lib/yum/repos/i386/6
baseurl = 
cache = 0
cachedir = /var/cache/yum/i386/6/epel-testing
cost = 1000
enabled = 1
enablegroups = True
exclude = 
failovermethod = priority
ftp_disable_epsv = False
gpgcadir = /var/lib/yum/repos/i386/6/epel-testing/gpgcadir
gpgcakey = 
gpgcheck = True
gpgdir = /var/lib/yum/repos/i386/6/epel-testing/gpgdir
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
hdrdir = /var/cache/yum/i386/6/epel-testing/headers
http_caching = all
includepkgs = 
keepalive = True
mdpolicy = group:primary
mediaid = 
metadata_expire = 21600
metalink = 
mirrorlist = https://mirrors.fedoraproject.org/metalink?repo=testing-epel6&arch=i386
mirrorlist_expire = 86400
name = Extra Packages for Enterprise Linux 6 - Testing - i386
old_base_cache_dir = 
password = 
persistdir = /var/lib/yum/repos/i386/6/epel-testing
pkgdir = /var/cache/yum/i386/6/epel-testing/packages
proxy = False
proxy_dict = 
proxy_password = 
proxy_username = 
repo_gpgcheck = False
retries = 10
skip_if_unavailable = False
ssl_check_cert_permissions = True
sslcacert = 
sslclientcert = 
sslclientkey = 
sslverify = True
throttle = 0
timeout = 30.0
username = 


sudo yum search tomcat        
Loaded plugins: auto-update-debuginfo, fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base: mirror.metrocast.net
 * epel: archive.linux.duke.edu
 * epel-debuginfo: archive.linux.duke.edu
 * epel-testing: archive.linux.duke.edu
 * epel-testing-debuginfo: archive.linux.duke.edu
 * extras: ftp.osuosl.org
 * rpmforge: mirror.lstn.net
 * rpmfusion-free-updates: mirror.math.princeton.edu
 * rpmfusion-free-updates-debuginfo: mirror.math.princeton.edu
 * rpmfusion-nonfree-updates: mirror.math.princeton.edu
 * rpmfusion-nonfree-updates-debuginfo: mirror.math.princeton.edu
 * updates: mirror.steadfastnet.com
============================================================================================== N/S Matched: 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.i686 : 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.i686 : Tomcat native library
tomcat-native-debuginfo.i686 : Debug information for package tomcat-native
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-admin-webapps.noarch : The host-manager and manager web applications for Apache Tomcat
tomcat6-debuginfo.i686 : Debug information for package tomcat6
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-log4j.noarch : Log4J support for Apache Tomcat
tomcat6-servlet-2.5-api.noarch : Apache Tomcat Servlet API implementation classes
tomcat6-webapps.noarch : The ROOT and examples web applications for Apache Tomcat
tomcatjss.noarch : JSSE implementation using JSS for Tomcat
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.noarch : Apache Servlet/JSP Engine, RI for Servlet 2.5/JSP 2.1 API
tomcat6-el-2.1-api.noarch : Expression Language v1.0 API

  Name and summary matches only, use "search all" for everything.

more /etc/yum.repos.d/epel-testing.repo 
[epel-testing]
name=Extra Packages for Enterprise Linux 6 - Testing - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/testing/6/$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=testing-epel6&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

[epel-testing-debuginfo]
name=Extra Packages for Enterprise Linux 6 - Testing - $basearch - Debug
#baseurl=http://download.fedoraproject.org/pub/epel/testing/6/$basearch/debug
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=testing-debug-epel6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=1

[epel-testing-source]
name=Extra Packages for Enterprise Linux 6 - Testing - $basearch - Source
#baseurl=http://download.fedoraproject.org/pub/epel/testing/6/SRPMS
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=testing-source-epel6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=1
tomcat centos6 yum
2个回答
1
投票

epel-testing回购提供Tomcat-7.0.92

$yum info tomcat
Installed Packages
Name        : tomcat
Arch        : noarch
Version     : 7.0.92
Release     : 1.el6
Size        : 314 k
Repo        : installed
From repo   : epel-testing
Summary     : Apache Servlet/JSP Engine, RI for Servlet 3.0/JSP 2.2 API
URL         : http://tomcat.apache.org/
License     : ASL 2.0

检查/etc/yum.repos.d/epel.repo,看看你是否有文件,如果你在里面检查/设置enabled=1,你应该能够安装。

如果您错过了文件,您需要的部分如下;

[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

[epel-testing]
name=Extra Packages for Enterprise Linux 6 - Testing - $basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=testing-epel6&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

从那里你可以像任何新版本一样正常做yum update


0
投票

对我来说,推荐和最安全的方法是手动安装您想要的版本。我们不得不在生产中处理相同的事情(rhel6和rhel7)并且我们决定下载官方的tomcat版本并将其打包为rpm以及所有必要的(tomcat用户和组创建和systemd init脚本)你这样做一次就这样。我可以给你一个示例rpm构建脚本和spec文件。

© www.soinside.com 2019 - 2024. All rights reserved.