Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to build Win2000 Server+Java 2 (JDK1.4.0) + Apache1.3.23 + tomcat-4.0.3 environment

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article is about how to build a Win2000 Server+Java 2 (JDK1.4.0) + Apache1.3.23 + tomcat-4.0.3 environment. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Win2000 Server + Java 2 (JDK1.4.0) + Apache1.3.23 + tomcat-4.0.3 (transfer) [@ more@]

/

/ / Establishment and implementation of JSP + Java servlets programming environment < 1 > / /

/

/ / win2000 Server + Java 2 (jdk1.4.0) + apache1.3.23 + tomcat-4.0.3 + webapp-module-1.0 / /

/

/

/

/ / author: josser chai (now changed to Abner Tsai) / /

/ / contact address: Mailto:abnertsai@sina.com "> abnertsai@sina.com or yahoo.com" > josserchai@yahoo.com / /

/ / 2002.3.7 / /

/ / statement: / /

/ / I provide this document for learning purposes only and can be used by any individual or organization. At the same time, if you find a ratio in the course of use

/ / for better and simpler methods, please ask E-mail to give me a copy. Thanks! At the same time, please ask anyone to repost the contents of this document, please /

/ / keep the declaration in this document. / /

/

/

/ / revision instructions: / /

/ / I revised and added part of this article on June 11, 2002.The main additions are: / /

/ / how to set up and run your own JSP and Servlet directories and programs, at the same time, many netizens wrote to me that during the installation process / /

There was a mistake in / / and it didn't come true. Because I was too busy with my work, I didn't reply to many netizens' letters. Please forgive me. In the future one / /

/ / try your best to do it. At the same time, the part of setting up classpath during installation has been modified to make it easier. / /

/

/

/

Description:

At present, there are various methods to configure JSP programming on the network, such as using Jserv+Apache+Tomcat, JSDK+IIS and so on. But as an individual learner,

For its use, I first recommend Apache+Tomcat. But at present, there are many configuration methods on the network, most of which are very troublesome, such as using mod_jk and so on. And

Those methods are not applicable to the latest release software here (I have tried, you can try, note that in the windows series, if and

When combined with Tomcat4.0, Apache1.3.23 is the most stable version, and there will be problems with either Apache1.3.6 or Apache2.0.

Java 2 (jdk1.4.0-b92) is a Java compiler issued by sun. Download address: j2se/1.4/ "> www.sun.com/j2se/1.4/

Tomcat-4.0 is the newly released Web server that supports JSP in the Apache organization. The download address is:

Http://jakarta.apache.org/builds/jakarta-tomcat/release/

Apache1.3.23-win32 is the most stable Web server released by the Apache organization that supports window 98/NT/2000. The download address is:

Http://www.apache.org/dist/httpd/

Webapp-module-1.0 is a better supporting interface for connecting Apache and Tomcat written by Apache organization. The download address is:

Http://www.apache.org/dist/httpd/

There is no need to explain win2000 (family) Server. / / hehe, if you don't know, don't look down.

Configuration method:

Install win2000. If you are already using it, do not do this step.

Second, A: download Java2 (jdk1.4.0), and the downloaded file is called j2sdk-1_4_0-win.exe.

Double-click to run and install to the c:j2sdk1.4.0 directory by default. Jre will be automatically installed to

Under C:Program FilesJavaj2re1.4.0, Jre is a necessary supporting environment for running Java programs.

B: after installation, you need to set the path:

The method is as follows: right-click "my computer"-- Properties-- Advanced-- Environment variables, in "system variables"

The new "JAVA_HOME" value is: C:j2sdk1.4.0

Note: choose one of the lines with / / in front and / / below, that is, you only need to do them once.

/ / New: the CLASSPATH value is:

/ / CRV j2sdk1.4.0libdt.jarterCWR j2sdk1.4.0libtools.jarTracing CWR j2sdk1.4.0libhtmlconverter.Jarten CRX Program FilesApache Tomcat 4.0commonlibservlet.jar

/ / pay attention to writing in succession, separated by ";"

/ / New: JAVA_OPTS, the value is empty (nothing is written)

/ / New: JAVA_ENDORSED_DIRS, the value is: C:Program FilesApache Tomcat 4.0 binism Cvu Program FilesApache Tomcat 4.0commonlib

/ / pay attention to writing in succession, separated by ";"

/ / New: _ RUNJAVA. Value: C:j2sdk1.4.0binjava

/ / New: _ RUNJAVAW. Value: C:j2sdk1.4.0binjavaw

/ / New: _ RUNJdb. Value: C:j2sdk1.4.0binjdb

/ / the variables created above are needed to compile jsp and Servlets

Then, double-click the path variable here, followed by:; C:j2sdk1.4.0bin so that the java file can be compiled elsewhere.

C: test JDK installation successfully:

Create a myjava directory under C:j2sdk1.4.0, and then change the

Copy clock.java and example1.html to the myjava directory, and then execute:

> javac clock.java

> appletviewer example1.html

You can see that a walking clock pops up, indicating that the test applet was successful.

Then test the java application

Write down the following program in notepad in a file named test.java, notice that the extension is .java.

Public class test

{

Public static void main (String args [])

{

System.out.print ("hello world, JDK setup perfect fulfillment")

}

}

Place this test.java file in the myjava directory and execute:

> javac test.java

> java test

You can see the line "hello world, JDK setup successful!" Text, which indicates that JDK is installed.

3. A: install Tomcat-4.0, and the name of the downloaded file is:

Jakarta-tomcat-4.0.3.exe, run it directly and install it to its default directory

Below C:Program FilesApache Tomcat 4.0.

B: configure the TOMCAT path:

1: right-click "my computer"-- Properties-- Advanced-- Environment variables, in "system variables"

The new "CATALINA_HOME" value is: C:Program FilesApache Tomcat 4.0,

/ / 2: find the C:Program FilesApache Tomcat 4.0binsetclasspath.bat file and put all the% BASEDIR% in it

/ / replace it with% CATALINA_HOME%

/ / and find one of the set CLASSPATH entries, and change to:

/ / set CLASSPATH=%JAVA_HOME%libtools.jar;%JAVA_HOME%libdt.jar;%JAVA_HOME%libhtmlconverter.jar;%CATALINA_HOME%commonlibservlet.jar

/ / the setclasspath.bat file is a batch file that sets the library files provided by tomcat, which can test the

/ / whether the classpath is correct. The modified content should be as follows:

If not "% JAVA_HOME%" = "" goto gotJavaHome

Echo The JAVA_HOME environment variable is not defined

Echo This environment variable is needed to run this program

Goto end

: gotJavaHome

If exist "JAVA_HOME%binjava.exe" goto okJavaHome

Echo The JAVA_HOME environment variable is not defined correctly

Echo This environment variable is needed to run this program

Goto end

: okJavaHome

If not "% CATALINA_HOME%" = "" goto gotBasedir

Echo The CATALINA_HOME environment variable is not defined

Echo This environment variable is needed to run this program

Goto end

: gotBasedir

If exist "CATALINA_HOME%binsetclasspath.bat" goto okBasedir

Echo The CATALINA_HOME environment variable is not defined correctly

Echo This environment variable is needed to run this program

Goto end

: okBasedir

Rem Set the default Java options for all scripts

Set JAVA_OPTS=

Rem Set the default-Djava.endorsed.dirs argument

Set JAVA_ENDORSED_DIRS=%CATALINA_HOME%bin;%CATALINA_HOME%commonlib

Rem Set standard CLASSPATH

Rem Note that there are no quotes as we do not want to introduce random

Rem quotes into the CLASSPATH

Set CLASSPATH=%JAVA_HOME%libtools.jar;%JAVA_HOME%libdt.jar;%JAVA_HOME%libhtmlconverter.jar;%CATALINA_HOME%commonlibservlet.jar

Rem Set standard command for invoking Java.

Rem Note that NT requires a window name argument when using start.

Rem Also note the quoting as JAVA_HOME may contain spaces.

Set _ RUNJAVA= 'JAVA_HOME%binjava'

Set _ RUNJAVAW= 'JAVA_HOME%binjavaw'

Set _ RUNJDB= 'JAVA_HOME%binjdb'

: end

/ / if you know a little bit about batch file instructions, you can easily read the above code.

/ / in the future, when compiling jsp, or servlet or java files, you must always run the above files before compiling correctly

Note: choose one of the lines with / / above and the line with / / above, that is, you only need to do them once.

C: configure the configuration file of Tomcat. In C:Program FilesApache Tomcat 4.0confserver.XML, you can not configure it here. If you want to configure it, configure it again below.

D: test Tomcat installation successfully: open IE and type: http://localhost:8080 in the address bar to see the Tomcat page.

Or enter http://xxx.xxx.xx.xxx:8080 where xxx.xxx.xx.xxx is the IP address of your win2000.

E: how to configure Tomcat so that it can run its own JSP file and Java Servlet is explained in more detail below:

1: configure Tomcat's server.xml file to support its own JSP file.

Use notepad to open the server.xml file under conf and find the following:

.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report