Introduction to the Novice Windows JSP installation full diagram

Source: Internet
Author: User
Tags interface return variable win32 window zip access root directory
Js|window The following configuration operations are performed under the Win2000 system, and of course it also applies to WinXP. Configuring the JSP's operating environment does not require high performance hardware support, the key is to install some of the necessary software or plug-ins, and then the file configuration process for these software or plug-ins.
  
Step One: Search the web to get the files needed to build a JSP environment
  
1, Apache_2.0.46-win32-x86-no_src.msi
Download Address: Http://archive.apache.org/dist/httpd/binaries/win32/apache_2.0.46-win32-x86-no_src.msi
  
or download Apache V2.0.54 for Windows
Download Address: Http://softdown.it168.com/1003/IT168.com-16584apache_2.0.54-win32-x86-no_ssl.msi
  
2, J2sdk-1_4_1_02_windows_i586.exe
Download Address: http://java.sun.com/j2se/downloads.html
  
3, Resin_2.1.9.zip
Download Address: Http://www.caucho.com/download/resin-2.1.9.zip
Step two: First double-click run J2sdk-1_4_1_02-windows-i586.exe file, install JSDK.
    
We assume that the installation directory is D:\JSDK, others use the default, installation complete the following figure:
    
Step three: Configure JSDK.
  
After installing JSDK, configure the following:
  
As shown in the following figure, first find classpath in the system variable and add the following (if you can't find the classpath, create a new one):
D:\jsdk\LIB\dt. Jar;d:\jsdk\lib\tools. Jar;d:\jsdk\bin;.;
Then locate the path in the system variable and add the following:
D:\jsdk\;D: \jsdk\bin;
    
"Prompt" Classpath the last ".;" Represents the current directory, rather than a single point and semicolon. If the actual JSDK installation path is inconsistent with this article, please change to your installation path, and then restart the computer to make the configuration effective.
  
Fourth step: Debug JSDK configuration environment.
  
After the third step configuration, you should be able to run the Java program correctly. We can create a new text file in the root directory of the disk partition where JSDK is located, and enter the following code validation:
  
public class hello{
public static void Main (String arg[]) {
System.out.print ("hi! Java! ");
}
}
  
Note Be sure to name this Java file Hello.java, and be case-sensitive! Next, enter the D-packing directory in MS-DOS mode and type the following command:
  
Javac Hello.java Carriage return
  
If normal, there is no content to display, but will be translated into a hello.class file under the same directory, and then enter the following command:
  
Java Hello Carriage
  
If it's normal, it should show "hi! java! ", this means that your Java environment is OK before you can proceed to the next step.
Step Fifth: Run Apache_2.0.46-win32-x86-no_src.msi to install Apache.
  
As shown in the following illustration:
    
After you leave the default option to press 3 "next," The following interface appears, set as shown:
    
Sixth step: Complete Apache installation.
  
After you have pressed 2 "next" in the diagram in the previous step, you will receive an interface to select the installation directory. Here to change the directory to D: (select D on the above, do not need to enter a directory name, the installer will automatically generate a "Apache2" directory), the other press "next" or finish on the line. So Apache is also installed, Apache will automatically start a monitor program after installation in the taskbar in the lower right corner, but at this time the Apache service did not start, because we have not installed Apache into service. As shown in the following illustration:
    
Seventh step: Configure Apache.
  
1, into the directory of Apache, find open apache2\conf\httpd.conf file, find the following:
  
# If Your host doesn ' t have a registered DNS name, enter its IP addresses here.
# You'll have to access it ' anyway, and this'll make
# redirections work in a sensible way.
#
ServerName 127.0.0.1:8080
  
"Prompt" If you need to change the server's IP, then modify the red code above can (modify 127.0.0.1 for your server IP address and confirm the Web port
  
2, continue to find the following content:
  
# Documentroot:the directory out of which your'll serve your
# documents. By default, all requests are taken from this directory, but
# Symbolic links and aliases may is used to the other locations.
#
DocumentRoot "D:/apache2/htdocs"
  
"Prompt" If you want to change the directory where the JSP file is to be run, change the red code above to read: DocumentRoot "letter:/path", note that to use "/" instead of "\".
  
3, the last find the following content:
  
#Listen 12.34.56.78:80
Listen 8080
  
"Prompt" If you want to modify the Apache listening port, just do it here.
  
OK, it's done here. As a simple thing to say, configuring Apache is configuring httpd.conf files. If you want more detailed and in-depth configuration, please check the relevant articles, no longer listed here.
  
Step eighth: Test the Apache service.
  
1, into the MS-DOS mode, and then enter the D:\apache2\bin\ directory, enter the following command to install Apache into service:
Apache-k Install carriage return.
  
2, double-click the taskbar in the lower right-hand corner of the Apache Monitor, you can see a "Apache2" in the window (as shown in the following image), and then press the Start button on the right to start Apache2.
    
3, open IE, in the address bar input: http://127.0.0.1:8080/(if you have modified this IP address when configuring httpd.conf, please enter your modified address), if the page shown in the following figure, said all ok! So far, Apache has been successfully installed, and now we just need to put the HTML file in the apache2/htdocs/directory to access. For example, there is a file called hello.htm in the directory, then the input format in the Address bar is: http://127.0.0.1:8080/hello.htm
  
Nineth Step: Install resin
  
Apache is just a Web server, no parser support is not able to run JSP, so we also need to install a parser, here we choose resin. Double-click the download to the compressed file Resin-2.1.9.zip, and then extract it to any directory (D:\Resin-2.1.9) for the appropriate configuration can be, because Resin is not required to install the Green program.
  
1, use any Web page to write software (recommended to use Dreamweaver) to open the Extract directory of resin-2.1.9\conf\resin.conf files, find the following content:
<doc-dir>doc</doc-dir>
Then modify it to: <doc-dir>D:/apache2/htdocs/</doc-dir>
  
"Prompt" This directory is the directory where resin runs JSP files, which means that JSP files must be placed in this directory to function properly.
  
2, and then find the following content:
Then modify it to:   
"Hint" because port 8080 is already configured in front of the Apache service, and if no modification is made here, Apache and resin will cause a port conflict and run an exception.
  
3, the final step is to enter the directory just installed Apache service, open the apache2\conf\httpd.conf file, add the following code at the end:
# Resin's Combined configuration section:
LoadModule caucho_module "D:/resin-2.1.9/libexec/apache-2.0/mod_caucho.dll"
#上面的路径改成你自己的路径
<ifmodule mod_caucho.c>
Cauchohost localhost 6802
AddHandler Caucho-request JSP
<Location/servlet/*>
SetHandler Caucho-request
</Location>
</IfModule>
  
4, okay, ready? We're going to start testing the JSP running environment we just built! Start resin (Double-click to run Resin-2.1.9\bin\httpd.exe file to start resin), and of course the Apache service will also start together. Then create a new text file called a JSP in the Apache2\htdocs\ directory, such as first.jsp, and then enter a simple page code to do a test page:
<%@ page language= "java" contenttype= "text/html;charset=gb2312"%>
<%
Out.print ("I love jsp!");
%>
  
Quickly open IE, input: http://127.0.0.1:8080/first.jsp try it! If you see "I love jsp!" A few words impressively in the eye, then congratulate you, accomplished!

Related Article

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.