Deploy Tomcat under non-installation mode in Windows

Source: Internet
Author: User

1) First install the JDK configuration Java_home,classpath,path variables. 2) Download Tomcat and select the non-installation method to download

3) Unzip to get the following folder

4) Server.xml file under the key configuration conf
<port= "  protocol"= "http/1.1"               connectiontimeout  = "20000"               redirectport= "8443"/>

First, run the Netstat-ano command under the command-line window to see the port occupancy and then change port default 8080 to an available port.

Then add the following host Configuration node

<Hostname= "Longtest.com"AppBase= "Webapps/showuser"Unpackwars= "true"Autodeploy= "false"xmlvalidation= "false"Xmlnamespaceaware= "false">            <Alias>Sz.longtest.com</Alias>                  <ContextDocBase=""Path=""reloadable= "false">            </Context>      </Host>

Name configuration domain name (local use can modify the Windows host configuration file by adding 127.0.0.2 longtest.com)

AppBase Tomcat default App directory (this is set to WebApps below the Showuser app as the root directory)

Alias Don't use

The context node is particularly important docbase is the next level of AppBase directory path is the next level of longtest.com

Attached complete 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 are not a use of this file except in compliance with the License.  Obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 unless required by applicable or agreed to writing, software distributed under the License are distributed on a "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 if you are not define subcomponents such as "valves" at the     . Documentation At/docs/config/server.html -<ServerPort= "8005"shutdown= "SHUTDOWN">  <ListenerClassName= "Org.apache.catalina.startup.VersionLoggerListener" />  <!--Security Listener. Documentation at/docs/config/listeners.html <listener classname= "Org.apache.catalina.security.SecurityListener "/> -  <!--APR Library Loader. Documentation At/docs/apr.html -  <ListenerClassName= "Org.apache.catalina.core.AprLifecycleListener"Sslengine= "On" />  <!--Initialize Jasper prior to WebApps is loaded. Documentation At/docs/jasper-howto.html -  <ListenerClassName= "Org.apache.catalina.core.JasperListener" />  <!--Prevent memory leaks due to use of particular Java/javax APIs -  <ListenerClassName= "Org.apache.catalina.core.JreMemoryLeakPreventionListener" />  <ListenerClassName= "Org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />  <ListenerClassName= "Org.apache.catalina.core.ThreadLocalLeakPreventionListener" />  <!--Global JNDI Resources Documentation at/docs/jndi-resources-howto.html -  <globalnamingresources>    <!--Editable User database that can also is used by Userdatabaserealm to authenticate users -    <Resourcename= "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", "Container" note:a "service" is n       OT itself a "Container", so if not define subcomponents such as "valves" at the This level. Documentation At/docs/config/service.html -  <Servicename= "Catalina">    <!--The connectors can use a GKFX executor, you can define one or more named thread pools -    <!--<executor name= "Tomcatthreadpool" nameprefix= "catalina-exec-" maxthreads= "4" minsparethreads=  -    <!--A "Connector" represents A endpoint by which requests is received and responses are returned. Documentation At:java HTTP Connector:/docs/config/http.html (Blocking & non-blocking) Java AJP Con  Nector:/docs/config/ajp.html APR (HTTP/AJP) Connector:/docs/apr.html Define a Non-ssl http/1.1 Connector On port 8080 -    <ConnectorPort= "a"Protocol= "http/1.1"ConnectionTimeout= "20000"Redirectport= "8443" />    <!--A "Connector" using the shared thread pool -    <!--<connector executor= "Tomcatthreadpool" port= "8080" protocol= "http/1.1" Connectiont imeout= "20000" redirectport= "8443"/> -    <!--Define a SSL http/1.1 Connector on port 8443 This Connector uses the BIO implementation that requires the JSS E style configuration. When using the apr/native implementation, the OpenSSL style configuration is required as described in the Apr/nati ve documentation -    <!--<connector port= "8443" protocol= "Org.apache.coyote.http11.Http11Protocol" maxthreads= "Sslena" Bled= "true" scheme= "https" secure= "true" Clientauth= "false" sslprotocol= "TLS"/> -    <!--Define an AJP 1.3 Connector on port 8009 -    <ConnectorPort= "8009"Protocol= "ajp/1.3"Redirectport= "8443" />    <!--An Engine represents, the entry point (within Catalina), that processes every request. The Engine implementation for Tomcat stand alone analyzes the HTTP headers included with the request, and passes T         Hem on to the appropriate host (virtual host). Documentation At/docs/config/engine.html -    <!--should set Jvmroute to support load-balancing via AJP ie: <engine name= "Catalina" defaulthost= "localhost" Jvmroute= "JVM1" > -    <Enginename= "Catalina"Defaulthost= "localhost">      <!--for clustering, take a look at documentation at:/docs/cluster-howto.html ocs/config/cluster.html (reference documentation) -      <!--<cluster classname= "Org.apache.catalina.ha.tcp.SimpleTcpCluster"/> -      <!--Use the Lockoutrealm to prevent attempts to guess user passwords via a brute-force attack -      <RealmClassName= "Org.apache.catalina.realm.LockOutRealm">        <!--This Realm uses the userdatabase configured in the global JNDI resources under the key "Userdatabase". Any edits that is performed against this userdatabase is immediately available for use by the Re  Alm.  -        <RealmClassName= "Org.apache.catalina.realm.UserDatabaseRealm"resourcename= "Userdatabase"/>      </Realm>      <Hostname= "localhost"AppBase= "WebApps"Unpackwars= "true"Autodeploy= "true">        <!--Singlesignon valve, share authentication between Web applications documentation at:/docs/config/valve.ht ML -        <!--<valve classname= "Org.apache.catalina.authenticator.SingleSignOn"/> -        <!--Access Log processes all example. Documentation at:/docs/config/valve.html note:the pattern used are equivalent to using pattern= "common" -        <ValveClassName= "Org.apache.catalina.valves.AccessLogValve"Directory= "Logs"prefix= "Localhost_access_log."suffix= ". txt"pattern= "%h%l%u%t &quot;%r&quot;%s%b" />      </Host>            <Hostname= "Longtest.com"AppBase= "Webapps/showuser"Unpackwars= "true"Autodeploy= "false"xmlvalidation= "false"Xmlnamespaceaware= "false">            <Alias>Sz.longtest.com</Alias>                  <ContextDocBase=""Path=""reloadable= "false">            </Context>      </Host>          </Engine>  </Service></Server>

Finally run the Startup.bat in the Apache-tomcat-7.0.72\bin directory

Deploy Tomcat under non-installation mode in Windows

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.