我正在尝试在 Ubuntu Server 12.04 上安装 tomcat 7:
sudo apt-get install tomcat7
我尝试按照这个做安装教程但我立即收到了这个答案:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package tomcat7 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'tomcat7' has no installation candidate
更新:
我尝试tomcat7
按照以下步骤下载并安装本教程。但是当我尝试运行程序时
`$ ./catalina.sh run`
我注意到一些警告 + SEVERE: Cannot start server. Server instance is not configured
:
nazar_art@nazar-desctop:/usr/local/tomcat/apache-tomcat-7.0.42/bin$ ./catalina.sh run
Using CATALINA_BASE: /usr/local/tomcat/apache-tomcat-7.0.42
Using CATALINA_HOME: /usr/local/tomcat/apache-tomcat-7.0.42
Using CATALINA_TMPDIR: /usr/local/tomcat/apache-tomcat-7.0.42/temp
Using JRE_HOME: /usr/lib/jvm/java-7-oracle
Using CLASSPATH: /usr/local/tomcat/apache-tomcat-7.0.42/bin/bootstrap.jar:/usr/local/tomcat/apache-tomcat-7.0.42/bin/tomcat-juli.jar
Jul 25, 2013 8:49:54 PM org.apache.catalina.startup.Catalina load
WARNING: Unable to load server configuration from [/usr/local/tomcat/apache-tomcat-7.0.42/conf/server.xml]
Jul 25, 2013 8:49:54 PM org.apache.catalina.startup.Catalina load
WARNING: Permissions incorrect, read permission is not allowed on the file.
Jul 25, 2013 8:49:54 PM org.apache.catalina.startup.Catalina load
WARNING: Unable to load server configuration from [/usr/local/tomcat/apache-tomcat-7.0.42/conf/server.xml]
Jul 25, 2013 8:49:54 PM org.apache.catalina.startup.Catalina load
WARNING: Permissions incorrect, read permission is not allowed on the file.
Jul 25, 2013 8:49:54 PM org.apache.catalina.startup.Catalina start
SEVERE: Cannot start server. Server instance is not configured.
- 如何解决这个问题并安装
tomcat7
?
答案1
tomcat7
软件包仅在安全存储库中可用,universe 部分适用于 precise、saucy to wily,可在主存储库中使用,并且宇宙中较新的存储库。因此,请确保您的文件中包含/etc/apt/sources.list
以下行:
deb http://security.ubuntu.com/ubuntu precise-security main universe
该行不必完全一致,它可以包含multiverse
和restricted
,但应包含上述所有元素。如果文件中没有该行source.list
,请添加它并运行apt-get update
。现在您应该可以tomcat7
使用。
如果你找不到该source.list
文件
执行:
sudo nano /etc/apt/source.list
然后粘贴到文件中:
deb http://security.ubuntu.com/ubuntu precise-security main universe
按:Ctrl+O保存文件,然后按Ctrl+X退出。
使用 更新包列表
sudo apt-get update
。
我已经安装了 tomcat6
然后你必须删除tomcat6
你的系统,然后再尝试安装tomcat7
sudo apt-get remove tomcat*
sudo apt-get install tomcat7
这将删除所有与 tomcat 相关的软件包,并且安装tomcat7
不会出现问题。
答案2
@nazar_art
您必须安装 tomcat6-common(可能还需要安装类似 Squid HTTP 代理的东西)。
apt-get autoremove tomcat6-common