Home php教程 php手册 jsp+phpWindows2000下整合Apache2与Tomcat4

jsp+phpWindows2000下整合Apache2与Tomcat4

Jun 13, 2016 am 10:27 AM
Down and I Integrate test

============================================= 本文我已经测试通过了! ============================================= 题目:Windows2000 下整合Apache2与Tomcat4 作者:robornet 日期:2002-10-30 原由:搞了一段时间的java项目,到分发的时候了,可找不到一份最新的Apache2与Tomcat4的整合配置,遂看了半天的jakarta在线资料,并参照以前网友的文章, 写了这篇配置文档,以作参考,欢迎斧正! 目录: 一、软件准备 二、软件安装 三、首次配置及测试 四、整合配置 五、全线测试 六、不足 七、感谢 八、说明 步骤: 一、软件准备: 假设你有一台能正常运行win2000的硬软软件环境。 1.j2sdk1.4.1: 到http://java.sun.com/j2se/1.4.1/download.html下载!(注意是Windows (all languages, including English)的sdk版) 2.Apache2.0.43: 到http://www.apache.inetcosmos.org/dist/httpd/binaries/win32/apache_2.0.43-win32-x86-no_ssl.msi 下载! 3.Tomcat4.1.12:到 http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.1.12/bin/jakarta-tomcat-4.1.12.exe 下载! 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下载! (说明,由于mod_jk2-2.0.43.dll与Apache2.0.43配置没成功,现用mod_jk-2.0.42.dll代替) 二、软件安装: (1)安装j2sdk: 1.按照安装向导进行安装(一般安装到C:j2sdk1.4.1下,方便下面操作) (2)安装apache: 1.按照安装向导进行安装(选择安装目录为C:,方便下面操作;安装成功后其路径为:C:Apache2) (3)安装Tomcat: 1.按照安装向导进行安装(更改安装目录为C:Tomcat4,若只是测试,没必要把tomcat安装成Services,方便下面操作), 其间会要你输入Admin(系统管理员)的口令。 三、首次配置及测试: 对以上安装的软件环境进行首次配置,并测试其环境。 (1)配置--环境变量: 1.新建系统变量JAVA_HOME,其值为:C:j2sdk1.4.1 //若你没按以上路径安装请更改为正确的路径 2.新建系统变量TOMCAT_HOME,其值为:C:Tomcat4 //同上 3.新建系统变量CLASSPATH,其值为:%JAVA_HOME%lib;%TOMCAT_HOME%lib (2)修改错误: 1.Apache2.0.43有一个小问题,默认安装成功后在Apache2主目录下的htdocs目录中没有index.html文件,你须将该目录下的index.html.en改名为index.html (3)测试默认服务: 请先运行Apache2与Tomcat4. 1.打开浏览器,在地址栏中输入:http://localhost 检验:此时能在浏览器中看到Apache2的欢迎界面.说明Apache2工作正常.(注意,Tomcat默认端口为80, 若有其它程序占用,请更改,下面有说明) 2.打开浏览器,在地址栏中输入:http://localhost:8080 检验:此时能在浏览器中看到Tomcat的欢迎界面.说明Tomcat工作正常.(注意,Tomcat默认端口为 8080,若有其它程序占用,请更改,下面有说明) 小结:若到此步骤没有任何错误,那可继续下面的操作,Let go! (4)测试你的项目: 现只用Tomcat测试你的项目,为方便此例说明,假设你已有一个项目在E:ApplicationOA目录下 (包含index.jsp及其它jsp文件和bean,如WEB-INFclasses下的servlet、javabean)。 1.设置Tomcat以支持你的项目,打开C:Tomcat4confserver.xml文件,在""之前,""之后添加 并保存。 说明:Context (表示一个web应用程序): docBase定义应用程序的路径;path 表示此web应用程序的url的前缀,这样请求的url为http://localhost:8080/oa; reloadable 这个属性非常重要,如果为true,则tomcat会自动检测应用程序的/WEB-INF/lib 和/WEB-INF/classes目录的变化,自动装载修改或新的bean 及servlet,我们可以在不重起tomcat的情况下看到bean带给jsp的变化。 2.启动你Tomcat4.1.12,在浏览器的地址中输入http://localhost:8080/oa,如你的jsp及bean,servlet没有错误,一般会将你的index.jsp/index.html文件的 内容给执行并显示。 小结:若到此步骤没有任何错误,那可继续下面的操作,Let go! 四、整合配置: 对Apache与Tomcat做相应的配置,让其共同为你工作。 若Apache2与Tomcat4正运行着,请关闭它们。 (1)配置Apache2: 1.先将下载的mod_jk-2.0.42.dll复制到C:Apache2modules下。 2.设置主页文件类型:打开C:Apache2conf下的httpd.conf,查找"DirectoryIndex",在index.html的后面添加index.jsp并保存,注意相互之间应有空格。 3.设置虚拟主机,让Apache自动控制html与jsp的解析: 打开C:Apache2confhttpd.conf,在最后加入下面这段代码并保存。 //localhost为本机,你可用本机ip ServerAdmin robornet@robornet.com //你的mail地址 DocumentRoot E:Application //你的项目组根目录,因为Application下有OA及其它多个项目,因此只能设为E:Application ServerName localhost //你的服务名,若你的机器有域名,设为域名,但现用本机作测试 ErrorLog logs/robornet_home_log.txt //错误日志,在C:Apache2logs下,可用其它任意名字 CustomLog logs/robornet_Custom_log.txt common //访问日志,在C:Apache2logs下,可用其它任意名字 4.设置Apache与Tomcat之间的连接,让Apache遇到jsp文件时,在后台将其交由Tomcat去处理:打开C:Apache2confhttpd.conf,在最后加入下面这段代码并保存。 # Using mod_jk2.dll to redirect dynamic calls to Tomcat LoadModule jk_module modules/mod_jk-2.0.42.dll //装载模块,用于处理连接 JkWorkersFile "C:/Tomcat4/conf/workers.properties" //设置模块的工作文件,下面会说明 JkLogFile "C:/Tomcat4/logs/mod_jk2.log" //设置模块工作的日志文件,Tocmat启动时会自建 JkMount /servlet/* ajp13 //让Apache支持对servlet传送,用以Tomcat解析 JkMount /*.jsp ajp13 //让Apache支持对jsp传送,用以Tomcat解析 小结:到此Apache的配置基本完成,不过这时启动Apache还不能正常工作。 (2)配置Tomcat4: 1.在C:Tomcat4conf下新建一个文件workers.properties 注意文件后缀,建议用EditPlus或UltraEdit建立,若用记事本,记得改名, 不要成了workers.properties.txt了!其内容如下: workers.tomcat_home=c:Tomcat4 //让mod_jk模块知道Tomcat workers.java_home=c:j2sdk1.4.1 //让mod_jk模块知道j2sdk ps= worker.list=ajp13 //模块版本,现有ajp14了,不要修改 worker.ajp13.port=8009 //工作端口,若没占用则不用修改 worker.ajp13.host=localhost //本机,若上面的Apache主机不为localhost,作相应修改 worker.ajp13.type=ajp13 //类型 worker.ajp13.lbfactor=1 //代理数,不用修改 2.打开C:Tomcat4conf下的server.xml文件:查找到"",将以前的代码: 更改为: 并保存后关闭. 小结: 兄弟一定都累了吧!好了,可以来一杯java,好好享受你的成果吧! 五、全线测试: 1.启动Apache2,Tomcat4 。 2.打开你的浏览器,在地址栏中输入http://localhost:8080/oa ,若与上面的测试相同,则Tomcat重新配置后正常! 3.在地址栏中输入http://localhost/oa ,若与http://localhost:8080/oa的结果相同,那恭喜你,Apache2与Tomcat4整合成功了!!! 六、不足: 1.虽用最新的Apache2.0.43与Tomcat4.1.12,但我是用的jk连接的,刚用jk2配置未成功,所以只好写这份文档了! 2.Tomcat还是采用的Tomcat-Standalone,未采用Tomcat-Apache,不过这个大家可以自己完成,这个应不是个问题! 七、感谢: 1.感谢Apache组织,为我提供了如此之好的服务器,而且还是免费的! 2.感谢以前写过Apache1.x与Tomcat3.x/Tomcat4.*配置文档的朋友们,为我今天写这篇文档作了参考! 八、说明: 1.若您觉得满意,想转载或收藏这篇文章,我非常感谢,但请您注明作者robornet及出处http://www.xtong.com.cn/rob

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What do you think of furmark? - How is furmark considered qualified? What do you think of furmark? - How is furmark considered qualified? Mar 19, 2024 am 09:25 AM

What do you think of furmark? 1. Set the "Run Mode" and "Display Mode" in the main interface, and also adjust the "Test Mode" and click the "Start" button. 2. After waiting for a while, you will see the test results, including various parameters of the graphics card. How is furmark qualified? 1. Use a furmark baking machine and check the results for about half an hour. It basically hovers around 85 degrees, with a peak value of 87 degrees and room temperature of 19 degrees. Large chassis, 5 chassis fan ports, two on the front, two on the top, and one on the rear, but only one fan is installed. All accessories are not overclocked. 2. Under normal circumstances, the normal temperature of the graphics card should be between "30-85℃". 3. Even in summer when the ambient temperature is too high, the normal temperature is "50-85℃

Join a new Xianxia adventure! 'Zhu Xian 2' 'Wuwei Test' pre-download is now available Join a new Xianxia adventure! 'Zhu Xian 2' 'Wuwei Test' pre-download is now available Apr 22, 2024 pm 12:50 PM

The "Inaction Test" of the new fantasy fairy MMORPG "Zhu Xian 2" will be launched on April 23. What kind of new fairy adventure story will happen in Zhu Xian Continent thousands of years after the original work? The Six Realm Immortal World, a full-time immortal academy, a free immortal life, and all kinds of fun in the immortal world are waiting for the immortal friends to explore in person! The "Wuwei Test" pre-download is now open. Fairy friends can go to the official website to download. You cannot log in to the game server before the server is launched. The activation code can be used after the pre-download and installation is completed. "Zhu Xian 2" "Inaction Test" opening hours: April 23 10:00 - May 6 23:59 The new fairy adventure chapter of the orthodox sequel to Zhu Xian "Zhu Xian 2" is based on the "Zhu Xian" novel as a blueprint. Based on the world view of the original work, the game background is set

Database testing skills in Golang Database testing skills in Golang Aug 10, 2023 pm 02:51 PM

Database testing skills in Golang Introduction: Database testing is a very important link when developing applications. Appropriate testing methods can help us discover potential problems and ensure the correctness of database operations. This article will introduce some common database testing techniques in Golang and provide corresponding code examples. 1. Testing using an in-memory database When writing database-related tests, we usually face a question: How to test without relying on an external database? Here we can use memory

What are the differences between function testing and coverage in different languages? What are the differences between function testing and coverage in different languages? Apr 27, 2024 am 11:30 AM

Functional testing verifies function functionality through black-box and white-box testing, while code coverage measures the portion of code covered by test cases. Different languages ​​(such as Python and Java) have different testing frameworks, coverage tools and features. Practical cases show how to use Python's Unittest and Coverage and Java's JUnit and JaCoCo for function testing and coverage evaluation.

How to use MTR to conduct reliability testing of MySQL database? How to use MTR to conduct reliability testing of MySQL database? Jul 13, 2023 pm 12:05 PM

How to use MTR to conduct reliability testing of MySQL database? Overview: MTR (MySQL Test Runner) is a testing tool officially provided by MySQL, which can help developers conduct functional and performance testing of MySQL databases. During the development process, in order to ensure the reliability and stability of the database, we often need to conduct various tests, and MTR provides a simple, convenient and reliable method to conduct these tests. Steps: Install MySQL test runner: First, you need to download it from the MySQL official website

The new king of domestic FPS! 'Operation Delta' Battlefield Exceeds Expectations The new king of domestic FPS! 'Operation Delta' Battlefield Exceeds Expectations Mar 07, 2024 am 09:37 AM

"Operation Delta" will launch a large-scale PC test called "Codename: ZERO" today (March 7). Last weekend, this game held an offline flash mob experience event in Shanghai, and 17173 was also fortunate to be invited to participate. This test is only more than four months away from the last time, which makes us curious, what new highlights and surprises will "Operation Delta" bring in such a short period of time? More than four months ago, I experienced "Operation Delta" in an offline tasting session and the first beta version. At that time, the game only opened the "Dangerous Action" mode. However, Operation Delta was already impressive for its time. In the context of major manufacturers flocking to the mobile game market, such an FPS that is comparable to international standards

How to use Selenium for automated web testing How to use Selenium for automated web testing Aug 02, 2023 pm 07:43 PM

Overview of How to Use Selenium for Web Automation Testing: Web automation testing is a vital part of the modern software development process. Selenium is a powerful automated testing tool that can simulate user operations in a web browser and implement automated testing processes. This article will introduce how to use Selenium for web automation testing, and come with code examples to help readers get started quickly. Environment preparation Before starting, you need to install the Selenium library and web browser driver

I am going to travel to Tibet with a backpack. ① How many liters of bag is suitable for me to carry? Please tell me what you think is the best configuration. I am 170 and have good physical strength for the first time. I am going to travel to Tibet with a backpack. ① How many liters of bag is suitable for me to carry? Please tell me what you think is the best configuration. I am 170 and have good physical strength for the first time. Jan 07, 2024 am 10:06 AM

I am planning to go backpacking in Tibet. ① How many liters of bag should I carry? Please tell me what you think is the best configuration. I am 170 and have good physical strength. The first time I went hiking, the amount was 60 liters or more. The amount of hiking was less than 60 liters. The entire journey was by car. You don’t need a backpack, a suitcase is more convenient. If you really need to carry something with you, a 25-40 liter bag is more than enough. Necessary supplies for Tibet travel: sunglasses, sun hat, sunscreen, skin cream, lip balm, long-sleeved top, Sweater; for special travel or travel to Ali, northern Tibet, and Sichuan-Tibet line, it is recommended to bring: sleeping bag (cold protection), sheets (dirty protection), down jacket, travel shoes or hiking shoes, slippers, toothbrush, toothpaste, towel, rolling paper , paper underwear, disinfectant wipes, flashlight, waterproof matches, knives, rope. Can a computer be carried in the front bag? Can a computer be carried in the front bag? Some backpacks have it.

See all articles