Install one/More TOMCAT8 under Windows System deployment

Source: Internet
Author: User

First download Tomcat8.0 compressed version from http://tomcat.apache.org/, extract to the specified path.

First: Install a single tomcat in a Windows system installation

For this scenario, the usual practice is to configure the environment variables to add Cataline_home, java_home in the system environment variables.

I extracted tomcat into the D:\Tomcats\tomcat8.0 directory, JDK in the C disk directory, the following is the environment variables I configured: (Desktop My Computer right-click Properties, advanced environment variable)

Java_home  C:\Program files\java\jdk1.  7. 0_04cataline_home  D:\Tomcats\tomcat8. 0

① the original system variable path followed by the English semicolon, add%java_home%\bin; %java_home%\jre\bin; new system variable classpath, Tim%java_home%\bin; %java_home%\lib\dt.jar; %java_home%\jre\lib\rt.jar; Do not delete the original. See clearly, the semicolon between them, is the semicolon in English.

② add%catalina_home%\bin on the last side of the system variable path, and then add%catalina_home%\lib\servlet-api.jar;%catalina_home%\lib\ after the system variable Classpath Jsp-api.jar; Notice the semicolon between them, must be a semicolon in English.

In some of the documents described need to configure cataline_base, actually feel do not need, at least Tomcat8 is not needed, in D:\Tomcats\tomcat8.0\bin\ directory we find Service.bat, and then edit the way to open, You can see the following code (hint in the code: if Catalina_base is empty, it is assigned a value with Catalina_home. )

When the environment variable is configured, I need to modify the contents of the Tomcat-users.xml under the D:\Tomcats\tomcat8.0\conf\ directory, which can be removed from the role tag at the bottom of the screen and change it to the following:

  <rolerolename= "Tomcat"/>  <rolerolename= "Role1"/>  <rolerolename= "Manager-gui"/>  <rolerolename= "Admin-gui"/>  <rolerolename= "Manager-script"/>    <Userusername= "Tomcat"Password= "Tomcat"Roles= "Tomcat,manager-gui,admin-gui,manager-script"/>  <Userusername= "both"Password= "Tomcat"Roles= "Tomcat,role1"/>  <Userusername= "Role1"Password= "Tomcat"Roles= "Role1"/>

This time, basic can be, you double-click the D:\Tomcats\tomcat8.0\bin\ directory below the Startup.bat, you can start Tomcat, in the browser address bar input localhost:8080, The ability to open a Web page means that Tomcat works correctly.

As mentioned earlier, the above practice is usually done, because many times do not like to set environment variables, feel particularly afraid of error. So let's remove the environment variable that we set up before, and see if we can restart it, OK, let's catalina_home it out.

We open the DOS window through CMD, navigate the path to D:\Tomcats\tomcat8.0\bin, and then enter Service.bat install

At this point, you see Catalina_home and catalina_base are the current directory, even if not specified in the environment variables, at this point, you will find that you double-click Bin\tomcat8w.exe, this program can be opened, you click on the start, To start Tomcat, you can also enter the address localhost:8080 in the browser to verify that the startup was successful.

If you still want to be lazy, do not want to write java_home, in fact, also not no, you can write a batch file, such as the following

Set java_home = C:\Program files\apache-tomcat-7.0.2 set Catalina_home =d:\tomcats\tomcat8.0d:\tomcats\tomcat8.0\bin\ Service.bat Install Tomcat8

Write the file to save as Installservice.bat (suffix is bat, file name casually), double-click after he finishes, you double-click Bin\tomcat8w.exe, the program is also open, but I need to modify the JVM path on the computer, so Java_ HOME, this environment variable or write it well ....

If the path to executable is inconsistent with the current Tomcat.exe path in the process of Daoteng to the back of the Tomcat8w.exe (I actually encountered it in Daoteng), you can execute the service.bat remove command, And then reinstall it, you can see it.

Second: Installing multiple Tomcat in a Windows system installation

In fact, the above already mentioned the deployment of multiple Tomcat solution, good, is to use Service.bat Install mode, can not say I added a tomcat to add a Catalina_home variable bar, and then you collapsed , because for example you add a tomcat, you need to write catalina_home2 in the environment variable, this is nothing, the key is you will be the bin directory under the Catalina.bat and Servie.bat inside the Catalina_ Home places are to be replaced with catalina_home2, (because Service.bat inside will call Catalina.bat), so change is not necessarily able to run.

As a result, we delete all the catalina_home in the environment variable (not delete or affect).

I was assigned 3 Tomcat installation folders under D:\Tomcats, namely tomcat8.1, tomcat8.2, tomcat8.3, Let's get them conf. The following Tomcat-users.xml user login permissions are modified in the same way as above. The second is to modify the ports in the Service.xml, which we have already used by default, and now all three tomcat needs to be modified. The service.xml can be modified to match the following

Once modified, open the DOS window and navigate to the bin directory corresponding to each directory, and execute the Service.bat install command to complete the deployment of multiple tomcat. Enter the respective test url:locathost:8081, localhost8082, localhost8083 in the browser to test for successful startup.

In fact, after a Tomcat deployment is installed, a new entry is added to the registry, and the content that can be modified with the Tomcat8.*w.exe open page is written in the registry, so it can be modified in the registry as well.

Well, simple introduction here, more practice more accumulation .....

Install one/More TOMCAT8 under Windows System deployment

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.