tomcat configuration

1. Unzip the compressed package

     On the way to use tomcat , I have always been a novice, but I am so unfortunate.

There will always be problems of this kind and that. After groping for a few times, I can finally figure out some ideas, so this article

Remember the time wasted in revisions.

     First, go to the official website of tomcat to download the installation package. So far, the latest version is 7.0.62 .

This step should be done, so there is no need to say more. Unzip after downloading, remember the location of your unzipped files

, useful later when configuring environment variables.

      Then enter the bin directory under the installation directory, double-click start.bat, if such a boundary appears

Then congratulations, your installation is successful, you can use it without configuring other things .

 

But you may not be so lucky. You can't see the startup interface like the above but a black screen flashing by. Then the reason is that your environment variables are not configured properly, and the next step is to configure the environment variables.

     2. If tomcat can be started, configure at least 2 variables (if your computer has only one user, it is the same to configure it as a system variable or a user variable. If it is used by multiple users, it is best to configure it as a system variable Right), one is CATALINA_HOME, the variable value is the tomcat installation path, the other is JAVA_HOME , the variable value is the jdk installation path, such as:

My tomcat is installed on the D drive, jdk is on the C drive,

CATALINA_HOMED:\tomcat\apache-tomcat-7.0.62

JAVA_HOMEC:\Program Files\Java\jdk1.8.0_45

Now double-click startup.bat to start again, and it can generally be started. But sometimes you want to start directly under the black screen faster, but when you enter the startup command from the cmd command line , you may get a prompt such as whether it is an internal command. To be able to start in any path, then To add the value of CATALINA_HOME to the path variable , the form of addition is : add %CATALINA_HOME%\bin after the variable value of path ; if there is nothing else, it is fine.

<!--[if !supportLists]--> 3. <!--[endif]--> Modify the port

The default port of Tomcat is 8080. If you want to change to another port, you can change the port 8080 in server.html to the port you want in the conf directory of the installation directory. Generally, you can leave it unchanged. . Then visit http://localhost:8080, if you can enter the welcome interface, the installation is successful.

 

<!--[if !supportLists]--> 4. <!--[endif]--> Deploy tomcat server on Eclipse

To make the project on Eclipse run on the tomcat server, you need to deploy the service first. The steps are as follows:

Windows->preferences->server->Runtime Renvironment->Add, then select your tomcat server version, as shown below:

 

 

Then finish.

Add a server: Select the server in the console column of Eclipse and click the blue font below

 

Select the server version (mine is version 7 , so choose the last one ):

 

Don't change the following values, use the default ones, and then finish , OK, select back and we can see a server under the server :

 

Now double-click the server to enter the following interface:

 

As you can see, now select Use workspace metadata (does not modify Tomcat installion) in the server Location  location , select Use tomcat installation (Task control of Tomcat installation), that is, select the installation directory of tomcat as the release directory of the project.

Then, go down four lines and see "Deploy Path"? The default value behind it is "wtpwebapps", change it to "webapps", which is tomcat

The name of the folder where the published project is located.

After modification, close this page and save the configuration. This will deploy the project to the webapp in the tomcat installation directory

Restart the tomcat server, and access http://localhost:8080 can be accessed normally, and the projects deployed by yourself can also be accessed normally.

 

 

 

 

 

<!--EndFragment-->

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326327097&siteId=291194637