Configuring the Tomcat server under Linux

Source: Internet
Author: User
Tags tomcat server

Linux under the configuration Tomcat server and Windows actually almost, can go to the official website to download the installation package release or online download, just download the file, now download. tar.gz format, the following command-line installation

Or a new directory under/usr/local. After Tomcat enters the latest package with the wget command, tomcat9.0 is now out, but for better compatibility with the Eclipse project, it is recommended to download the latest tomcat8.0 package


Download it and then release it.

tar -xzvf apache-tomcat-8.0. . tar. gz


  After release can delete the original package, into the server directory, now there is no problem can start Tomcat, into the bin, execute the script

./startup. SH


  And then see this has been started, if the previous domain name resolved to the server, and 80 ports are bound, then do not have to specifically domain name binding directly run http://servername:8080/can see the following interface:


The stop server can be used with the./, and by now the most basic tomcat has been configured.

The following configuration of the Tomcat server application directory, by default, Tomcat's application directory is WebApps, can be modified to our specified directory

First enter the Conf directory under the server, perform vim server.xml open file find


Now, restart the server can take effect, now access to the address will be found to be blank, because the default project is not configured because of the reason, the Tomcat server default project is the root directory under WebApps, that is, access to remove the project name, directly as the root directory use, Other directories must be accessed using http://servername:8080/projectname/, and now our first approach is to adapt to the Tomcat server's default project, to build the root directory under our application directory, so it is well understood that Another way is to customize the default project directory as follows

Or use VIM to open the Conf/server.xml file, navigate to the location of the <Host> tag, and then in the middle of the <Host></Host> tab, or </Host> Add the following code configuration between the end tags:

<path= ""  docBase= "Custom Default project Path"  debug= "0" reloadable = "true" />


Path= "" represents the application directory of the direct directory, Docbase is the default project directory, the following reloadable is the default automatic compilation of the source file as a class file, easy to debug, production environment can be set to false, thereby improving the performance of the Tomcat server

After setting, restarting the server access will take effect

Basic root configuration and project migration are these, the base deployment of the Tomcat server is these, more configuration operations continue to discuss after

Configuring the Tomcat server under Linux

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: 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.