Home php教程 php手册 在Windows NT 4.0下安装Apache+Servlet+JSP

在Windows NT 4.0下安装Apache+Servlet+JSP

Jun 21, 2016 am 09:13 AM
apache http nbsp quot tomcat

apache|js|servlet|window

版本:1.0
作者:何志强(hhzqq@sina.com)
时间:2000.03.16

本文只讨论如何在Windows NT 4.0上安装Apache+Servlet+JSP。
本文中的配置情况如下:
  Windows NT 4.0
  jdk1_2_2-001-win.exe
  apache_1_3_12_win32.exe
  ApacheModuleJServ.dll
  tomcat.zip(3.0)
一、软件下载
  JDK
    http://java.sun.com/products/jdk/1.2/
  Apache Server
    http://www.apache.org/dist/binaries/win32/apache_1_3_12_win32.exe
  Apache JServ
    http://jakarta.apache.org/builds/tomcat/release/v3.0/win32/ApacheModuleJServ.dll
  Tomcat
    http://jakarta.apache.org/builds/tomcat/release/v3.0/tomcat.zip
二、软件安装
  (一)JDK
    1、双击jdk1_2_2-001-win.exe文件进行安装,使用缺省配置进行安装,JDK的缺省安装目录为
      C:\jdk1.2.2,JRE的缺省安装目录为C:\Program Files\JavaSoft\JRE\1.2;
    2、重启计算机;
    3、更新下列环境变量:把C:\jdk1.2.2\bin目录追加到PATH中;把
      .;C:\jdk1.2.2\lib\tools.jar;C:\jdk1.2.2\lib\dt.jar加入到CLASSPATH中。更新
      方法:控制面板->系统->环境->系统变量;
    4、测试applet:
         1)打开command窗口;
         2)切换到C:\jdk1.2.2\demo\applets\TicTacToe目录;
         3)运行appletviewer example1.htm;
         4)一切正常;
    5、测试application:
        1)在我的D:\HZQ\Java目录下创建一个test.java文件,内容如下:
            public class test
            {
               public static void main(String arc[]){
                  System.out.println("JDK安装成功了,朋友!");
               }
            };
         2)打开command窗口;
         3)切换到D:\HZQ\Java目录;
         4)运行javac test.java进行编译;
         5)运行java test运行这个程序;
         6)一切正常。
  (二)Apache Server
    1、双击apache_1_3_12_win32.exe文件进行安装,使用缺省配置进行安装,缺省安装目录为
      C:\Program Files\Apache Group\Apache,我用$APACHE_ROOT来代替安装目的地;
    2、修改$APACHE_ROOT\conf\httpd.conf:
         1)PORT
         设置Apache Web Server运行时使用的端口号,由于我这里的IIS也在运行,IIS使
         用了80端口号,于是我把它改成Port 8080,以后在浏览器上输入
         http://localhost:8080/才能访问到Apache Web Server服务器,输入
         http://localhost/时能访问到IIS,这样两个Web Server都可以用了哦,我用
               $APACHE_PORT标识;
        2)DocumentRoot
         设置文档根目录,当您在浏览器上输入http://localhost:$APACHE_PORT/时,服
         务器会从文档根目录读取数据,由于我的程序都放在D:\HZQ下,所以我把
         DocumentRoot设置为D:/HZQ;
    3、Apache安装完后在"开始->程序"菜单组中多了Apache Web Server菜单组,运行其中的
      Install Apache as a service,这样的话在"开始->设置->控制面板->服务"中就
      多了一个名为Apache的服务,您可以用它来启动或停止Apache服务;
    4、打开"开始->设置->控制面板->服务",选中Apache这个服务,按"开始"启动Apache
      服务;
    5、我在浏览器上输入http://localhost:$APACHE_PORT/,就看到了D:\HZQ下的所有文件,
      这时表明Apache服务已经安装成功。
  (三)Apache JServ
    1、把ApacheModuleJServ.dll文件拷贝到$APACHE_ROOT\modules目录下;
    2、修改$APACHE_ROOT\conf\httpd.conf:
        在该文件中加上LoadModule jserv_module modules/ApacheModuleJServ.dll以
        启动Apache JServ;
    3、重新启动Apache服务。
  (四)Tomcat
    1、用WinZIP等解压缩软件把tomcat.zip解压缩到一个目录下,我把它解压缩到C:\,它会自动
      创建tomcat子目录,这样在C盘就多了一个目录C:/tomcat,我用$TOMCAT标识;
    2、打开$APACHE_ROOT\conf\httpd.conf文件,在该文件最后加上类似这样一句话:
        Include $TOMCAT/etc/tomcat.conf
      在我这里为Include C:/tomcat/etc/tomcat.conf;
    3、修改Tomcat运行的端口号,注意Tomcat自己有一个独立的HTTP服务器,它必须使用一个还未
      被使用的端口号,我这里的8081还未被占用,我用$TOMCAT_PORT标识,分配给Tomcat:
        1)打开$TOMCAT/server.xml;
        2)修改ContextManager:
    4、双击$TOMCAT目录下的startup.bat来启动Tomcat;
    5、在浏览器上输入http://localhost:$TOMCAT_PORT/,能看到Tomcat Version 3.0这一页
      就表示Tomcat安装成功了;
    6、在浏览器上输入http://localhost:$APACHE_PORT/examples/servlets/,能看到
      Servlet Examples with Code这一页就表示Apache+Servlet也成功了;
    7、在浏览器上输入http://localhost:$APACHE_PORT/examples/jsp/,能看到JSP Samples
      这一页就表示Apache+JSP也成功了。

附:
  JDK Download
    http://java.sun.com/products/jdk/1.2/
  Apache Server Download
    http://www.apache.org/dist/binaries/win32/apache_1_3_12_win32.exe
  Apache JServ Download
    http://jakarta.apache.org/builds/tomcat/release/v3.0/win32/ApacheModuleJServ.dll
  Tomcat Download
    http://jakarta.apache.org/builds/tomcat/release/v3.0/tomcat.zip
  Java(TM) 2 SDK 1.2.2-001 Installation Instructions
    http://java.sun.com/products/jdk/1.2/install-windows.html
  Tomcat FAQ
    http://jakarta.apache.org/cvsweb/index.cgi/jakarta-tomcat/src/doc/faq
  Tomcat+Apache-HOWTO
    http://jakarta.apache.org/cvsweb/index.cgi/jakarta-tomcat/src/doc/Tomcat%2bApache-HOWTO  



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

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

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)

How to set the cgi directory in apache How to set the cgi directory in apache Apr 13, 2025 pm 01:18 PM

To set up a CGI directory in Apache, you need to perform the following steps: Create a CGI directory such as "cgi-bin", and grant Apache write permissions. Add the "ScriptAlias" directive block in the Apache configuration file to map the CGI directory to the "/cgi-bin" URL. Restart Apache.

How to start apache How to start apache Apr 13, 2025 pm 01:06 PM

The steps to start Apache are as follows: Install Apache (command: sudo apt-get install apache2 or download it from the official website) Start Apache (Linux: sudo systemctl start apache2; Windows: Right-click the "Apache2.4" service and select "Start") Check whether it has been started (Linux: sudo systemctl status apache2; Windows: Check the status of the "Apache2.4" service in the service manager) Enable boot automatically (optional, Linux: sudo systemctl

How to delete more than server names of apache How to delete more than server names of apache Apr 13, 2025 pm 01:09 PM

To delete an extra ServerName directive from Apache, you can take the following steps: Identify and delete the extra ServerName directive. Restart Apache to make the changes take effect. Check the configuration file to verify changes. Test the server to make sure the problem is resolved.

How to check Debian OpenSSL configuration How to check Debian OpenSSL configuration Apr 12, 2025 pm 11:57 PM

This article introduces several methods to check the OpenSSL configuration of the Debian system to help you quickly grasp the security status of the system. 1. Confirm the OpenSSL version First, verify whether OpenSSL has been installed and version information. Enter the following command in the terminal: If opensslversion is not installed, the system will prompt an error. 2. View the configuration file. The main configuration file of OpenSSL is usually located in /etc/ssl/openssl.cnf. You can use a text editor (such as nano) to view: sudonano/etc/ssl/openssl.cnf This file contains important configuration information such as key, certificate path, and encryption algorithm. 3. Utilize OPE

How to view your apache version How to view your apache version Apr 13, 2025 pm 01:15 PM

There are 3 ways to view the version on the Apache server: via the command line (apachectl -v or apache2ctl -v), check the server status page (http://<server IP or domain name>/server-status), or view the Apache configuration file (ServerVersion: Apache/<version number>).

How to connect to the database of apache How to connect to the database of apache Apr 13, 2025 pm 01:03 PM

Apache connects to a database requires the following steps: Install the database driver. Configure the web.xml file to create a connection pool. Create a JDBC data source and specify the connection settings. Use the JDBC API to access the database from Java code, including getting connections, creating statements, binding parameters, executing queries or updates, and processing results.

What to do if the apache80 port is occupied What to do if the apache80 port is occupied Apr 13, 2025 pm 01:24 PM

When the Apache 80 port is occupied, the solution is as follows: find out the process that occupies the port and close it. Check the firewall settings to make sure Apache is not blocked. If the above method does not work, please reconfigure Apache to use a different port. Restart the Apache service.

How Debian improves Hadoop data processing speed How Debian improves Hadoop data processing speed Apr 13, 2025 am 11:54 AM

This article discusses how to improve Hadoop data processing efficiency on Debian systems. Optimization strategies cover hardware upgrades, operating system parameter adjustments, Hadoop configuration modifications, and the use of efficient algorithms and tools. 1. Hardware resource strengthening ensures that all nodes have consistent hardware configurations, especially paying attention to CPU, memory and network equipment performance. Choosing high-performance hardware components is essential to improve overall processing speed. 2. Operating system tunes file descriptors and network connections: Modify the /etc/security/limits.conf file to increase the upper limit of file descriptors and network connections allowed to be opened at the same time by the system. JVM parameter adjustment: Adjust in hadoop-env.sh file

See all articles