Apache 2.0.48 / tomcat 4.1.29 / mod_jk for Windows XP Pro
Last Update: 12/13/2003
Building an Apache Http Tomcat Environment Is Five Major Steps:
Install JDKINSTALL APACHEINSTALL TOMCATISTALL A Connector, in this case jkconfigure and test
Since Tomcat is 100% Java, we'll use the binary install instead of having to deal with ant. My preference is to put things in locations on disk so that spaces are not part of the path name. Use whichever location suits your purposes, but there have been many posts on various mailing lists where path names with spaces caused mysterious, hard to diagnose problems. It's best to avoid them when possible. Aside from that, paths in this scenario do not have much effect as long as you can Guarantee That They Are Consistent Throughout The Various Configuration Steps.
Assumptions
Directory names, folder names, and any path names WILL NOT have spaces in them. Whenever possible, store things in places where the path names do not have spaces.Mod_jk is used as the Apache connector.You do not want multiple virtual hosts. If you want to have multiple virtual hosts, that is, more / other than http:. // localhost, check out my Virtual Hosting HOWTO (coming soon) you want Tomcat and Apache installed as services, not as user-level applications.Your User Account Has Administrator Privileges. if it doesn't, Find Someone Who Does.
Install JDK
go to Sun's Java download site and download J2SE for Windows:.. http://java.sun.com/j2se/1.4.2/download.html I prefer the SDK version, and I prefer the Offline Installation version Offline because then you Can Copy It To a Shared Folder or Even Burn It TO A CD, AND INSTALL IT AS MANY TIMES As You Like Without NEEDING AN IWNECTION. from here you've got The SDK Version, and Are Using the Offline Installation version. When you finish downloading, you will have a file called j2sdk-1_4_2_01-windows-i586.exe. To install J2SDK, just execute the file you downloaded. Once the Installer is finished unpacking, you'll be presented with .. a standard license prompt (screenshot) If you agree, choose the appropriate option and click Next.The installer will display a standard installation dialog (screenshot) Click Next This will install J2SE in C:. /j2sdk1.4.2_01, which is Fine. Register The Browsers On Your System, And Click Install. (Screenshot) After The Install HAS Finished, Click Finish.Build/INSTALL APACHE HTTP
First and foremost, make sure you do not have a web server or other process already listening on port 80. Click Start-> Administrative Tools-> Services and scroll the right hand window pane until you can see the service named World Wide Web Publishing. Highlight that service, and click the Stop icon in the toolbar. (screenshot) While you have the Services applet open, choose the World Wide Web Publishing service again, and click on the Properties icon in the toolbar. in the next window, choose Manual where it says Startup type. Click OK, then close the Services applet. (screenshot) Download the Windows MSI Apache distribution from a mirror. You want version 2.0.48. The filename is apache_2.0.48-win32-x86-no_ssl.msi. Execute the msi installer. You '
ll see a welcome screen. (screenshot) Click Next. Accept the terms of the license, and click Next again. The README file will be displayed. Read through it, and when finished, click Next.On the next screen, replace the default values with localhost for Network Domain and Server Name. for Email address, use your email address or any other value you wish. Make sure to choose the option for All Users, on Port 80 as well. Click Next when ready. (screenshot) On . the next screen, choose Typical and click Next We are going to put Apache 2.0.48 in a directory called C:.. / ApacheGroup Notice the lack of spaces in the path name to do this, click the button that says Change and use the file dialog box to change to the C:.. / drive, where you will create a new folder called ApacheGroup When finished, your screen should look like this If it does, click Next to continue to the next screen.You should be looking Click Install to Begin THE installation.When the installation is finished, a screen will be displayed Click the Finish button You should now have an Apache instance in C:... / ApacheGroup / Apache2 Verify the installation by opening a web browser and browsing to http: // localhost . If everything installed correctly, you will see an Apache Welcome page.Shutdown Apache until you can get the connector installed by right-clicking on the Apache monitor service in your taskbar (it's the tiny feather icon), and selecting Stop. (screenshot) Build / Install Tomcat
First, Create A Folder On Your Hard Drive. Call IT Tomcat, And Put IT ITE C Drive Root, So That You End Up with C: / Tomcat. Note: You Can Put Tomcat WhereEver You Like, IT IS Your Choice. Wherever you put it, try to keep spaces or other unusual characters out of the pathname.Now, grab the Windows EXE distribution for Tomcat 4.1.29 from a mirror site. The filename is jakarta-tomcat-4.1.29.exeOnce it is downloaded, execute the file.Agree to the license, and click Next. On the next screen, check the box marked NT Service. (screenshot) Click Next again.Next, change the directory where Tomcat will be installed. Change the default so that there are no spaces in the pathname. (screenshot) When the install completes, you'll be presented with a final screen that will let you test your installation. (screenshot) Make sure to use a decent password for the admin user. Click Next to verify And Complete the Installation.at this Point, Tomcat Should Be Running. Browse to http: // localhost: 8080 to be s .. Ure If everything is ready, you'll see the Tomcat Welcome page Verify the Tomcat examples are available at http: // localhost: 8080 / examples.Install the Connector The two connectors (JK and JK2) are different; JK2 is a Complete Rewrite of The Earlier JK / AJP13 Protocol. We'll Cover Installing JK Here. For JK2, Check Out MY
JK2 HOWTO (COMING SOON).
Download the connector binary for Windows from a Jakarta mirror site. Scroll down to where it says Tomcat Web Server Connectors and then click on JK 1.2 Binary Releases. Click on the Win32 folder and download the file named mod_jk_1.2.5_2.0.47.dll. When the download is complete, copy the DLL file to C: / ApacheGroup / Apache2 / modules Rename the file to mod_jk.dll This will leave you with C:... /ApacheGroup/Apache2/modules/mod_jk.dll The location on your System May Be Different ... That's Fine, The Point Is To Put The JK DLL File in Apache's Modules Directory, Wherever That May Be.Final Configuration
NOTE: these steps will allow access to the Tomcat examples via Apache on port 80. Successful use of the examples on port 80 shows that mod_jk is working correctly, since Tomcat is configured to run on port 8080 by default for HTTP requests.
You're going to be making edits to a file called server.xml in Tomcat's conf directory If you've used the installation locations suggested previously, the file you want is C:. /Tomcat/Tomcat-4.1/conf/server.xml This file is vital to Tomcat Operation, so it is a good idea to make a copy before it gets modified. Now, let's edit server.xml in tomcat's confsser you'd like like. For our purposes, we'll Use notepad. Look for a line That Says "Server" and has a port of 8005. add the folowing directly Below:
In The Host Container Add The Following Listener Directive (Yes, IT Looks Very Similar To The One Above):
INCLUDE "c: /tomcat/tomcat-4.1/conf/Auto/mod_jk.conf"
Note: the mod_jk.conf file gets created by Tomcat when Tomcat starts It gets created every time Tomcat starts So, if you have your server.xml configured, you can ignore httpd.conf (in most cases) except to add the Include.. . directive for mod_jk.conf you do not need to create or edit mod_jk.conf, Tomcat will do this for you Click here for a sample mod_jk.conf file generated automatically by Tomcat on each startup Create a file in C:.. / Tomcat / Tomcat-4.1 / Conf / JK Called WORKERS.PROPERTIES. IN THAT FILE, PUT The Following Lines:
Worker.list = ajp13 worker.ajp13.port = 8009 worker.ajp13.host = localhost worker.ajp13.type = ajp13
.. Save the file This file provides necessary information to mod_jk, like where to find Tomcat and what port to use when connecting Start Tomcat: Wait at least 30 seconds for tomcat to complete the startup process Verify that you have a file called C.: .. /Tomcat/Tomcat-4.1/conf/auto/mod_jk.conf and that the timestamp on that file is recent before going to the next step An example mod_jk.conf file can be found here.Start Apache Verify examples at http: / / localhost: 8080 / examples On success, Tomcat is working correctly.Verify examples at http:.. // localhost / examples On success, Apache is working correctly, and JSP and servlet requests are being passed to Tomcat.Please send comments, suggestions , or change.............................
Other Resources My Apache Tomcat Virtual Hosting Howto (COMING Soon)
My Apache Tomcat JK2 HOWTO (COMING SOON)
Oscar Carillo's Tomcat Site
Tomcat FAQ
Configure integration WIN APACHE PHP MYSQL TCOMCAT (or RESIN) full manual
Author: Unknown Source: Unknown Add Time: 2004-8-24 day New Software Park
System Requirements: Hardware can run the operating system, you can prepare for Win2K, WinXP or Win2003 operating system: Software list: (This is complete, the software version is complete) 1. Apache_2.0.47-win32-x86-no_ssl (Apache Web server 2, PHP-4.3.3-Win32 (PHP language parser) 3, mysql-4.0.12-win (mysql database) 4, J2SDK-1_4_2-windows-i586 (Java language environment) 5, JAKARTA-TOMCAT-5.0 .9 (Tomcat JSP Analytic Server) 6, Resin-3.0.3 (RESIN JSP Analytic Server) 7, MOD_JK_1.2.5_2.0.47.DLL (Integrated Apache Tomcat Plus) 8, mm.mysql-2.0.4-bin .jar (JSP Access Connection MySQL File) Start the installation: 1. APAHCE PHP MYSQL installation configuration 1. Install apache_2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.47-win32-x86-no_ssl, the program default installation path is: C: / Apache2 / Program Files / Apache Group /, You need to modify its installation path to: C: / (You can also make changes to modify the configuration). 2. After the installation is complete, the Apache service is automatically loaded, then open the browser, browse: http: // localhost, appear Apache Welcome page (this step needs to put the file in the C: / Apache2 / HTDOCS directory "index.html.en "Change to" index.html ", can display); if this step is abnormal, please check the installation source file, reinstall. 3. Install the PHP-4.3.3-win32, the general downloaded PHP file is a free-installed compressed package, unzipped to C: / PHP. 4. Configure PHP and Apache to resolve the PHP program.
PHP configuration: Remove "php.ini-dist" in the C: / PHP / directory "php.ini" and copy it to the C: / Windows / System32 (Win2K directory: C: / Winnt / System32) Apache configuration: C: /APAHCE2/CONF/HTTPD.CONF HTTPD.CONF D Add the following statement to support PHP program: Scriptalias / PHP / "C: / PHP /" AddType Application / X-httpd-php .php3 AddType Application / X-httpd-php .php addtype application / x-httpd-php .phtml action application / x-httpd-php "/ php/php.exe" 5. Restart the Apache server, write the following statement with the editor: Phpinfo ();?> Save the file name "Test.php" to the C: / Apache2 / HTDOCS directory, then open the browser, browse: http: // localhost / Test.php, the basic information of PHP appears will explain the configuration success. Strictly follow the above to explain the installation configuration, will succeed once. 6. Install MySQL-4.0.12-win, press "Next" to install successfully, then execute "winmysqladmin.exe" in the c: / mysql / bin directory, the initial information of MySQL appears, indicating successful installation. 7. PHP even slightly this, there is no problem. Come here, you can take a break, prepare the following long processes ... Second, install JDK and Tomcat 1. Install J2SDK-1_4_2-Windows-i586, JDK must be installed before Tomcat and Resin, the default installation path can be installed. 2. Install Jakarta-Tomcat-5.0.9, the default installation path can be installed. 3. Copy mm.mysql-2.0.4-bin.jar files to C: /J2SDK1.4.2/Lib and C: / Tomcat 5.0 / Common / lib 4. Set an environment variable (desktop -> My Computer -> Right click -> Select "Properties" -> Advanced -> Environment Variables), all settings are in the system variable bar.
New -> Variable Name: Java_Home -> Variable: C: /J2SDK1.4.2 New -> Variable Name: Tomcat_Home -> Variable: C: / Tomcat 5.0 New -> Variable Name: Path -> Variable:.;; : /j2sdk1.4.2/bin; (previous ".;" Be sure to have) Modify the increase Environment variable ClassPath (if there is no change name, new) -> Add variable value:.; c: /j2sdk1.4.2/lib /dt.jar; C: /J2SDK1.4.2/lib/mm.mysql-2.0.4-bin. JAR; C: / Tomcat 5.0 / Common / Classes; C: / Tomcat 5.0 / Common / Lib; C: / Tomcat 5.0 / Common / lib / servlet-api.jar; (previous "." "must have) 5 Start the Tomcat server, open the browser, browse: http: // localhost: 8080 /, appear in the Tomcat Welcome page; if this step is exception, please check the installation source file, reinstall. Third, integrated Apache Tomcat server 1. Copy the mod_jk_1.2.5_2.0.0.0.47.dll file to the C: / Apache2 / Modules directory. 2. Apache Configuration: C: /APAHCE2/CONF/HTTPD.CONF HTTPD.CONF At this configuration file last adds the following statement to support JSP program: loadModule JK_Module Modules / Mod_jk_1.2.5_2.0.47.dll jkworkersfile "C: / Tomcat 5.0 / conf / worker.properties "jkmount / servlet / * ajp13 jkmount /*.jsp Ajp13 3. View whether the port" 8009 "is commented in the C: / Tomcat 5.0 / conf / server.xml file, if it is with me If this version is consistent, you don't have to modify it. 4. In the C: / Tomcat 5.0 / conf / directory, the new file name "workers.properties" will be created as follows to the new files in Workers.properties.
Workers.properties # only copy the following: # This is currently modified by the installation directory to modify workers.tomcat_home = c: / tomcat 5.0 workers.java_home = c: /j2sdk1.4.1_01 ps = / # worker.list = ajp13 worker. list = ajp12, ajp13 worker.ajp12.port = 8007 worker.ajp12.host = localhost worker.ajp12.type = ajp12 worker.ajp12.lbfactor = 1 worker.ajp13.port = 8009 worker.ajp13.host = localhost worker.ajp13 .type = ajp13 worker.ajp13.lbfactor = 1 worker.loadbalancer.type = lb worker.loadbalancer.balanced_workers = ajp12, ajp13 worker.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.jar Worker.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.stderr = $ (workers.tomcat_home) $ (ps) inprocess.stderr worker.inprocess.sysprops = tomcat.home = $ (workers.tomcat_home) 5. In this apache and tomcat integrate, restart the Apache and Tomcat servers,
Write the following with the editor: <% @ page contenttype = "text / html; charSet = GB2312"%>
2. Test 2, prepare the following: <% @ Page ContentType = "text / html; charset = GBK"%> <% @ page language = "java" import = "java.sql. *"%> < % Connection conn = null; class.forname ("org.gjt.mm.mysql.driver). NewInstance (); conn = java.sql.driverManager.getConnection (" JDBC: mysql: // localhost / test "," Root "," "); if (conn == null) {system.out.println (" get conn error ");} Statement Stmt = conn.createstatement (); ResultSet RS_RESULT = NULL;%>
5. Apache configuration: c: /apahce2/conf/httpd.conf httpd.conf At this configuration file last adds the following statement: loadModule Caucho_Module C: /RESIN-3.0.3/Libexec/apache-2.0/mod_caucho.dll Author: luyongshou 2005-02-02 15:04:45 From: Mr. Linux Here, I will introduce the process of the integration of Apache and Tomcat4 in Redhat Linux 7.2, focusing on the MOD_WEBAPP.SO production method, and the configuration, management and application in the virtual host environment, has been successful. I hope to help everyone, please correct it if there is any error. First, properly install the installation of Tomcat4, as follows: 1, Java SDK version 1.3.1 or 1.4, it is recommended to install under / usr / java and make a JDK soft link. If there is a problem in the SDK of the installed version 1.3.1, please read the document: http://java.sun.com/j2se/1.3/install-linux-sdk.html 2, Tomcat4 recommends installing the latest Release version of the binary installation package . The current latest Tomcat version is 4.1.12. Download address: http://jakarta.apache.org/builds/ja...t-4.1.12.tar.gz Download Remove to a directory "TAR XVZF JAKARTA-TOMCAT-4.1.12.tar.gz" This example installs Tomcat in / opt directory and makes a soft link of Tomcat. Set the following environment variables and enable: path = $ PATH: / usr / java / jdk / bin: / usr / java / jdk / jre / bin java_home = / usr / java / jdk export java_home classpath = "./ USR / Java / JDK / LIB: / USR / JAVA / JDK / JRE / LIB "EXPORT CLASSPATH CATALINA_HOME = / OPT / Tomcat Export Catalina_Home recommends a single user Tomcat, set it into / opt / Tomcat, all directory files, And start Tomcat: # UserAdd Tomcat # chown -r Tomcat: Tomcat / Opt / Tomcat # su - Tomcat -c "/opt/tomcat/bin/startup.sh" Access http: // localhost: 8080 / Should be seen To the Tomcat installed successful page. ============================================================================================================================================================================================================= ================= If you want and apache integration, you need to modify the For example, the Tomcat I have installed is 4.1.12, and the location of the package now is: http://jakarta.apache.org/builds/ja...12-src.tar.gz APR-0.9. That Tar.gz Download Address: http://www.apache.org/dist/apr/apr-0.9.1.tar.gz AutoCONF-2.52-Ximian.1.i386.rpm Download Up: http: // rpmfind .NET / Linux / RPM / HELIX / ... IAN.1.I386.html first installs AutoCONF-2.52 with rpm because the following installation will be used; then unwrite Jakarta-Tomcat-Connectors-4.1.12-SRC. TAR.GZ generates a Jakarta-Tomcat-Connectors-4.1.12-src directory, enters Jakarta-Tomcat-Connectors-4.1.12-Tomcat-Connectors-4.1.12-Src / WebApp, and solve the APR-0.9.1.tar.gz to this In the directory, the directory name of the original directory APR-0.9.1 is changed to the APR. Still in the webapp directory, run the following command: # Support / BuildConf.sh At this time, if the version of AutoConf is below 2.52, you must install AutoConf-2.52 first. The configure file is generated in the current directory after the command is successfully completed. Run the following command sequentially: # ./configure --with-apxs = / usr / local / apache / bin / apxs # make # cp apache-2.0 / mod_webapp.so / usr / local / apache / modules Now mod_webapp.so has been made Ok, and have copied to the Modules directory of Apache. Edit the Apache profile, in the last plus the following line: ========================= ========= ======= oudModule WebApp_Module Modules / Mod_Webapp.so WebAppConnection Connector WARP Localhost: 8008 WebAppDeploy Examples Connector / Examples ========================== Run the following command: # / usr / local / apache / bin / apachectl configtest If you have an error saying that your apache's httpd.conf has a problem with the error is "inviadic virual host" indicates that your httpd.conf's servername is not set, you can remove the "#" in front of ServerName! (This is the answer to a lot of information, I am also confused here for many days) as long as "Syntax OK" appears, indicating that mod_webapp .so has been installed successfully. Start Apache # / usr / local / apache / bin / apachectl Start Access http: // localhost / example can see Tomcat's example programs. Note: Be sure to start Tomcat first, then restart Apache!.................................. | --- Host1 Virtual Host Host1 Main Directory | | - HTDOCS Normal Root Catalog: Directory for Show Static Page or PHP Programs | | ---- Logs Apache Access Log | | ---- WebApps Java Application Directory (New Plus, no association with Tomcat's WebApps directory: | "--Root JSP root directory: Used to display JSP page programs | | ---- JIVE set Java application instance | --- Host2 virtual host Host2 home directory. ........... The original Apache configuration file is configured: =============================== ========= Namevirtualhost xxx.xxx.xxx.xxx.xxx.xxx.xxx.xxx.xxx> servername host1.mydomain.com serveRadmin Webmaster@mydomain.com DocumentRoot / WWW / Host1 / HTDOCS ERRORLOG / WWW / Host1 / logs / error_log customlog / www / host1 / logs / access_log common virtualhost> ............. ================== =================== Now let the virtual host Host1 use Apache and Tomcat4 at the same time, need to do the following configuration: 1. Edit Tomcat's configuration file server.xml, in the end The part is modified as follows: ============================== ======= / Engine> service> ================================================================= 2, edit Tomcat management Permission file tomcat-users.xml, plus a line in the middle: