Configuration of Tomcat & Apache under Win2000

xiaoxiao2021-03-06  76

Configuration of Tomcat & Apache under Win2000

Author: qlampskyface

Contact your author: xiaozuidaizhi@sina.com ----------------------------------------------------------------------------------------------------------------------------------------------------------- ---------------------------------------

Before configuring, you have to define two points.

1. Why is you configured? 2. Why is it so configured?

1. Why is you configured? In fact, as Tomcat, after the installation is complete, it has been used as a website server. For many users, it is enough, so if your purpose is not a configuration, but use, then you are likely to don't need to look. However, Tomcat is separate as a website server, there are some defects, such as 1. Tomcat handling static page without apache fast 2. Tomcat is not as easy to configure 3. Tomcat No Apache stabilizes robust 4. Apache supports CGI scripts and API, Perl, PHP, etc. It is because of the above reasons, we will integrate both when we are in some cases. I reiterate again ----- Tomcat Apache's biggest benefit is to let them all their duties: Apache is responsible for analyzing static pages, Tomcat is responsible for processing servlet / jsp.

2. Why is it so configured? You are likely to have also heard of WebLogic, WebSphere, and JBuilder integration cases. These cases can also configure the website server, JBuilder, WebLogic ... These tools are not good, but these tools have a fatal weakness, that is --- They is not free! And Tomcat Apache is Free, and for individuals, as well as small and medium-sized companies, Tomcat Apache is already enough, so I don't have to say it below.

Ok, let's start configuring our website server! Let me talk about some installation files we need.

J2SDK (I am 1.4.2), Apache Http Server (I am 2.0.43), Tomcat (I am 4.1.29), mod_jk2-2.0.43.dll. Why do you want to mention the software version? It is because there is a slight difference between the possible configuration between the different versions, but do not only the version of the version, when the version is different, I don't know what to do. In fact, as long as I understand the reason, I don't leave it. You don't have to worry about the version.

Apache http server2.0: (25.0.43 is found to find 47 or 48) http://www.apache.org/dist/httpd/binaries/win32/apache_2.0.43-win32- x86-no_ssl.exe Tomcat: http://www.apache.org/dist/jakarta/tomcat-4/v4.1.29/bin/jakarta-tomcat-4.1.29.EXE MOD_JK2-2.0.43.DLL: (Under the down to decompress Http://www.apache.org/dist/jakarta/tomcat-connectors/jk2/binaries/win32/jakarta-tomcat-connectors-jk2.0.2-win32-apache2.0.43.zip

We should configure it according to the following five steps, it will feel very clear. 1. Installed. 2. Set the environment variable. 3. Integration. 4. Add. 5. Test.

First, install it. It should be noted that please install in the order of J2SDK, Apache, Tomcat. This is because we are configured to configure Tomcat into an in-Process component of Apache. When the page is handled, Apache first gets this page, then analyzes the page. If this page is just a static page, then Apache will handle itself, do not hand it over to Tomcat, but if the page is a non-static page In order to hand over to Tomcat to the station, hand it over to Apache after processing. That's why you have to install the Apache after installing Tomcat. Furthermore, when installing Apache, you need to fill in 1. Domain name 2. Server name 3.email needs to fill in (such as 127.0.0.0.1, etc.), set the environment variable. A total of five. 1.java_home 2.path 3.classpath 4.catalina_home 5.tomcat_home About the first three configurations I don't say much, is the setting of JDK. Where you want to put the Tools.jar and Dt.jar of the JDK's lib directory in Classpath. The configurations of 4th and 5th items are the same: all Tomcat installation paths (such as my Tomcat installed in D: / Program Files / Apache Group / Tomcat 4.1)

Third, integration. Copy the above MOD_JK2-2.0.43.dll into the modules folder in the Apache2 directory. The integration operation is very simple, but it is significant, relying on this file, the Apache and Tomcat can be used. Pay special attention to this link is that there are two mod_jk files. One is the JK2 we used. One is JK (such as MOD_JK_1.2.5_2.0.47.dll), this is specially paying special attention when the initial configuration, Don't look wrong, because different file configuration methods are completely different, remember to remember!

Fourth, add it. In this link, two files in two places need to be added.

The first is the modification of the httpd.conf configuration file in the confoc folder in the Apache2 installation directory;

The second is a property file called Workers2.Properties in the CONF folder in the Tomcat installation directory. Since both are the confed directory, don't make a mistake.

First, modify the httpd.conf file: Open httpd.conf file, find DirectoryIndex, add index.jsp after index.html index.html.var, pay attention to separated by spaces. This purpose is to let Index.jsp use files that open formats by default. Add the following in HTTPD.CONF. LoadModule jk2_module modules / mod_jk2-2.0.43.dll ServerAdmin webmaster @ djb DocumentRoot "D: / Program Files / Apache Group / Tomcat 4.1 / webapps / ROOT" ServerName djb wherein LoadModule is loaded with the Apache Tomcat integration module mod_jk ..., In this way, when Apache encounters the JSP file, it will be handled in Tomcat in the background. WebMaster @ DJB is your mail address. When the server has a problem, it is displayed on the error page, which is convenient for others to contact you. DocumentRoot is the entrance of the website, the total path, this must be consistent with the entry of Tomcat, here I let it point to the default page of Tomcat. It should be noted here that if there is no space in your Tomcat path, you don't have to use "" to take the path, but if you have space, there must be "" " ServerName is the machine name where Apache is installed. Here, especially note that the backslash / must be all replaced on your path to /, remember to remember the second place, add a workers2.properties file. New files under the CONF folder under the Tomcat installation directory, named Workers2.properties. Add the following in which: # Define the communication channel [channel.socket: localhost: 8009] info = Ajp13 forwarding over socket tomcatId = localhost: 8009 # Map All webapp to the Web server uri space [uri: / *] info = Map The who webapp is the descriptive text in the # beginning. Here is done to define the ACHE and Tomcat's AC port (8009 port) and protocol (AJP13), and URI. The URI section is not necessarily in accordance with the above definition, you can set it to yourself. For example, when you only want to open the Sub-path Examples, you can define the following: # Map the Tomcat Examples WebApp to the Web Server Uri Space [URI: / Examples / *] info = map the whole webapp.

转载请注明原文地址:https://www.9cbs.com/read-120831.html

New Post(0)