精华内容
下载资源
问答
  • Linux tomcat 错误 解决 java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.webresources.StandardRoot@1b68ddbd] 8 16:30:08....

    Linux tomcat 错误 解决 java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.webresources.StandardRoot@1b68ddbd]

    8 16:30:08.331 SEVERE [main] org.apache.catalina.core.ContainerBase.startInternal A child container failed during start
    java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.webresources.StandardRoot@1b68ddbd]
    at java.util.concurrent.FutureTask.report(FutureTask.java:122)
    at java.util.concurrent.FutureTask.get(FutureTask.java:192)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:951)
    at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.ContainerBase S t a r t C h i l d . c a l l ( C o n t a i n e r B a s e . j a v a : 1429 ) a t o r g . a p a c h e . c a t a l i n a . c o r e . C o n t a i n e r B a s e StartChild.call(ContainerBase.java:1429) at org.apache.catalina.core.ContainerBase StartChild.call(ContainerBase.java:1429)atorg.apache.catalina.core.ContainerBaseStartChild.call(ContainerBase.java:1419)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
    at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:944)
    at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:261)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:682)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:350)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:492)
    Caused by: org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.webresources.StandardRoot@1b68ddbd]
    at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:441)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
    at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4758)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4893)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.ContainerBase S t a r t C h i l d . c a l l ( C o n t a i n e r B a s e . j a v a : 1429 ) a t o r g . a p a c h e . c a t a l i n a . c o r e . C o n t a i n e r B a s e StartChild.call(ContainerBase.java:1429) at org.apache.catalina.core.ContainerBase StartChild.call(ContainerBase.java:1429)atorg.apache.catalina.core.ContainerBaseStartChild.call(ContainerBase.java:1419)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
    at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:944)
    … 21 more
    Caused by: java.lang.IllegalArgumentException: The main resource set specified [/LjManager] is not valid
    at org.apache.catalina.webresources.StandardRoot.createMainResourceSet(StandardRoot.java:749)
    at org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:706)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    … 30 more

    30-Nov-2018 16:30:08.333 SEVERE [main] org.apache.catalina.core.ContainerBase.startInternal A child container failed during start
    java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: A child container failed during start
    at java.util.concurrent.FutureTask.report(FutureTask.java:122)
    at java.util.concurrent.FutureTask.get(FutureTask.java:192)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:951)
    at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:261)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:682)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:350)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:492)
    Caused by: org.apache.catalina.LifecycleException: A child container failed during start
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:960)
    at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.ContainerBase S t a r t C h i l d . c a l l ( C o n t a i n e r B a s e . j a v a : 1429 ) a t o r g . a p a c h e . c a t a l i n a . c o r e . C o n t a i n e r B a s e StartChild.call(ContainerBase.java:1429) at org.apache.catalina.core.ContainerBase StartChild.call(ContainerBase.java:1429)atorg.apache.catalina.core.ContainerBaseStartChild.call(ContainerBase.java:1419)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
    at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:944)
    … 13 more
    Caused by: java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.webresources.StandardRoot@33f88ab]
    at java.util.concurrent.FutureTask.report(FutureTask.java:122)
    at java.util.concurrent.FutureTask.get(FutureTask.java:192)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:951)
    … 21 more
    Caused by: org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.webresources.StandardRoot@33f88ab]
    at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:441)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
    at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4758)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4893)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.ContainerBase S t a r t C h i l d . c a l l ( C o n t a i n e r B a s e . j a v a : 1429 ) a t o r g . a p a c h e . c a t a l i n a . c o r e . C o n t a i n e r B a s e StartChild.call(ContainerBase.java:1429) at org.apache.catalina.core.ContainerBase StartChild.call(ContainerBase.java:1429)atorg.apache.catalina.core.ContainerBaseStartChild.call(ContainerBase.java:1419)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
    at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:944)
    … 21 more
    Caused by: java.lang.IllegalArgumentException: The main resource set specified [/LjManager] is not valid
    at org.apache.catalina.webresources.StandardRoot.createMainResourceSet(StandardRoot.java:749)
    at org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:706)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    … 30 more

    30-Nov-2018 16:30:08.335 SEVERE [main] org.apache.catalina.core.ContainerBase.startInternal A child container failed during start
    java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: A child container failed during start
    at java.util.concurrent.FutureTask.report(FutureTask.java:122)
    at java.util.concurrent.FutureTask.get(FutureTask.java:192)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:951)
    at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:261)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:682)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:350)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:492)
    Caused by: org.apache.catalina.LifecycleException: A child container failed during start
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:960)
    at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.ContainerBase S t a r t C h i l d . c a l l ( C o n t a i n e r B a s e . j a v a : 1429 ) a t o r g . a p a c h e . c a t a l i n a . c o r e . C o n t a i n e r B a s e StartChild.call(ContainerBase.java:1429) at org.apache.catalina.core.ContainerBase StartChild.call(ContainerBase.java:1429)atorg.apache.catalina.core.ContainerBaseStartChild.call(ContainerBase.java:1419)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
    at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:944)
    … 13 more
    Caused by: java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.webresources.StandardRoot@1b68ddbd]
    at java.util.concurrent.FutureTask.report(FutureTask.java:122)
    at java.util.concurrent.FutureTask.get(FutureTask.java:192)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:951)
    … 21 more
    Caused by: org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.webresources.StandardRoot@1b68ddbd]
    at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:441)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
    at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4758)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4893)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.ContainerBase S t a r t C h i l d . c a l l ( C o n t a i n e r B a s e . j a v a : 1429 ) a t o r g . a p a c h e . c a t a l i n a . c o r e . C o n t a i n e r B a s e StartChild.call(ContainerBase.java:1429) at org.apache.catalina.core.ContainerBase StartChild.call(ContainerBase.java:1429)atorg.apache.catalina.core.ContainerBaseStartChild.call(ContainerBase.java:1419)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
    at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:944)
    … 21 more
    Caused by: java.lang.IllegalArgumentException: The main resource set specified [/LjManager] is not valid
    at org.apache.catalina.webresources.StandardRoot.createMainResourceSet(StandardRoot.java:749)
    at org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:706)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    … 30 more

    30-Nov-2018 16:30:08.337 SEVERE [main] org.apache.catalina.startup.Catalina.start The required Server component failed to start so Tomcat is unable to start.
    org.apache.catalina.LifecycleException: A child container failed during start
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:960)
    at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:261)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:682)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:350)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:492)
    Caused by: org.apache.tomcat.util.MultiThrowable: 2 wrapped Throwables: [org.apache.catalina.LifecycleException: A child container failed during start][org.apache.catalina.LifecycleException: A child container failed during start]
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:947)
    … 13 more

    错误原因:

    docBase 中写错了 注意修改 我改完就好了

    <Context path="" docBase="*****"/>
    
    展开全文
  • linux 开机启动tomcat程序和jar程序

    千次阅读 2015-06-17 14:59:23
    在最下面加上你要执行的脚本,例如我要加一个tomcat的项目和jar程序 /home/cxb/bin/tomcat.sh start nohup /usr/local/jdk/jdk1.8.0_31/bin/java -jar /home/test/test.jar 加上这两句话即可,这个时候得去编

    首先使用root登录服务器

    cat /etc/rc.d/rc.local


    在最下面加上你要执行的脚本,例如我要加一个tomcat的项目和jar程序

    /home/cxb/bin/tomcat.sh start

    nohup /usr/local/jdk/jdk1.8.0_31/bin/java -jar /home/test/test.jar

    加上这两句话即可,这个时候得去编辑tomcat下面的catalina.sh

    这个catalina.sh文件中会加载一些环境变量,而在开机的时候是不能加载这些环境变量的,所以得在catalina.sh脚本中配置这些环境变量

    启动tomcat的时候可以看到他加载了下面


    那么我们就得把原先配置在/etc/profile中的环境变量写入catalina.sh

    vi catalina.sh


    开机启动配置
    export JAVA_HOME=/usr/local/jdk/jdk1.8.0_31
    export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
    export PATH=$PATH:$JAVA_HOME/bin
    export CATALINA_HOME=/usr/local/tomcat/apache-tomcat-8.0.18

    在最上面加入这几个变量即可,重新开机试试吧。

    另外为了调试/etc/rc.d/rc/rc.local是否真的起了作用,你可以在/etc/rc.d/rc/rc.local加入

    echo "test" >/root/test.log 这句话来测试,开机后在/root下面是不是有test.log这个文件。

    展开全文
  • Linux Tomcat远程调试

    2016-04-20 15:27:37
    一. 应用场景 在实际的测试过程中,可能会遇到由于程序执行的不间断性,我们无法构造测试场景来验证某个功能的正确性,只有通过代码...1、部署服务工程到Linux系统下的Tomcat中,本文档重点是远程调式,为了防止文档

    一.      应用场景


    在实际的测试过程中,可能会遇到由于程序执行的不间断性,我们无法构造测试场景来验证某个功能的正确性,只有通过代码级的调试才能验证功能是否正确。然而开发本地调试的话,不具有说服力,这时我们测试人员必须连接到linux下的基线版本代码进行远程调试

         
    二.调试步骤

    1、部署服务工程到Linux系统下的Tomcat中,本文档重点是远程调式,为了防止文档篇幅累赘,这里就不介绍部署工程了。

     

    2、更改tomcat远程调试端口

    (1).更改Linux系统上的Tomcat启动文件远程调试端口,登录服务器,找到Tomcat安装路径,进入到bin目录

     

    (2).打开目录下的catalina.sh文件,找到JPDA_ADDRESS=”8000”,8000代表远程调试端口,可以更改成其他没有被占用的端口,更改完成后保存退出。如下图

     

    3.以debug模式启动Tomcat

    (1).进入tomcat的bin目录,输入./catalina.sh jpda run或者./catalina.sh jpda start命令启动tomcat

     

    4.配置MyEclipse远程调试

    (1).在需要远程调试的类中选择Debug Configurations菜单打开配置界面,如下图:

     

     

     

    (2)在左边列表中双击Remote Java Application项,添加要调试的类,然后在右边添加Host项和Port项后点击<Debug>按钮。

    Host代表Tomcat所在的Linux服务器IP

    Port代表catalina.sh中配置的远程调试端口

     

     

     

    5.打开IE浏览器,输入URL连接提交请求,此时你在MyEclipse里面是不是看到了代码运行到了断点出就不往下运行了?

    如下图所示:

     

     

     

     

    三、通过以上步骤就可以在本地连接到远程服务器上代码,从而进行代码级的测试了。



    转自http://blog.csdn.net/xh16319/article/details/14545065 

    展开全文
  • Linux Tomcat 6.0安装配置实践总结

    千次阅读 2018-08-16 16:51:38
    系统环境: Red Hat Enterprise Linux Server release 5.7 (Tikanga) 64位 Tomcat下载 从官方网站 http://tomcat.
    原文地址为:
    Linux Tomcat 6.0安装配置实践总结
    


    系统环境:
    Red Hat Enterprise Linux Server release 5.7 (Tikanga)  64位

    Tomcat下载


    从官方网站 http://tomcat.apache.org/下载你需要的Tomcat版本,目前Tomcat主要版本有Tomcat 6.0、Tomcat 7.0、Tomcat 8.0三个版本,下面我们以6.0(6.0.39)版本为例, 下载URL地址:http://tomcat.apache.org/download-60.cgi ,如果你需要下载Tomcat 6.0下的其它版本,点击链接地址“Archiveshttp://archive.apache.org/dist/tomcat/tomcat-6/ 即可查看到你需要的版本。

     

    Tomcat安装


     

    Step 1:安装配置JDK


        关于JDK的安装配置细节可以参考我以前的博客lRedhat Linux安装JDK 1.7,JDK最好选择合适的版本,这里我为了方便省事,就安装了JDK1.7.

       1: [root@DB-Server tmp]# chmod +x jdk-7u25-linux-x64.rpm  
       2:  
       3: [root@DB-Server tmp]# rpm -ivh jdk-7u25-linux-x64.rpm  
       4: Preparing... ########################################### [100%] 
       5:    1:jdk ########################################### [100%] 
       6: Unpacking JAR files... 
       7:         rt.jar... 
       8:         jsse.jar... 
       9:         charsets.jar... 
      10:         tools.jar... 
      11:         localedata.jar... 
      12: [root@DB-Server tmp]# cd /usr/java/

    配置环境变量,在etc/profile文件下添加

    export JAVA_HOME=/usr/java/jdk1.7.0_25
    export CLASSPATH=/usr/java/jdk1.7.0_25/lib
    export PATH=$JAVA_HOME/bin:$PATH

       1: [root@DB-Server jdk1.7.0_25]# vi /etc/profile
       2: [root@DB-Server jdk1.7.0_25]# source /etc/profile   --生效修改配置信息
       3:  
       4: [root@DB-Server jdk1.7.0_25]# echo $JAVA_HOME
       5: /usr/java/jdk1.7.0_25
       6: [root@DB-Server jdk1.7.0_25]# echo $CLASSPATH
       7: /usr/java/jdk1.7.0_25/lib
       8: [root@DB-Server jdk1.7.0_25]# java -version
       9: java version "1.7.0_25"
      10: Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
      11: Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)
      12: [root@DB-Server jdk1.7.0_25]# 

    Step 2:安装Tomcat

       1: [root@DB-Server tmp]#tar zxvf apach-tomcat-6.0.16.tar.gz
       2:  
       3: [root@DB-Server tmp]#mkdir /usr/local/tomcat
       4:  
       5: [root@DB-Server tmp]# mv apache-tomcat-6.0.39 /usr/local/ tomcat
       6:  
       7:  
       8: [root@DB-Server tomcat]# vi /etc/profile
       9:  
      10: export TOMCAT_HOME=/usr/local/tomcat
      11:  
      12:  
      13: [root@DB-Server tomcat]# source /etc/profile
      14: [root@DB-Server tomcat]# echo $TOMCAT_HOME
      15: /usr/local/tomcat
      16:  
      17:  
      18: [root@DB-Server bin]# pwd
      19: /usr/local/tomcat/apache-tomcat-6.0.39/bin
      20: [root@DB-Server bin]# ./startup.sh
      21: Using CATALINA_BASE: /usr/local/tomcat/apache-tomcat-6.0.39
      22: Using CATALINA_HOME: /usr/local/tomcat/apache-tomcat-6.0.39
      23: Using CATALINA_TMPDIR: /usr/local/tomcat/apache-tomcat-6.0.39/temp
      24: Using JRE_HOME: /usr/java/jdk1.7.0_25
      25: Using CLASSPATH: /usr/local/tomcat/apache-tomcat-6.0.39/bin/bootstrap.jar

    如果需要指定Tomcat在某个账号下运行或管理,则可以通过下面脚本:例如,我要创建一个tomcat的账号

       1: [root@DB-Server ~]# groupadd tomcat
       2:  
       3: [root@DB-Server ~]# useradd -g tomcat -d /home/tomcat -u 502 tomcat
       4:  
       5: Creating mailbox file: File exists
       6:  
       7: [root@DB-Server tomcat]# chown -Rf    tomcat.tomcat   /usr/local/tomcat/
       8:  
       9: [root@DB-Server tomcat]#passwd tomcat
      10:  
      11: Changing password for user tomcat.
      12:  
      13: New UNIX password: 
      14:  
      15: Retype new UNIX password: 
      16:  
      17: passwd: all authentication tokens updated successfully.

    在浏览器里面输入http://localhost:8080/  (默认端口为8080,可以修改该端口号) 验证Tomcat是否安装成功,如果安装成功,则会看到Tomcat的index.jsp并证明Tomcat启动成功了

    Tomcat配置


    关于Tomcat的目录结构,可以参考下面简单的描述,

    [root@DB-Server apache-tomcat-6.0.39]# ls

    bin       lib                logs           RELEASE-NOTES      temp     work

    conf     LICENSE     NOTICE     RUNNING.txt               webapps

        主目录下面有bin、lib等目录

        bin            存放Tomcat启动、停止服务程序以及一些其他脚本程序

        lib             存放Tomcat运行需要的jar包

        log            存放Tomcat运行的相关日志文件

        conf          存放Tomcat配置文件。例如server.xml 、 web.xml等

        temp         存放Tomcat运行的临时文件。

        webapps   Web应用的发布目录,默认情况下把Web应用文件放于此目录。

        work          Tomcat的工作目录,默认情况下把编译JSP文件生成的servlet类文件放于此目录下

    1:启动Tomcat服务

       1: [root@DB-Server bin]# ./startup.sh
       2:  
       3: Using CATALINA_BASE: /usr/local/tomcat/apache-tomcat-6.0.39
       4:  
       5: Using CATALINA_HOME: /usr/local/tomcat/apache-tomcat-6.0.39
       6:  
       7: Using CATALINA_TMPDIR: /usr/local/tomcat/apache-tomcat-6.0.39/temp
       8:  
       9: Using JRE_HOME: /usr/java/jdk1.7.0_25
      10:  
      11: Using CLASSPATH: /usr/local/tomcat/apache-tomcat-6.0.39/bin/bootstrap.jar

    2:关闭Tomcat服务

       1: [root@DB-Server bin]# ./shutdown.sh
       2:  
       3: Using CATALINA_BASE: /usr/local/tomcat/apache-tomcat-6.0.39
       4:  
       5: Using CATALINA_HOME: /usr/local/tomcat/apache-tomcat-6.0.39
       6:  
       7: Using CATALINA_TMPDIR: /usr/local/tomcat/apache-tomcat-6.0.39/temp
       8:  
       9: Using JRE_HOME: /usr/java/jdk1.7.0_25
      10:  
      11: Using CLASSPATH: /usr/local/tomcat/apache-tomcat-6.0.39/bin/bootstrap.jar
      12:  
      13: [root@DB-Server bin]#

    3:查看Tomcat版本

           有时候,如果当你接手去管理Tomcat,  可能你要了解一下Tomcat的版本信息,以及配置,那么怎么查看呢,去Tomcat的主目录下的bin目录下,执行version.sh,你就能查看到很多详细信息。

       1: [root@DB-Server bin]# ./version.sh
       2:  
       3: Using CATALINA_BASE: /usr/local/tomcat/apache-tomcat-6.0.39
       4:  
       5: Using CATALINA_HOME: /usr/local/tomcat/apache-tomcat-6.0.39
       6:  
       7: Using CATALINA_TMPDIR: /usr/local/tomcat/apache-tomcat-6.0.39/temp
       8:  
       9: Using JRE_HOME: /usr/java/jdk1.7.0_25
      10:  
      11: Using CLASSPATH: /usr/local/tomcat/apache-tomcat-6.0.39/bin/bootstrap.jar
      12:  
      13: Server version: Apache Tomcat/6.0.39
      14:  
      15: Server built: Jan 27 2014 10:40:33
      16:  
      17: Server number: 6.0.39.0
      18:  
      19: OS Name: Linux
      20:  
      21: OS Version: 2.6.18-274.el5
      22:  
      23: Architecture: amd64
      24:  
      25: JVM Version: 1.7.0_25-b15
      26:  
      27: JVM Vendor: Oracle Corporation
      28:  

    4:设置管理密码

        如果你要进入Tomcat的管理页面:http://localhost:8080/manager/html ,这时会弹出下面认证界面,需要你输入用户名和密码,如果你没有配置过或者你忘了用户名、密码,那么应该找那个配置文件呢?其实你都可以通过配置文件tomcat-users.xml 来解决

    clipboard

       1: [root@DB-Server conf]# more tomcat-users.xml
       2:  
       3: xml version='1.0' encoding='utf-8'?>
       4:  
       5: --
       6:  
       7: Licensed to the Apache Software Foundation (ASF) under one or more
       8:  
       9: contributor license agreements. See the NOTICE file distributed with
      10:  
      11: this work for additional information regarding copyright ownership.
      12:  
      13: The ASF licenses this file to You under the Apache License, Version 2.0
      14:  
      15: (the "License"); you may not use this file except in compliance with
      16:  
      17: the License. You may obtain a copy of the License at
      18:  
      19:     http://www.apache.org/licenses/LICENSE-2.0
      20:  
      21: Unless required by applicable law or agreed to in writing, software
      22:  
      23: distributed under the License is distributed on an "AS IS" BASIS,
      24:  
      25: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      26:  
      27: See the License for the specific language governing permissions and
      28:  
      29: limitations under the License.
      30:  
      31: >
      32:  
      33: omcat-users>
      34:  
      35: --
      36:  
      37: NOTE: By default, no user is included in the "manager-gui" role required
      38:  
      39: to operate the "/manager/html" web application. If you wish to use this app,
      40:  
      41: you must define such a user - the username and password are arbitrary.
      42:  
      43: >
      44:  
      45: --
      46:  
      47: NOTE: The sample user and role entries below are wrapped in a comment
      48:  
      49: and thus are ignored when reading this file. Do not forget to remove
      50:  
      51: <!.. ..> that surrounds them.
      52:  
      53: >
      54:  
      55: --
      56:  
      57: <role rolename="tomcat"/>
      58:  
      59: <role rolename="role1"/>
      60:  
      61: <user username="tomcat" password="tomcat" roles="tomcat"/>
      62:  
      63: <user username="both" password="tomcat" roles="tomcat,role1"/>
      64:  
      65: <user username="role1" password="tomcat" roles="role1"/>
      66:  
      67: >
      68:  
      69: tomcat-users> 
      70:  

    修改配置文件前,要养成首先备份一份配置文件的习惯,以防需要回滚到最初设置时,忘了自己修改过哪些配置。一般建议源文件+日期+bak

    [root@DB-Server conf]# cp tomcat-users.xml tomcat-users.xml.20130308.bak

    [root@DB-Server conf]# vi tomcat-users.xml

    <role rolename="admin" />

    <role rolename="manager" />

    <user username="admin" password="Qwe!23" roles="admin,manager" />

    修改了配置信息后,一般需要重新启动一下Tomcat才能生效,否则依然进入不了管理界面

    clipboard[1]

    Tomcat 7 下与Tomcat 6 稍有不同,如下所示:

    <role rolename="admin-gui"/>

    <role rolename="manager-gui"/>

    <user username="admin" password="xxxx" roles="admin-gui , manager-gui "/>

    5:修改Tomcat的默认端口

        有时候由于特性情况,需要修改Tomcat的默认端口8080,例如端口号被其它应用程序占用了等,这时你需要修改server.xml,在里面

    找到如下图所示地方,修改为port的值。注意:修改后需要重启Tomcat服务。

    clipboard[2]

      6:修改Tomcat使用的JDK

        首先我们先安装JDK1.6,如下所示

       1: [root@DB-Server tmp]# chmod +x jdk-6u31-linux-x64-rpm.bin
       2: [root@DB-Server tmp]# ./jdk-6u31-linux-x64-rpm.bin
       3: Unpacking...
       4: Checksumming...
       5: Extracting...
       6: UnZipSFX 5.50 of 17 February 2002, by Info-ZIP (Zip-Bugs@lists.wku.edu).
       7:   inflating: jdk-6u31-linux-amd64.rpm
       8:   inflating: sun-javadb-common-10.6.2-1.1.i386.rpm
       9:   inflating: sun-javadb-core-10.6.2-1.1.i386.rpm
      10:   inflating: sun-javadb-client-10.6.2-1.1.i386.rpm
      11:   inflating: sun-javadb-demo-10.6.2-1.1.i386.rpm
      12:   inflating: sun-javadb-docs-10.6.2-1.1.i386.rpm
      13:   inflating: sun-javadb-javadoc-10.6.2-1.1.i386.rpm
      14: Preparing... ########################################### [100%]
      15:    1:jdk ########################################### [100%]
      16: Unpacking JAR files...
      17:         rt.jar...
      18:         jsse.jar...
      19:         charsets.jar...
      20:         tools.jar...
      21:         localedata.jar...
      22:         plugin.jar...
      23:         javaws.jar...
      24:         deploy.jar...
      25: Installing JavaDB
      26: Preparing... ########################################### [100%]
      27:    1:sun-javadb-common ########################################### [ 17%]
      28:    2:sun-javadb-core ########################################### [ 33%]
      29:    3:sun-javadb-client ########################################### [ 50%]
      30:    4:sun-javadb-demo ########################################### [ 67%]
      31:    5:sun-javadb-docs ########################################### [ 83%]
      32:    6:sun-javadb-javadoc ########################################### [100%]
      33: Java(TM) SE Development Kit 6 successfully installed.
      34: Product Registration is FREE and includes many benefits:
      35: * Notification of new versions, patches, and updates
      36: * Special offers on Oracle products, services and training
      37: * Access to early releases and documentation
      38: Product and system data will be collected. If your configuration
      39: supports a browser, the JDK Product Registration form will
      40: be presented. If you do not register, none of this information
      41: will be saved. You may also register your JDK later by
      42: opening the register.html file (located in the JDK installation
      43: directory) in a browser.
      44: For more information on what data Registration collects and
      45: how it is managed and used, see:
      46: http://java.sun.com/javase/registration/JDKRegistrationPrivacy.html
      47: Press Enter to continue.....
      48:  
      49: Done.

    修改catalina.sh,增加export JAVA_HOME=/usr/java/jdk1.6.0_31即可。如下所示,似乎不用重启,Tomcat使用的JDK就改为了jdk1.6

    clipboard[3]

    [root@DB-Server bin]# ./shutdown.sh

    Using CATALINA_BASE: /usr/local/tomcat/apache-tomcat-6.0.39

    Using CATALINA_HOME: /usr/local/tomcat/apache-tomcat-6.0.39

    Using CATALINA_TMPDIR: /usr/local/tomcat/apache-tomcat-6.0.39/temp

    Using JRE_HOME: /usr/java/jdk1.6.0_31

    Using CLASSPATH: /usr/local/tomcat/apache-tomcat-6.0.39/bin/bootstrap.jar

    [root@DB-Server bin]# ./startup.sh

    Using CATALINA_BASE: /usr/local/tomcat/apache-tomcat-6.0.39

    Using CATALINA_HOME: /usr/local/tomcat/apache-tomcat-6.0.39

    Using CATALINA_TMPDIR: /usr/local/tomcat/apache-tomcat-6.0.39/temp

    Using JRE_HOME: /usr/java/jdk1.6.0_31

    Using CLASSPATH: /usr/local/tomcat/apache-tomcat-6.0.39/bin/bootstrap.jar

    [root@DB-Server bin]#

    clipboard[4]

    另外,似乎网上也有文章介绍,在文件setclasspath.sh下加入export JAVA_HOME=/usr/java/jdk1.6.0_31 设置即可,那种比较合理,目前不得而知。

      7:Tomcat端口被占用分析

        有时候明明Tomcat配置OK,Tomcat服务启动正常,但是打开页面的时候出错。这时可能是Tomat端口被占用了,你可以查看一下那些程序占用了Tomcat的端口

    [root@DB-Server bin]# netstat -an | grep 8080

    [root@DB-Server bin]# netstat -apn | grep 8080

    一般你也会在catalina.out日志里面找到”SEVERE: Error initializing endpoint java.net.BindException: Permission denied<null>:8080“之类的错误。

       1: [root@DB-Server logs]$ more catalina.out  
       2: Mar 4, 2014 4:22:14 PM org.apache.catalina.core.AprLifecycleListener init
       3: INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the ja
       4: va.library.path: /usr/java/jdk1.6.0_31/jre/lib/amd64/server:/usr/java/jdk1.6.0_31/jre/lib/amd64:/usr/java/jdk1.6.0_31/jre/../lib/amd
       5: 64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
       6: Mar 4, 2014 4:22:15 PM org.apache.coyote.http11.Http11Protocol init
       7: SEVERE: Error initializing endpoint
       8: java.net.BindException: Permission denied<null>:8080
       9:         at org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:502)
      10:         at org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:176)
      11:         at org.apache.catalina.connector.Connector.initialize(Connector.java:1058)
      12:         at org.apache.catalina.core.StandardService.initialize(StandardService.java:677)
      13:         at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:795)
      14:         at org.apache.catalina.startup.Catalina.load(Catalina.java:530)
      15:         at org.apache.catalina.startup.Catalina.load(Catalina.java:550)
      16:         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      17:         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      18:         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      19:         at java.lang.reflect.Method.invoke(Method.java:597)
      20:         at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:260)
      21:         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:412)
      22: Mar 4, 2014 4:22:15 PM org.apache.catalina.startup.Catalina load
      23: SEVERE: Catalina.start

    这时要么修改Tomcat的默认端口号,要么修改其它应用程序的端口号。

     

    Tomcat卸载


    Tomcat的卸载非常简单,只需要将Tomcat的CATALINA_BASE目录删除,然后删除一些环境变量即可。

    [root@DB-Server ~]# rm -rf /usr/local/tomcat/


    转载请注明本文地址: Linux Tomcat 6.0安装配置实践总结
    展开全文
  • 很多时候都看到应用在Window tomcat下正常,但是移到Linux环境却出现很多意想不到的问题,这次就是应用登录处验证码出不来。解决此问题的关键是要配置系统支持java.awt.headless模式,即:java.awt.headless=true。
  • linux tomcat 开机启动

    2017-07-03 14:46:05
    Linuxtomcat开机自动启动有两种方法,一种是简单,一种是复杂而又专业的,使用shell脚本要实现,我们一般推荐shell脚本启动方式。下面我们分别介绍这两种方法。 1.shell脚本启动 众所周知,在Linux中设置开机自...
  • linux tomcat catalina.stop 拒绝连接问题

    千次阅读 2018-08-03 23:03:59
    情景:更新web程序,关闭了tomcat。 更新后,删除了tomcat的catalina.out日志及导出了catalina.sh文件,开启了tomcat startup.sh 后。不能正常访问程序。然后再次shutdown.sh 后报错 java.net.ConnectException:...
  • 描述:在Windows上启动springboot程序可以正常启动,但是放到linux上去执行的时候一直报错,报错内容如下: 021-05-26 22:45:26.192 INFO 61180 --- [ main] ConditionEvaluationReportLoggingListener : Error ...
  • Linux Tomcat 强制停止

    千次阅读 2012-04-18 20:04:50
    需求是:Linux下面执行Tomcat下面的shutdown.sh命令,Tomcat进程都会留在那边,如果在执行startup.sh启动的话,那么就会出现多个进程在那边,会导致资源消耗得太多。 有一种方法是通过手动查找进程的方法,ps -ef|...
  • Linux 安装tomcat

    千次阅读 2010-05-13 14:25:00
    Linux tomcat对于电脑使用的玩家的常用软件,然后我就学习及深入的研究Linux tomcat,在这里和大家一起探讨Linux tomcat的使用方法,希望对大家有用。操作系统:Redhat Linux(Fedora Core 2)JDK: j2sdk-1_4_2_01-...
  • 这一两天现场实施的同事,发现系统的tomcat会因为内存溢出的情况出现假死的情况。现场的同事一时查不出问题,最后一招了写个脚本监控一下。 1 使用环境 操作系统:CentOS 4.8 JDK版本:j2sdk1.4.2 Tomcat版本:...
  • jconsole远程监控Linux tomcat和weblogic

    千次阅读 2017-04-17 16:40:08
    最近对程序进行了优化,准备拿到 Linux的虚拟机上做一下压力测试,碰到了一些问题,所以想看看程序的状况,想到了Jconsole。Linux上不方便看啊,所以只能远程。以前配置过,但感觉并不是对所有都适用。这里结合别人...
  • jconsole监控远程linux tomcat运行情况的配置 来自:http://zhumeng8337797.blog.163.com/blog/static/100768914201242494649455/   步骤如下: 1.编辑tomcat/bin/catalina.sh Bash代码  ...
  • 1.在自己虚拟机的centos系统的tomcat下发布了一个程序,在虚拟机上用  http://localhost/xxx 和 http://172.16.1.160/xxx 可以访问,但是在 局域网中用  http://172.16.1.160/xxx 访问不了 -------
  • Linux 安装Tomcat

    千次阅读 2017-03-19 19:48:28
    Tomcat是Apache 软件基金会(Apache Software Foundation)的Jakarta 项目中的一个核心项目,由Apache、Sun 和其他一些公司及个人共同开发而成。由于有了Sun 的参与和支持,最新的Servlet 和JSP 规范总是能在Tomcat ...
  • Linux环境Tomcat下部署jar包、war包程序

    千次阅读 2019-03-23 12:39:53
    一、部署war包程序 1. 查看之前启动的程序,关闭之 ps -ef|grep java kill -9 xxx 2. 启动程序 nohup java -jar XXX.jar >top.out & 二、部署war包程序 1. 将war包放在webapps目录下 2. 重启...
  • 1、讲应用程序打成jar包,或者用(my)eclipse export为war文件 ...2、讲文件拷贝到linux上已安装的tomcat的webapps目录下 3、启动tomcat(到bin目录下 执行 ./catalina.sh run 命令 启动tomcat 有控制台 .
  • 首先你要有一台 Linux 环境,我使用的是 centos 6.4,然后安装 jdk,以及 tomcat 程序,然后将需要调试的程序部署到 tomcat; 上面的内容,本文不做详细介绍,百度一大把。 增加调试配置 shell 脚本 ...
  • 来自:http://zhumeng8337797.blog.163.com/blog/static/100768914201242494649455/... 步骤如下: 1.编辑tomcat/bin/catalina.sh Bash代码  vi catalina.sh   在其中“ # ----- Execute The Requested C
  • Linux安装Tomcat

    千次阅读 2017-04-18 15:41:48
    Linux安装Tomcat   一、安装JDK 二、Tomcat安装  解压缩  # cd /usr/  # tar -zxvf /runbo/install/apache-tomcat-7.0.61.tar.gz   三、修改 tomcat安装目录\conf目录内的server.xml 文件 修改端口:     将...
  • 1.编辑tomcat/bin/catalina.sh Bash代码  vi catalina.sh   在其中“ # ----- Execute The Requested Command -----------------------------------------” 之前插入新的一行(中间没有...
  • new Thread(new HoldThread()).start(); } } } class HoldThread extends Thread { CountDownLatch cdl = new CountDownLatch(1); public HoldThread() { this.setDaemon(true); } ...
  • Linux安装tomcat

    2011-03-22 11:07:00
    1、安装tomcat程序用例tomcat为:apache-tomcat-6.0.29.tar.gz(解压即用)进入usr目录: cd /usr在当前目录创建目录apps: mkdir apps将tomcat安装文件复制到apps目录下:cp /usr/software/apache-tomcat-6.0.29.tar....
  • linuxTomcat安装

    2016-04-07 08:30:52
    3.安装Tomcat /usr/local/tomcat/webapps service tomcat restart service tomcat stop service tomcat start cd /usr/local/src/ wget http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.14/bin/apache-to
  • 1:下载安装配置tomcat的服务器环境 2:切换到tomcat/bin目录下 用vi startup.sh文件 3:然后再startup.sh的文件开头的地方添加如下内容 ...#description:tomcat auto start #processname: tomcat 4:保存退出
  • LinuxTomcat8.5.24安装与环境配置图文教程 》 关于Tomcat : Tomcat 服务器是一个免费的开放源代码的Web 应用服务器,属于轻量级应用服务器,在中小型系统和并发访问用户不是很多的场合下被普遍使用,是...
  • 因为公司的项目bug较多,导致服务器经常内存溢出,导致linux服务器上的tomcat隔几天就宕机一次,而每次宕机都需要我们技术重启,比较麻烦,于是在后台管理端写了一个按钮,当tomcat挂了,可以通过公司的后台管理端...
  • Linux配置程序开机自启动

    千次阅读 2016-10-03 21:36:10
    # 原创作品,转载请注明出处,谢谢!@杨福星 (http://blog.csdn.net/luckystar92/article/details/####)一、背景:*平台:centos6.5*目的...vim tomcat_start下为启动程序脚本: (实现开机启动tomcat及花生壳)#!/bi
  • Linuxtomcat开机自动启动有两种方法,一种是简单,一种是复杂而又专业的,使用shell脚本要实现,我们一般推荐shell脚本启动方式。下面我们分别介绍这两种方法。1.shell脚本启动 众所周知,在Linux中设置开机自...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 32,542
精华内容 13,016
关键字:

linuxtomcat程序start

linux 订阅