Linux installation configuration Tomcat

Source: Internet
Author: User
Tags server port tomcat server

1. First configure the JDK

View Java version: Java-verson

1. Download the JDK on the website

2.TAR-ZXVF xxxx.tar.gz Decompression

3. Configure Environment variables

<1># Vi/etc/profile

<2> Add the following lines at the end:

Export Java_home=/usr/java/jdk1.5.0_16

Export classpath=.: $JAVA _home/jre/lib/rt.jar: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar

Export path= $PATH: $JAVA _home/bin

<3># source/etc/profile effective after execution

2. Install Tomcat

1. Download Tomcat and Unzip

TAR-ZXVF xxx.tar.gz

2. Configure Conf/server.xml

1<?xml version= ' 1.0 ' encoding= ' utf-8 '?>2<!--3 Licensed to the Apache software Foundation (ASF) under one or more4 Contributor license agreements. See the NOTICE file distributed with5    ThisWork foradditional information regarding copyright ownership.6The ASF licenses ThisFile to under the Apache License, Version 2.07(the "License"); If you don't use Thisfile except in compliance with8 The License. Obtain a copy of the License at9 Tenhttp//www.apache.org/licenses/LICENSE-2.0 One  A unless required by applicable law or agreed to writing, software -Distributed under the License is distributed on a "as is"BASIS, - without warranties or CONDITIONS of any KIND, either express or implied. theSee the License forThe specific language governing permissions and - limitations under the License. -- -<!--note:a "Server" is not itself A "Container", so do not +Define subcomponents such as "valves" at ThisLevel . -Documentation at/docs/config/server.html + Port Specifies the Tomcat listener shutdown command ports. When the server is terminated, it must be issued on the same machine as the Tomcat server. A the shutdown command. This property is required. at- -<server port= "8005" shutdown= "Shutdown" > -<listener classname= "Org.apache.catalina.startup.VersionLoggerListener"/> -<!--Security Listener. Documentation at/docs/config/listeners.html -<listener classname= "Org.apache.catalina.security.SecurityListener"/> -- in<!--APR Library loader. Documentation At/docs/apr.html-- -<listener classname= "Org.apache.catalina.core.AprLifecycleListener" sslengine= "on"/> to<!--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"/> the<listener classname= "Org.apache.catalina.core.ThreadLocalLeakPreventionListener"/> *  $<!--Global JNDI ResourcesPanax NotoginsengDocumentation at/docs/jndi-resources-howto.html -- the<GlobalNamingResources> +<!--Editable User database that can also is used by A Userdatabaserealm to authenticate users the- +<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> the  -<!--a "Service" is a collection of one or more "connectors"That shareWuyiA single "Container" Note:a "Service" was not itself A "Container", theDefine subcomponents such as "valves" at ThisLevel . -Documentation at/docs/config/service.html Wu- -<service name= "Catalina" > About  $<!--the connectors can use a GKFX executor, you can define one or more named thread pools--> -<!-- -<executor name= "Tomcatthreadpool" nameprefix= "catalina-exec-" -Maxthreads= "minsparethreads=" 4 "/> A- +  the  -<!--A "Connector"represents an endpoint by which requests is received $ And responses are returned. Documentation at: theJava HTTP Connector:/docs/config/http.html (Blocking & non-blocking) theJava AJP Connector:/docs/config/ajp.html theAPR (HTTP/AJP) Connector:/docs/apr.html theDefine a non-ssl/tls http/1.1 Connector on port 8080 - receiving HTTP requests over port 8080 in- the<connector port= "8060" protocol= "http/1.1" theconnectiontimeout= "20000" Aboutredirectport= "8443"/> the<!--A "Connector" using the shared thread pool--> the<!-- the<connector executor= "Tomcatthreadpool" +port= "8080" protocol= "http/1.1" -connectiontimeout= "20000" theredirectport= "8443"/>Bayi- the<!--Define a SSL/TLS http/1.1 Connector on port 8443 the This connector uses the NIO implementation that requires the JSSE -Style configuration. When using the apr/nativeimplementation, the -OpenSSL style configuration is required as described in the apr/native theDocumentation-- the<!-- the<connector port= "8443" protocol= "Org.apache.coyote.http11.Http11NioProtocol" theMaxthreads= "sslenabled=" true "scheme=" "https" secure= "true" -Clientauth= "false" sslprotocol= "TLS"/> the- the  the<!--Define an AJP 1.3 Connector on port 800994 JD Connector, which receives requests forwarded by other servers over port 8009 the- the<connector port= "8009" protocol= "ajp/1.3" redirectport= "8443"/> the 98  About<!--An Engine represents the entry point (within Catalina) that processes -Every request. The Engine implementation forTomcat stand alone101 analyzes the HTTP headers included with the request, and passes them102 The appropriate host (virtual host).103Documentation At/docs/config/engine.html--104  the<!--should set Jvmroute to support load-balancing via AJP ie:106<engine name= "Catalina" defaulthost= "localhost" jvmroute= "jvm1" >107-108<engine name= "Catalina" defaulthost= "localhost" >109  the<!--for clustering, take a look at documentation at:111/docs/cluster-howto.html (Simple-to) the/docs/config/cluster.html (reference documentation)--113<!-- the<cluster classname= "Org.apache.catalina.ha.tcp.SimpleTcpCluster"/> the- the 117<!--Use the Lockoutrealm to prevent attempts to guess user passwords118Via a brute-force attack--119<realm classname= "Org.apache.catalina.realm.LockOutRealm" > -<!--This Realm uses the userdatabase configured in the global JNDI121Resources under the key "Userdatabase". Any edits122That is performed against ThisUserdatabase is immediately123Available forUse by the Realm. -124<realm classname= "Org.apache.catalina.realm.UserDatabaseRealm" theResourcename= "Userdatabase"/>126</Realm>127  -<!--path: The pathname of the browser when it is accessed, such as the first item, when the browser accesses the pathname (my is port 80): localhost/struts/index.jsp129 Docbase:web the path to the Webroot of the project, note that the path to the Webroot is not the path to the project.  the Debug: A value of 0 means that the log is not printed131Reloadble: If the item has changed, does Tomcat reload the item-- the133Unpackwars= "true" autodeploy= "true" >134<context path= "/" docbase= "Here is the path relative to WebApps" reloadable= "true"/>135 136<!--Singlesignon valve, share authentication between Web applications137Documentation at:/docs/config/valve.html--138<!--139<valve classname= "Org.apache.catalina.authenticator.SingleSignOn"/> $-141 142<!--Access Log processes all example.143Documentation at:/docs/config/valve.html144Note:the pattern used is equivalent to using pattern= "common"-145<valve classname= "Org.apache.catalina.valves.AccessLogValve" directory= "Logs"146prefix= "Localhost_access_log" suffix= ". txt"147pattern= "%h%l%u%t &quot;%r&quot; %s%b "/>148 149</Host> Max</Engine>151</Service> the</Server>

3. Start

./bin/startup.sh

4. Close

./bin/shutdown.sh

5. Visit:

IP: Port

6.web Project packaged into war

Linux installation configuration Tomcat

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.