Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Installation, startup and use of Tomcat and IIS

2025-03-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces the installation, startup and use of Tomcat and IIS. In daily operation, I believe many people have doubts about the installation, startup and use of Tomcat and IIS. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about the installation, startup and use of Tomcat and IIS. Next, please follow the editor to study!

1.1 install and start the IIS server

Higher versions of Windows come with IIS, but are not enabled by default. Let's take Window10 as an example to show the steps to enable IIS.

(1) Select the operating system's [Control Panel] → [programs] → [turn on or off Windows function], and open the "turn on or off Windows function" window, see figure 1-1.

Figure 1-1 opens the "turn on or off Windows feature" window

(2) in the "turn on or off Windows function" window, select all the options related to the IIS information service, as shown in figure 1-2. Make sure that the options in Application Development Features are enabled.

Figure 1-2 enable the functions of IIS in Windows

(3) Select the [Control Panel] → [Systems and Security] → [Management tools] → [Internet Information Services (IIS) Manager] of the operating system, and open the IIS Manager.

(4) Select the host node that represents the local computer in the directory tree on the left side of the IIS manager window, right-click, and select "start" from the drop-down menu to start the IIS server. If you select stop, the IIS server will be terminated, as shown in figure 1-3.

Figure 1-3 start or terminate the IIS server in IIS Manager

(5) after starting the IIS server according to step (4) above, access http://localhost through the browser

If the page shown in figure 1-4 appears, the IIS server has been installed and started successfully.

Figure 1-4 access to the home page of the IIS server

1.2 prepare relevant documents

Before starting the operation of this section, assuming that the IIS server has been installed on the machine by following the steps in section 1.1 of this chapter, prepare the following three files, which are stored in the conf directory of the Tomcat root directory (/ conf):

(1) JK plug-in: isapi_redirect.dll file

(2) workers.properties file

(3) uriworkermap.properties file

1.JK plug-in

The JK plug-in for IIS is available in the sourcecode/iis directory of the source code package: isapi_redirect.dll, and the latest JK plug-in can also be downloaded from:

Http://tomcat.apache.org/download-connectors.cgi

Copy the JK plug-in isapi_redirect.dll to the / conf directory.

Different Windows plug-ins need to be downloaded for different IIS JK versions. In the matching source code package, sourcecode/iis/isapi_redirect.dll is suitable for X862864 type Windows;sourcecode/iis/isapi_redirect_windows-i386.dll and i386 model Windows. If a mismatched JK plug-in is selected, it will cause the IIS server to fail to load it.

2.workers.properties file

Create the following workers.properties file in the / conf directory. This file is also available in the sourcecode/ iis directory of the accompanying source code package:

Worker.list=worker1 worker.worker1.port=8009 # work port, if not occupied, you do not need to modify the address of the worker.worker1.host=localhost # Tomcat server worker.worker1.type=ajp13 # type worker.worker1.lbfactor=1 # load balance factor

3.uriworkermap.properties file

Create the following uriworkermap.properties file under the / conf directory, which specifies the URL mapping for the JK plug-in. This file is also available in the sourcecode/iis directory of the accompanying source code package:

/\ * .jsp = worker1/helloapp/\ * = worker1

The above configuration code indicates that the URL that worker1 is responsible for processing includes "/ * .jsp" and helloapp applications.

Although the above three files are placed in the Tomcat directory, the Tomcat server will not access these files. The above is a conventional configuration. In fact, you can also put these files elsewhere in the file system. In addition, in the actual operation, it is found that putting these three files in the same directory will make it easier to integrate Tomcat and IIS successfully.

1.3 Edit the registry

When configuring Apache and Tomcat integration, the properties of the JK plug-in are set in the Apache configuration file httpd.conf. When configuring IIS and Tomcat integration, you should set the properties of the JK plug-in in the registry of the operating system. Here are the steps.

(1) in Windows, edit the registry with the regedit command and create a new key: HKEY_LOCAL_MACHINE\ SOFTWARE\ Apache Software Foundation\ Jakarta Isapi Redirector\ 1.0, as shown in figure 1-5.

Figure 1-5 create Jakarta Isapi Redirector\ 1.0keys in the registry

(2) create a new string under the Jakarta Isapi Redirector\ 1.0 key, see Table 1-1, and the created registry is shown in figure 1-6.

Table 1-1 strings created under the Jakarta Isapi Redirector\ 1.0 key

Figure 1-6 create a new string under the Jakarta Isapi Redirector\ 1.0 key

The registry editing file jk.reg is provided in the sourcecode/iis directory of the matching source code package. If you do not want to manually modify the registry in the above way, you can also run the jk.reg file directly (select this file and double-click the mouse), it will automatically add the above configuration to the registry. The jk.reg is as follows:

Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\ SOFTWARE\ Apache Software Foundation\ Jakarta Isapi Redirector\ 1.0] "extension_uri" = "/ jakarta/isapi_redirect.dll"log_file" = "C:\\ tomcat\\ logs\\ isapi.log"log_level" = "debug"worker_file" = "C:\ tomcat\\ conf\\ workers.properties" Worker_mount_file "=" C:\ tomcat\\ conf\\ uriworkermap.properties "

Before running the jk.reg file, you should replace the "C:\ tomcat" directory in the file with the actual installation directory of Tomcat on the reader's local machine.

1.4 add "jakarta" virtual directory to IIS

After the registry modification, you should add a virtual directory called "jakarta" to the IIS, which is the directory where the JK plug-in is located. Here are the steps.

(1) Select the [Control Panel] → [Systems and Security] → [Management tools] → [Internet Information Services (IIS) Manager] of the operating system, and open the IIS Manager.

(2) Select [Default Web Site] in the directory tree on the left side of the window, right-click, and select the "add Virtual Directory" option in the drop-down menu, as shown in figure 1-7. Create a virtual directory called "jakarta", and the corresponding actual file path should be the directory / conf where the isapi_redirect.dll file is located, as shown in figure 1-8.

Figure 1-7 Select the "add Virtual Directory" menu

Figure 1-8 add a virtual directory

Add the JK plug-in to IIS as an ISAPI filter

After adding a virtual directory named "jakarta" to the IIS, you should also add the JK plug-in to the IIS as an ISAPI filter (also known as a filter). Here are the steps.

(1) Select the "Default Web Site" node in the directory tree on the left side of the IIS manager window, and then select the "ISAPI filter" column in the right window to add a new ISAPI filter with the name "jakarta" and the executable file / conf / isapi_redirect.dll, as shown in figure 1-9.

Figure 1-9 add a new ISAPI filter

(2) Select the IIS host node in the directory tree on the left side of the IIS manager window, then select the "ISAPI and CGI restrictions" column in the right window, and then add a new ISAPI and CGI limit, as shown in figure 1-10. In figure 1-10, check the option "allow execution of the extension path".

Figure 1-10 add ISAPI restrictions

1.6 Test configuration

Restart the Tomcat server and the IIS server and visit through the browser:

Http://localhost/index.jsp

If the default home page for Tomcat appears, the configuration has been successful. In addition, if the helloapp application has been released on the Tomcat server (copy the helloapp directory under the sourcecode directory of the accompanying source code package to the / webapps directory), you can visit:

Http://localhost/helloapp/hello.htm

If the hello.htm web page of the helloapp application is returned normally, the configuration has been successful. If the configuration is incorrect, you can follow the following methods to find the cause of the error:

(1) if the isapi_redirect.dll, workers.properties, and uriworkermap.properties files are not in the same directory, try putting them in the same directory.

(2) make sure that the downloaded JK plug-in file matches the Windows version.

(3) check whether the "Jakarta Isapi Redirector" key is registered in the registry.

(4) make sure that the name and file path provided are correct when adding virtual directories and ISAPI filters to the IIS manager.

(5) after adding a virtual directory or ISAPI filter to IIS Manager, restart the IIS server to take effect.

You can view the log information generated by the JK plug-in, which helps you find the cause of the error. Set the location of the log file in the registry to / logs/isapi.log.

At this point, the study on the installation, startup and use of Tomcat and IIS is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report