Integration of Apache2 and Tomcat4 in jsp + phpWindows2000

Source: Internet
Author: User
I have passed the test in this article! Question: integration of Apache2 and Tomcat4 in Windows2000 author: robornet date: 2002-10-30 reason: javSyntaxHighlighter. all () for a while ();

========================================================== ===== I have passed the test in this article! ========================================================== ===== Question: integration of Apache2 and Tomcat 4 in Windows author: robornet date: 2002-10-30 reason: a java project for a period of time, it is time to distribute, I couldn't find a copy of the latest integrated configuration of Apache2 and Tomcat4. I read the online jakarta documents for half a day and wrote this configuration document for reference by referring to previous articles from netizens, thank you! Directory: 1. software preparation 2. software installation 3. initial configuration and testing 4. integrated configuration 5. full-line testing 6. insufficient 7. thank you 8. Instructions: 1. software preparation: suppose you have a hard software environment that runs win2000 normally. 1. j2sdk1.4.1: http://java.sun.com/j2se/1.4.1/download.html Download! (Note the sdk version for Windows (all languages ages, including English) 2. Apache2.0.43: http://www.apache.inetcosmos.org/dist/httpd/binaries/win32/apache_2.0.43-win32-x86-no_ssl.msi Download! 3. Tomcat4.1.12: http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.1.12/bin/jakarta-tomcat-4.1.12.exe Download! 4. mod_jk.dll: http://jakarta.apache.org/builds/jakarta-tomcat-connectors/jk/release/v1.2.0/bin/win32/mod_jk-2.0.42.dll Download! (Note, because the mod_jk2-2.0.43.dll and Apache2.0.43 configuration was not successful, now use mod_jk-2.0.42.dll instead) 2, software installation: (1) install j2sdk: 1. install apache by following the installation wizard (usually under C: j2sdk1.4.1 to facilitate the following operations) (2) install apache: 1. follow the installation wizard to install Tomcat (select the installation directory as C: to facilitate the following operations; after the installation is successful, the path is C: Apache2) (3) install Tomcat: 1. follow the installation wizard to install tomcat (change the installation directory to C: Tomcat4. if it is only a test, you do not need to install tomcat as a service to facilitate the following operations). In this case, you will be asked to enter Admin (system administrator) password. 3. initial configuration and test: configure the software environment for the first time and test the environment. (1) configuration -- environment variable: 1. create a system variable JAVA_HOME with the value: C: j2sdk1.4.1 // If you have not installed it in the preceding path, change it to the correct path. 2. create a system variable TOMCAT_HOME with the value C: Tomcat4 // same as above 3. create a new system variable CLASSPATH with the value % JAVA_HOME % lib; % TOMCAT_HOME % lib (2) modification error: Testing (3) test default service: run Apache2 and Tomcat4. 1 first. open your browser and enter: http://localhost Check: the welcome page of Apache2 is displayed in the browser. it indicates that Apache2 is working normally. (Note: The default Tomcat port is 80. if other programs are used, change the port. See the following description.) 2. open your browser and enter: http://localhost : 8080 check: the welcome page of Tomcat is displayed in the browser. it indicates that Tomcat works normally. (Note: The default Tomcat port is 8080. if other programs are using this port, change it. The following is a description.) summary: if there are no errors in this step, continue with the following operations, let go! (4) test your project: Now you only use Tomcat to test your project. to facilitate this example, assume that you already have a project under the E: ApplicationOA Directory (including index. jsp and other jsp files and beans, such as servlets and javabean under WEB-INFclasses ). 1. set Tomcat to support your project, open the C: Tomcat4confserver. xml file, in""Before ,""Add later And save. Description: Context (indicating a web application): docBase defines the path of the application; path indicates the prefix of the url of the web application. the request url is http: // localhost: 8080/oa; reloadable this attribute is very important, if it is true, tomcat will automatically detect the application's/WEB-INF/lib and/WEB-INF/classes directory changes, automatically load modifications or new beans and servlets. we can see the changes that bean brings to jsp without restarting tomcat. 2. start Tomcat4.1.12 and enter http: // localhost: 8080/oa in the address of the browser. for example, if your jsp and bean are correct, the servlet will normally include your index. the content of the jsp/index.html file is executed and displayed. Summary: If there are no errors in this step, continue with the following operations. Let go! IV. integrated configuration: Configure Apache and Tomcat to work together for you. If Apache2 and Tomcat4 are running, disable them. (1) configure Apache2: 1. copy the downloaded mod_jk-2.0.42.dll to C: Apache2modules first. 2. set the home page file type: open httpd. conf under C: Apache2conf and find "DirectoryIndex". Add index. jsp to index.html and save the file. Note that there should be spaces between them. 3. set the VM so that Apache can automatically control html and jsp parsing: Open C: Apache2confhttpd. conf, add the following code and save it. // Localhost is the local machine, you can use the local ip ServerAdmin robornet@robornet.com // your mail address DocumentRoot E: Application // your project team root directory, because the Application has OA and multiple other projects, you can only set it to E: Application ServerName localhost // your service name. if your machine has a domain name, set it to a domain name, however, the local machine is used for testing ErrorLog logs/logs // error logs. in C: Apache2logs, you can use any other name CustomLog logs/robornet_Custom_log.txt common // access logs. in C: Apache2logs, any other name is available. 4. set the connection between Apache and Tomcat. When Apache encounters a jsp file, it is handed over to Tomcat in the background for processing: Open C: Apache2confhttpd. conf, add the following code and save it. # Using mod_jk2.dll to redirect dynamic callto Tomcat LoadModule jk_module modules/mod_jk-2.0.42.dll // load module for handling connection JkWorkersFile "C:/Tomcat4/conf/workers. properties "// sets the module's working File. The following describes JkLogFile" C:/atat4/logs/mod_jk2.log "// sets the log file for the module to work, when Tocmat is started, self-built JkMount/servlet/* ajp13 // enables Apache to support servlet transmission for Tomcat to parse JkMount /*. jsp ajp13 // let Apache support jsp transmission, which is used for Tomcat parsing summary: the configuration of Apache is basically complete, but it still cannot work normally when Apache is started. (2) configure Tomcat4: 1. create a file workers. properties under C: Tomcat4conf and pay attention to the file suffix. we recommend that you use EditPlus or UltraEdit to create a file. if you use notepad, remember to change the name and do not need workers.properties.txt! The content is as follows: workers. tomcat_home = c: Tomcat4 // let the mod_jk module know about Tomcat workers. java_home = c: j2sdk1.4.1 // let the mod_jk module know j2sdk ps = worker. list = ajp13 // module version. The current version is ajp14. do not modify worker. ajp13.port = 8009 // working port. do not modify worker if it is not occupied. ajp13.host = localhost // the local machine. if the above Apache host is not localhost, modify worker accordingly. ajp13.type = ajp13 // type worker. ajp13.lbfactor = 1 // number of proxies, no need to modify 2. open the server under C: Tomcat4conf. xml File: Find" ", Convert the previous code: Changed: Save and close it. summary: you must be tired! Well, you can have a cup of java to enjoy your achievements! 5. full-line testing: 1. start Apache2 and Tomcat4. 2. open your browser and enter http: // localhost: 8080/oa in the address bar. if it is the same as the above test, Tomcat will be normal after reconfiguration! 3. enter http: // localhost/oa in the address bar. if the result is the same as that of http: // localhost: 8080/oa, congratulations! Apache2 and Tomcat4 have been integrated successfully !!! VI. Disadvantages: 1. although the latest Apache2.0.43 and Tomcat4.1.12 are used, I am using jk connection. I just used jk2 and the configuration failed, so I had to write this document! 2. Tomcat is still using Tomcat-Standalone, but Tomcat-Apache is not used, but you can do it yourself. This should not be a problem! 7. thanks: 1. thanks to the Apache organization for providing me with such a good server, and it is still free! 2. I would like to thank my friends who have previously written the Apache1.x and Tomcat3.x/Tomcat4. * configuration documents for reference! 8. note: 1. if you feel satisfied, I would like to reprint or add this article, I am very grateful, but please note the author robornet and the source http://www.xtong.com.cn/rob

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.