Tomcat basic Web configuration

Source: Internet
Author: User
The first step is to download tomcat to the server. here we use local development as an example. in windows, the same is true in Linux. The second part is to open/conf/server. xml File 1. first find the Connector configuration link parameter [html] & lt; Connectorport & quot; 80 & quot; protocol & quot; HTTP/1.1 & quot; connect

 
The first step is to download tomcat to the server. here we use local development as an example. in windows, the same is true in Linux.


The second part is to open the/conf/server. xml file.

1. first find the Connector configuration link parameters

[Html]
ConnectionTimeout = "20000"
URIEncoding = "UTF-8"
MaxThreads = "300" enableLookups = "false"
EmptySessionPath = "true"
RedirectPort = "8443" type = "regxph" text = "yourobjectname"/>
There are two main parameters to explain
Port: Tomcat uses port 8080 by default and is changed to port 80, that is, the default http port, so that you can listen to http requests.

URIEncoding

Example: window. location. href = "http://www.abc.com /? Name = "+ encodeURIComponent (" ");

For more information about other parameters, see the article.

2. find the host node and configure the host

[Html]
UnpackWARs = "true" autoDeploy = "true"
XmlValidation = "false" xmlNamespaceAware = "false">
 
 
Modify several parameters:
Name: changed from localhost to www.abc.com. this is your domain name.

Add the context node docBase to your war name.


If your configuration file is extracted and put in another directory, you also need to modify catalina. properties

Add:

CONFIG_DIR_PATH = F: \ config (note the delimiter in Linux)
In this way, you can use the CONFIG_DIR_PATH variable in the project.

For example, in Spring

[Html]

 
 


File: $ {CONFIG_DIR_PATH}/tag. properties  
File: $ {CONFIG_DIR_PATH}/../system-config/tag. properties  
 
 
 

So far, Tomcat configuration is complete.

Step 3: bind the host.


Step 4 start access http://www.abc.com


The above configuration is the most basic and simple, not applicable to the production environment ~


Integrate nginx when necessary

 

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.