ubuntu服务器下tomcat安装(不推荐使用apt-get)

Posted 87hbteo

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ubuntu服务器下tomcat安装(不推荐使用apt-get)相关的知识,希望对你有一定的参考价值。

最近在阿里云服务器上装tomcat,一开始为了省事直接使用了apt-get安装,结果整个程序被拆开散到了好多地方,尤其是像网上说要把打包好了.war文件放到webapps文件夹下,但是开始并没有在/usr的相关目录下找到,即使后面找到了相关文件,但是等到运行/startup.sh的时候却发现在日志文件里出现了下面的内容:

Dec 23, 2017 11:44:02 AM org.apache.catalina.startup.Catalina initDirs
SEVERE: Cannot find specified temporary folder at /usr/share/tomcat8/temp
Dec 23, 2017 11:44:02 AM org.apache.catalina.startup.Catalina load
WARNING: Unable to load server configuration from [/usr/share/tomcat8/conf/server.xml]
Dec 23, 2017 11:44:02 AM org.apache.catalina.startup.Catalina initDirs
SEVERE: Cannot find specified temporary folder at /usr/share/tomcat8/temp
Dec 23, 2017 11:44:02 AM org.apache.catalina.startup.Catalina load
WARNING: Unable to load server configuration from [/usr/share/tomcat8/conf/server.xml]
Dec 23, 2017 11:44:02 AM org.apache.catalina.startup.Catalina start
SEVERE: Cannot start server. Server instance is not configured.
Dec 23, 2017 11:46:20 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat8/common/classes], exists: [false], isDirectory: [false], canRead: [false]
Dec 23, 2017 11:46:20 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat8/common], exists: [false], isDirectory: [false], canRead: [false]
Dec 23, 2017 11:46:20 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat8/server/classes], exists: [false], isDirectory: [false], canRead: [false]
Dec 23, 2017 11:46:20 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat8/server], exists: [false], isDirectory: [false], canRead: [false]
Dec 23, 2017 11:46:20 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat8/shared/classes], exists: [false], isDirectory: [false], canRead: [false]
Dec 23, 2017 11:46:20 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat8/shared], exists: [false], isDirectory: [false], canRead: [false]
Dec 23, 2017 11:46:20 AM org.apache.catalina.startup.Catalina initDirs
SEVERE: Cannot find specified temporary folder at /usr/share/tomcat8/temp
Dec 23, 2017 11:46:20 AM org.apache.catalina.startup.Catalina load
WARNING: Unable to load server configuration from [/usr/share/tomcat8/conf/server.xml]
Dec 23, 2017 11:46:20 AM org.apache.catalina.startup.Catalina initDirs
SEVERE: Cannot find specified temporary folder at /usr/share/tomcat8/temp
Dec 23, 2017 11:46:20 AM org.apache.catalina.startup.Catalina load
WARNING: Unable to load server configuration from [/usr/share/tomcat8/conf/server.xml]
Dec 23, 2017 11:46:20 AM org.apache.catalina.startup.Catalina start
SEVERE: Cannot start server. Server instance is not configured.

摔,以第四行的server.xml找不到为例,因为apt-get的方法在下载的时候把server.xml放到了/etc/tomcat8里面而startup.sh则放到了/usr/share/tomcat8下,所以实际上根本就没法正常运行,如果要运行就需要改很多地方,所以不如直接删除后放弃,使用别的方式来的更快一些。

不过在这里还是给大家分享一下我找到的apt-get下载的东西都分布在哪里,这样大家到时候如果要删除的话也会更方便(可能不全欢迎大家帮忙补充):

/usr/share/tomcat8

etc/tomcat8   这里主要是一些配置文件(本来etc也是存放配置的)

var/lib/tomcat8/   这里主要是存放webapps等文件

以上是关于ubuntu服务器下tomcat安装(不推荐使用apt-get)的主要内容,如果未能解决你的问题,请参考以下文章

Ubuntu下安装Tomcat7

Ubuntu16.04 下安装tomcat

ubuntu中的solr安装, 环境变量配置

求32位ubuntu环境下的Matlab

Ubuntu安装tomcat

ubuntu下安装Java和tomcat