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 Windows.zip 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
./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./shutdown.sh, 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