linux下启动tomcat 服务 常用命令




[root@localhost logs]# cd ../webapps/

[root@localhost webapps]# ls

docs  examples  host-manager  images  manager  resource  ROOT  smart  smartcollege

[root@localhost webapps]# cd ..

[root@localhost apache-tomcat-7.0.55]# ls

bin  conf  lib  LICENSE  logs  NOTICE  RELEASE-NOTES  RUNNING.txt  temp  webapps  work

[root@localhost apache-tomcat-7.0.55]# cd conf/

[root@localhost conf]# ls

Catalina  catalina.policy  catalina.properties  context.xml  logging.properties  server.xml  tomcat-users.xml  web.xml

[root@localhost conf]# vi server.xml



<?xml version='1.0' encoding='utf-8'
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!-- Note:  A "Server" is not itself a "Container", so you may not
     define subcomponents such as "Valves" at this level.
     Documentation at /docs/config/server.html
 -->
<Server port="8005" shutdown="SHUTDOWN">
  <!-- Security listener. Documentation at /docs/config/listeners.html
  <Listener className="org.apache.catalina.security.SecurityListener" />
  -->
  <!--APR library loader. Documentation at /docs/apr.html -->
  <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
  <!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
  <Listener className="org.apache.catalina.core.JasperListener" />
  <!-- Prevent memory leaks due to use of particular java/javax APIs-->
  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
  <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />

  <!-- Global JNDI resources
       Documentation at /docs/jndi-resources-howto.html
  -->
  <GlobalNamingResources>
    <!-- Editable user database that can also be used by
         UserDatabaseRealm to authenticate users
    -->
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />
  </GlobalNamingResources>

  <!-- A "Service" is a collection of one or more "Connectors" that share
       a single "Container" Note:  A "Service" is not itself a "Container",
       so you may not define subcomponents such as "Valves" at this level.
       Documentation at /docs/config/service.html
   -->
  <Service name="Catalina">

    <!--The connectors can use a shared executor, you can define one or more named thread pools-->
    <!--
    <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
        maxThreads="150" minSpareThreads="4"/>
    -->


    <!-- A "Connector" represents an endpoint by which requests are received
         and responses are returned. Documentation at :
         Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
         Java AJP  Connector: /docs/config/ajp.html
         APR (HTTP/AJP) Connector: /docs/apr.html
         Define a non-SSL HTTP/1.1 Connector on port 8080
    -->
    <Connector port="8081" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
    <!-- A "Connector" using the shared thread pool-->
    <!--
    <Connector executor="tomcatThreadPool"
               port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
    -->
    <!-- Define a SSL HTTP/1.1 Connector on port 8443
         This connector uses the BIO implementation that requires the JSSE
         style configuration. When using the APR/native implementation, the
         OpenSSL style configuration is required as described in the APR/native
         documentation -->
    <!--
    <Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol"
               maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
               clientAuth="false" sslProtocol="TLS" />
    -->

    <!-- Define an AJP 1.3 Connector on port 8009 -->
    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />



:q!  不保存文件并退出。
:w  保存文件。





linux下启动 tomcat  命令
 

webadmin@debian:~$ cd /opt/apache-tomcat-youshixi-local/

webadmin@debian:/opt/apache-tomcat-youshixi-local$    ls

bin   lib      logs    RELEASE-NOTES  temp     work
conf  LICENSE  NOTICE  RUNNING.txt    webapps  YouShiXi


webadmin@debian:/opt/apache-tomcat-youshixi-local$ cd bin/

webadmin@debian:/opt/apache-tomcat-youshixi-local/bin$ ls

bootstrap.jar                   E:\youshixi_log\youshixi.log.7
catalina.bat                    E:\youshixi_log\youshixi.log.8
catalina.sh                     E:\youshixi_log\youshixi.log.9
catalina-tasks.xml              service.bat
commons-daemon.jar              setclasspath.bat
commons-daemon-native.tar.gz    setclasspath.sh
cpappend.璁功.docx              shutdown.sh
daemon.sh                       startup.bat
digest.bat                      startup.sh
digest.sh                       tcnative-1.dll
E:\img\photo                    tomcat6.exe
E:\youshixi_log\youshixi.log    tomcat6w.exe
E:\youshixi_log\youshixi.log.1  tomcat-juli.jar
E:\youshixi_log\youshixi.log.2  tomcat-native.tar.gz
E:\youshixi_log\youshixi.log.3  tool-wrapper.bat
E:\youshixi_log\youshixi.log.4  tool-wrapper.sh
E:\youshixi_log\youshixi.log.5  version.bat
E:\youshixi_log\youshixi.log.6  version.sh

webadmin@debian:/opt/apache-tomcat-youshixi-local/bin$ ./startup.sh







webadmin@debian:/opt$ cd

webadmin@debian:~$ cd /opt/

webadmin@debian:/opt$ cd apache-tomcat-youshixi-local/

webadmin@debian:/opt/apache-tomcat-youshixi-local$ cd

webadmin@debian:~$ cd /opt

webadmin@debian:/opt$ cd apache-tomcat-youshixi-local/

webadmin@debian:/opt/apache-tomcat-youshixi-local$ cd bin/

webadmin@debian:/opt/apache-tomcat-youshixi-local/bin$ ls

bootstrap.jar                 digest.sh                       E:\youshixi_log\youshixi.log.8  tomcat6.exe
catalina.bat                  E:\img\photo                    E:\youshixi_log\youshixi.log.9  tomcat6w.exe
catalina.sh                   E:\youshixi_log\youshixi.log    service.bat                     tomcat-juli.jar
catalina-tasks.xml            E:\youshixi_log\youshixi.log.1  setclasspath.bat                tomcat-native.tar.gz
commons-daemon.jar            E:\youshixi_log\youshixi.log.2  setclasspath.sh                 tool-wrapper.bat
commons-daemon-native.tar.gz  E:\youshixi_log\youshixi.log.3  shutdown.bat                    tool-wrapper.sh
cpappend.璁功.docx            E:\youshixi_log\youshixi.log.5  startup.bat                     version.sh
daemon.sh                     E:\youshixi_log\youshixi.log.6  startup.sh
digest.bat                    E:\youshixi_log\youshixi.log.7  tcnative-1.dll
webadmin@debian:/opt/apache-tomcat-youshixi-local/bin$ st
st4topgm              startx                stream                strip                 
start-pulseaudio-kde  stat                  stream.im6            stty                  
start-pulseaudio-x11  stdbuf                strings               
webadmin@debian:/opt/apache-tomcat-youshixi-local/bin$ st
st4topgm              startx                stream                strip                 
start-pulseaudio-kde  stat                  stream.im6            stty                  
start-pulseaudio-x11  stdbuf                strings    
           
webadmin@debian:/opt/apache-tomcat-youshixi-local/bin$ cd

webadmin@debian:~$ cd /opt/apache-tomcat-youshixi-local/bin/

webadmin@debian:/opt/apache-tomcat-youshixi-local/bin$ ls
bootstrap.jar                 digest.sh                       E:\youshixi_log\youshixi.log.8  tomcat6.exe
catalina.bat                  E:\img\photo                    E:\youshixi_log\youshixi.log.9  tomcat6w.exe
catalina.sh                   E:\youshixi_log\youshixi.log    service.bat                     tomcat-juli.jar
catalina-tasks.xml            E:\youshixi_log\youshixi.log.1  setclasspath.bat                tomcat-native.tar.gz
commons-daemon.jar            E:\youshixi_log\youshixi.log.2  setclasspath.sh                 tool-wrapper.bat
commons-daemon-native.tar.gz  E:\youshixi_log\youshixi.log.3  shutdown.bat                    tool-wrapper.sh
cpappend.璁功.docx            E:\youshixi_log\youshixi.log.5  startup.bat                     version.sh
daemon.sh                     E:\youshixi_log\youshixi.log.6  startup.sh
digest.bat                    E:\youshixi_log\youshixi.log.7  tcnative-1.dll

webadmin@debian:/opt/apache-tomcat-youshixi-local/bin$ ./startup.bat

你可能感兴趣的:(linux,启动tomcat)