Integrated Tomcat Server and Apache Server under Win2000 Professional System

zhaozj2021-02-16  46

This article uses software download address

(1) Windows 2000 Service Pack 3.exe download address:

http://download.microsoft.com/download/win2000platform/sp/sp3/nt5/enw2ksp3.exe

(2) J2SDK-1_4_1_02-windows-i586.exe download address:

http://java.sun.com/webapps/download/Redirect/32167382/5847479377282807053505607246086069333228071972022813600060132859339008063305596058473206-3865/j2sdk-1_4_1_02-windows-i586.exe

(3) JAKARTA-TOMCAT-4.1.18-le-jdk14.exe download address:

http://apache.linux process.net/dist/jakarta/tomcat-4/binaries/tomcat-4.1.18-le-jdk14.exe

(4) Apache_2.0.44-win32-x86-no_ssl.msi download address:

http://apache.linuxforum.net/dist/httpd/binaries/win32/apache_2.0.44-win32-x86-no_ssl.msi

(5) MOD_JK2-2.0.43.dll download address:

Http://jakarta.apache.org/builds/jakarta-tomcat-connectors/jk2/release/v2.0.1/bin/win32/mod_jk2-2.0.43.dll

Foreword: Use mod_jk2 to integrate Tomcat servers and Apache servers, simply.

First, install Windows 2000 Professional

After installed Windows 2000 Professional, it is highly recommended to install Windows 2000 Service Pack 3 because the latest JDK is installed under Windows 2000, you need to install Windows 2000 Service Pack 3 in advance.

Second, install JAVA's JDK (J2SDK-1_4_1_02-Windows-i586.exe)

When installing, according to the default directory: C: /J2SDK1.4.1_02, you need to set the system variable after the JDK installation is complete. Right-click "My Computer" on the desktop, click "Properties", select "Advanced", click "System Variable", do the following settings in "System Variable":

(1) Locate Path, click "Edit", only in the "variable value" last added: C: /J2SDK1.4.1_02/bin;

Then click "OK".

(2) Point "New", enter: ClassPath in "Variable Name"

Enter: C: /J2SDK1.4.1_02/lib/tools.jar;

Then click "OK", pay attention to the previous point, which represents the current directory, and you can go to any directory to execute the Java program in the directory.

Third, install Tomcat (Jakarta-Tomcat-4.1.18-Le-jdk14.exe)

Only change the installation directory during installation, set to C: / Tomcat 4.1, the rest is the default, password itself setting itself. After the Tomcat installation is complete, you also need to set the system variable, right-click "My Computer" on the desktop, click "Properties", select "Advanced", click "System Variable", do the following settings in "System Variable": (1) Click "New", enter: java_home in "Variable Name"

Enter: C: /J2SDK1.4.1_02 in Variable Value

Then click "OK" to save.

(2) Click "New", enter: Tomcat_home in "Variable Name"

Enter: C: / Tomcat 4.1 in "Variable Value"

Then click "OK" to save.

Fourth, test Tomcat

(1) Start the Tomcat server, click "Start Tomcat" in "Start" -> "Programs" -> "Apache Tomcat 4.1", do not turn off it), Tomcat servers start running .

(2) Enter http: // localhost: 8080 / after IE, see the top of Tomcat (with only a kitten above) indicates successful installation.

(3) Turn off the Tomcat server, "Stop Tomcat" in "Start" -> "Programs" -> "Apache Tomcat 4.1" (the "command prompt" window when the server is turned on automatically, the Tomcat server stops Run.

V. Establish a virtual directory

The Tomcat server has the default virtual directory (C: / Tomcat 4.1 / webapps), but we generally put it under the self-built folder when developing websites. If we want to turn the general folder into the virtual directory known, we need yourself. . Now introduce the method of configuring the Tomcat virtual directory:

(1) Establish a zgtt folder on the D disk, then make a simple JSP file under the folder (for testing), named index.jsp, the content is as follows:

Hello </ Title></p> <p></ hEAD></p> <p><body></p> <p><% OUT.PRINTLN ("Hello World!");%></p> <p></ body></p> <p></ html></p> <p>(2) Turn off the Tomcat server (see "IV, Test Tomcat" (3)).</p> <p>(3) Under the C discharge, open the "Tomcat 4.1" folder, then open the subdirectory "conf" find the "server.xml" file, open it with Notepad and find "</ host>", in </ host > In front Add this code: <context path = "/ zgtt" DOCBASE = "D: / zgtt" debug = "0" reloadable = "true" crossText = "true"> </ context>, then save the file.</p> <p>(4) Start the Tomcat server (see "IV, Test Tomcat" (1)). (5) After entering the http: // localhost: 8080 / zgtt / index.jsp link, if you see "Hello World!", It means that the virtual directory ZGTT is set successfully.</p> <p>6. Install apache (apache_2.0.44-win32-x86-no_ssl.msi)</p> <p>(1) Change the installation directory when installing, set to C: /.</p> <p>(2) Parameter settings can beyed any value (note to fill in the format of the prompt).</p> <p>(3) Modify a small error:</p> <p>Apache2.0.44 has a small problem. After the default installation is successful, there is no index.html file in the HTDOCS directory under the home directory, we must rename index.html.en in this directory as index.html.</p> <p>(4) Resolve the Chinese: Edit the configure file httpd.conf in editing the C: / Apache2 / Conf directory. Use Notepad to open it and find "AddDefaultCharset ISO-8859-1", comment out "AddDefaultCharset ISO-8859-1", ie before "#" characters before "" ". Then add the following three lines below "#adddefaultset ISO-8859-1":</p> <p>AdddefaultCharset GB2312</p> <p>DEFAULTLANGUAGE GB2312</p> <p>AddLanguage EN-CN .CN</p> <p>Seven, test Apache</p> <p>After installing the Apache server, we need to test it and see if it is successful.</p> <p>(1) Start Apache Server: Point "Start" -> "Program" -> "Apache Http Server 2.0.44" -> "Control Apache Server" -> "Monitor Apache Servers", if you see in the system "Turnd" The green small triangle appears on the feather icon of Apache. Then, the Apache server is successfully launched.</p> <p>(2) After entering "http: // localhost" in IE, see the Apache's Apache home page indicates successful installation.</p> <p>(3) Close the Apache server: Click the Apache icon in the system "Tow", select "STOP", if you see the red dot on the system "Tow" feathers. Then, the Apache server is successfully closed. .</p> <p>Eight, integrate Apache Server and Tomcat Server</p> <p>This is the most critical step, be sure to follow steps:</p> <p>(1) Turn off the Apache server (see "Seven, Test Apache" (3)).</p> <p>(2) Turn off the Tomcat server. (See "IV, Test Tomcat" (3)).</p> <p>(3) Copy mod_jk2-2.0.43.dll to the C: / Apache2 / Modules subdirectory.</p> <p>(4) Edit the configuration file httpd.conf in the C: / Apache2 / Conf directory. The last addition of this file</p> <p>Count a few lines:</p> <p>LoadModule JK2_Module Modules / MOD_JK2-2.0.43.DLL</p> <p><Virtualhost *></p> <p>ServerAdmin Webmaster@dummy-host.example.com</p> <p>DocumentRoot "C: / Tomcat 4.1 / WebApps"</p> <p>ServerName Dummy-Host.example.com</p> <p>DirectoryIndex index.htm index.html index.jsperrorlog logs / dummy-host.example.com-error_log</p> <p>Customlog logs / dummy-host.example.com-access_log Common</p> <p></ Virtualhost></p> <p>Note that DocumentRoot is consistent with your own Tomcat installation directory.</p> <p>DirectoryIndex is a file that automatically explains the JSP type.</p> <p>(5) Newly built a file in the C: / Apache2 / Conf directory, must be named Workers2.properties. The contents of workers2.properties are as follows:</p> <p>[SHM]</p> <p>File = $ {serverroot} /logs/shm.file</p> <p>SIZE = 1048576</p> <p># Example Socket Channel, Override Port and Host.</p> <p>[Channel.socket: Localhost: 8009]</p> <p>Port = 8009</p> <p>Host = 127.0.0.1</p> <p># Define the worker</p> <p>[AJP13: Localhost: 8009]</p> <p>Channel = CHANNEL.SOCKET: Localhost: 8009</p> <p># Uri mapping</p> <p>[URI: / *]</p> <p>Worker = ajp13: Localhost: 8009</p> <p>Nine, test Apache servers and Tomcat server integration</p> <p>(1) Start the APACHE server (see "7. Test Apache" in "7. Test Apache").</p> <p>(2) Start the Tomcat server (see "4. Test Tomcat" in (1).</p> <p>(3) Enter "http: // localhost: 8080 / zgtt / index.jsp" in IE. After the link, if "Hello World!" Is seen, it indicates that Tomcat starts successfully.</p> <p>(4) Enter "http: //localhost/zgtt/index.jsp" in IE. After link, if you see "Hello World!" Again, the Apache server and Tomcat server are integrated successfully.</p></div><div class="text-center mt-3 text-grey"> 转载请注明原文地址:https://www.9cbs.com/read-28259.html</div><div class="plugin d-flex justify-content-center mt-3"></div><hr><div class="row"><div class="col-lg-12 text-muted mt-2"><i class="icon-tags mr-2"></i><span class="badge border border-secondary mr-2"><h2 class="h6 mb-0 small"><a class="text-secondary" href="tag-2.html">9cbs</a></h2></span></div></div></div></div><div class="card card-postlist border-white shadow"><div class="card-body"><div class="card-title"><div class="d-flex justify-content-between"><div><b>New Post</b>(<span class="posts">0</span>) </div><div></div></div></div><ul class="postlist list-unstyled"> </ul></div></div><div class="d-none threadlist"><input type="checkbox" name="modtid" value="28259" checked /></div></div></div></div></div><footer class="text-muted small bg-dark py-4 mt-3" id="footer"><div class="container"><div class="row"><div class="col">CopyRight © 2020 All Rights Reserved </div><div class="col text-right">Processed: <b>0.039</b>, SQL: <b>9</b></div></div></div></footer><script src="./lang/en-us/lang.js?2.2.0"></script><script src="view/js/jquery.min.js?2.2.0"></script><script src="view/js/popper.min.js?2.2.0"></script><script src="view/js/bootstrap.min.js?2.2.0"></script><script src="view/js/xiuno.js?2.2.0"></script><script src="view/js/bootstrap-plugin.js?2.2.0"></script><script src="view/js/async.min.js?2.2.0"></script><script src="view/js/form.js?2.2.0"></script><script> var debug = DEBUG = 0; var url_rewrite_on = 1; var url_path = './'; var forumarr = {"1":"Tech"}; var fid = 1; var uid = 0; var gid = 0; xn.options.water_image_url = 'view/img/water-small.png'; </script><script src="view/js/wellcms.js?2.2.0"></script><a class="scroll-to-top rounded" href="javascript:void(0);"><i class="icon-angle-up"></i></a><a class="scroll-to-bottom rounded" href="javascript:void(0);" style="display: inline;"><i class="icon-angle-down"></i></a></body></html><script> var forum_url = 'list-1.html'; var safe_token = 'vHGTNF0VYqFhCuNG6JoNdwSgztfBMVVH8TvPgRetvXww_2FBCm3YLm7dBsdLFMzHo_2Bl6zQzb_2FsZ1KxfJeT'; var body = $('body'); body.on('submit', '#form', function() { var jthis = $(this); var jsubmit = jthis.find('#submit'); jthis.reset(); jsubmit.button('loading'); var postdata = jthis.serializeObject(); $.xpost(jthis.attr('action'), postdata, function(code, message) { if(code == 0) { location.reload(); } else { $.alert(message); jsubmit.button('reset'); } }); return false; }); function resize_image() { var jmessagelist = $('div.message'); var first_width = jmessagelist.width(); jmessagelist.each(function() { var jdiv = $(this); var maxwidth = jdiv.attr('isfirst') ? first_width : jdiv.width(); var jmessage_width = Math.min(jdiv.width(), maxwidth); jdiv.find('img, embed, iframe, video').each(function() { var jimg = $(this); var img_width = this.org_width; var img_height = this.org_height; if(!img_width) { var img_width = jimg.attr('width'); var img_height = jimg.attr('height'); this.org_width = img_width; this.org_height = img_height; } if(img_width > jmessage_width) { if(this.tagName == 'IMG') { jimg.width(jmessage_width); jimg.css('height', 'auto'); jimg.css('cursor', 'pointer'); jimg.on('click', function() { }); } else { jimg.width(jmessage_width); var height = (img_height / img_width) * jimg.width(); jimg.height(height); } } }); }); } function resize_table() { $('div.message').each(function() { var jdiv = $(this); jdiv.find('table').addClass('table').wrap('<div class="table-responsive"></div>'); }); } $(function() { resize_image(); resize_table(); $(window).on('resize', resize_image); }); var jmessage = $('#message'); jmessage.on('focus', function() {if(jmessage.t) { clearTimeout(jmessage.t); jmessage.t = null; } jmessage.css('height', '6rem'); }); jmessage.on('blur', function() {jmessage.t = setTimeout(function() { jmessage.css('height', '2.5rem');}, 1000); }); $('#nav li[data-active="fid-1"]').addClass('active'); </script>