Battle Tomcat and Apache integration

xiaoxiao2021-03-05  25

First of all, thank the author of the article, especially the author of the first article.

Junsan JIN, under their guidelines, complete this integration, special expressions, the most sincere gratitude:

1.Tomcat and Apache Integration Guide http://dev.9cbs.net/Article/67/67170.shtm

2. Configure the integration of WIN APACHE PHP MYSQL TCOMCAT (or RESIN) full manual http://www.ttud.com/info/1264.htm

The body start:

Part 1: Preparation software 1. J2SDK-1_4_2_04-windows-i586-p.exe download address: http://www.dascom.com.cn/download/j2sdk-1_4_2_04-windows-i586-p.exehttp: // www .dascom.com.cn / quDONG / DOWNLOAD.ASP2. Apache_2.0.53-win32-x86-no_ssl.msi download address: http://apache.justdn.org/httpd/binaries/win32/apache_2.0.53-win32- x86 -no_ssl.msi3. jakarta-tomcat-5.0.30.exe download address: http://apache.justdn.org/jakarta/tomcat-5/v5.0.30/bin/jakarta-tomcat-5.0.30.exe4. MOD_JK_1 .2.6_2.0.50.dll Download Address: http://apache.linuxForum.Net/dist/jakarta/tomcat-connectors/jk/binaries/win32/jk-1.2.6/

Part II: Installer 1. Install J2SDK1.4.2 Install it under C: /J2SDK1.4.2_04 2. Install the Apache server to run the Apache automatic installation package, install the Apache2.0.53 to the C: / Apache / Apache2 directory. 3. Install the Tomcat server to run Tomcat's automatic installation package, install Tomcat 5.0.30 to C: / Apache / Tomcat5 directory. 4. Install the MOD_JK Copy MOD_JK_1.2.5_2.0.50.dll file to the C: / Apache / Apache2 / Modules folder. 5. Prepare the working directory and test files in E: Create a new directory WWW, and create a basic index.jsp file, the source code as follows: <% out.println (""); out.println ("< Body> "); Out.println (" Welcome "); Out.println (" "); Out.Println (" ");%>

Part III: Configure the apache server to edit the httpd.conf file, open the httpd.conf file with the text editor, add the following: # @ using mod_jk2.dll to redirect Dynamic Calls to Tomcat loadModule JK_Module Modules / Mod_jk_1.2.6_2 .0.50.dllJkWorkersFile "C: /Apache/Tomcat5/conf/workers.properties" JkLogFile "C: /Apache/Tomcat5/logs/mod_jk2.log" JkLogLevel infoJkMount / servlet / * ajp13JkMount /*.jsp ajp13Alias ​​/ web "E: / WWW / " Options Indexes MultiViewsAddoutputfilter Includes HTMLALLOWOVERRIDE NONEORDER Allow, Denyallow from allow, denyallow from allow, denyallow from all

Part IV: Configure Tomcat Server 1. Create a new text document in a C: / Apache / Tomcat5 / Conf / Directory and named Workers.properties, write as follows: workers.tomcat_home = C: / Apache / Tomcat5 # Let the MOD_JK module know tomcat workers.java_home = c: /j2sdk1.4.2_04 # Let the mod_jk module know the J2SDK PS = / Worker.List = ajp13 # module version, existing AJP14, do not modify

Worker.ajp13.port = 8009 # work port, if you don't take it, you don't have to modify the worker.ajp13.host = localhost # native, if the above Apache host is not localhost, make the corresponding modification worker.ajp13.type = ajp13 # Type Worker .ajp13.lbFactor = 1 # Agent number, no modification

worker.loadbalancer.type = lb worker.loadbalancer.balanced_workers = ajp12, ajp13worker.inprocess.type = jni worker.inprocess.class_path = $ (workers.tomcat_home) $ (ps) classes worker.inprocess.class_path = $ (workers.tomcat_home ) $ (ps) lib $ (ps) jaxp.jar worker.inprocess.class_path = $ (worker.tomcat_home) $ (ps) lib $ (ps) Parser.jar worker.inprocess.class_path = $ (workers.tomcat_home) (PS) Common $ (PS) LIB $ (PS) Jasper.jar Worker.inProcess.class_path = $ (Workers.Tomcat_Home) $ (PS) COMMON $ (PS) LIB $ (PS) Servlet.jar Worker.inProcess.class_path = $ (workers.tomcat_home) $ (PS) Common $ (PS) LIB $ (PS) WebServer.jarworker.inProcess.class_path = $ (Workers.java_Home) $ (PS) LIB $ (PS) Tools.jar Worker.inProcess .cmd_line = -config worker.inprocess.cmd_line = $ (workers.tomcat_home) /conf/jni_server.xml worker.inprocess.cmd_line = -home worker.inprocess.cmd_line = $ (workers.tomcat_home) worker.inprocess.jvm_lib = $ (Workers.java_Home) $ (PS) JRE $ (PS) BIN $ (PS) Classic $ (PS) JVM.dll Worker.inProcess.stdout = $ (workers.tomcat_home) $ (ps) inProcess.stdout worker.inprocess. stde RR = $ (worker.tomcat_home) $ (ps) inProcess.stderr worker.inprocess.sysprops = tomcat.Home = $ (workers.tomcat_home) 2. Modify the server.xml file to join the following items in the .

3. After modifying jk2.properties file modification, the content is as follows: ## this file may be overriden AT RUNTIME. MAKE SURE TOMCAT IS sTOPED ## WHEN YOU EDIT THE FILE. ## COMMENTS WILL BE _LOST _ ## DOCUMENTATION OF THE FORMAT IN JkMain javadoc. # Set the desired handler listhandler.list = apr, request, channelJni ## Override the default port for the socketChannel # channelSocket.port = 8019 # default: # channelUnix.file = $ {jkHome} /work/jk2.socket# Just to check if the the config is working # shm.file = $ {jkHome} / work /jk2.shm# In order to enable jni use any channelJni directive # channelJni.disabled = 0 # And one of the following directives: # apr.jniModeSo = / opt / apache2 / modules / mod_jk2.so # If set to inprocess the mod_jk2 will Register natives itself # This will enable the starting of the Tomcat from mod_jk2 # apr.jniModeSo = inprocess # request.tomcatAuthentication = true request.tomcatAuthentication = false part V: configuration system environment I with Win98, thus directly modify the autoexec.bat file. Add Java_Home = C: /J2SDK1.4.2_04Set Tomcat_Home = C: /J2SDK1.4.2_04Set Tomcat_Home = C: / Apache / Tomcat5Set Catalina_Home = C: / Apache / Tomcat5Set Path =% PATH%;% java_home% / bin

Set classpath =;% java_home% / lib / dt.jar;% java_home% / lib / Tool.jar;% java_home% / lib / netcomponents.jar;% java_home% / lib / mm.mysql-2.0.4-bin. Jarset ClassPath =% ClassPath%;% Tomcat_Home% / Common / CLASSES;% Tomcat_Home% / Common / lib;% Tomcat_Home% / Common / lib / servlet-api.jar If Win2000 or Win XP should be used, it should be slightly different. But the above environment variables are still needed.

Set the properties of MS DOS mode

Find the startup.bat and shutdown.bat files, right-click Properties, change the memory -> General Memory -> The initial environment is changed to the maximum 4096, otherwise Tomcat will not start.

Restart the system after the above configuration is complete.

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

New Post(0)