在Windows NT 4.0下安裝Apache+Servlet+JSP
Jun 21, 2016 am 09:13 AMapache|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、更新下列環(huán)境變量:把C:\jdk1.2.2\bin目錄追加到PATH中;把
.;C:\jdk1.2.2\lib\tools.jar;C:\jdk1.2.2\lib\dt.jar加入到CLASSPATH中。更新
方法:控制面板->系統(tǒng)->環(huán)境->系統(tǒng)變量;
4、測試applet:
??? 1)打開command窗口;
??? 2)切換到C:\jdk1.2.2\demo\applets\TicTacToe目錄;
??? 3)運行appletviewer example1.htm;
??? 4)一切正常;
5、測試application:
1)在我的D:\HZQ\Java目錄下創(chuàng)建一個test.java文件,內(nèi)容如下:
??? 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)一切正常。
?。ǘ〢pache Server
1、雙擊apache_1_3_12_win32.exe文件進行安裝,使用缺省配置進行安裝,缺省安裝目錄為
C:\Program Files\Apache Group\Apache,我用$APACHE_ROOT來代替安裝目的地;
2、修改$APACHE_ROOT\conf\httpd.conf:
??? 1)PORT
設(shè)置Apache Web Server運行時使用的端口號,由于我這里的IIS也在運行,IIS使
用了80端口號,于是我把它改成Port 8080,以后在瀏覽器上輸入
http://localhost:8080/才能訪問到Apache Web Server服務(wù)器,輸入
http://localhost/時能訪問到IIS,這樣兩個Web Server都可以用了哦,我用
???????????????$APACHE_PORT標識;
2)DocumentRoot
設(shè)置文檔根目錄,當您在瀏覽器上輸入http://localhost:$APACHE_PORT/時,服
務(wù)器會從文檔根目錄讀取數(shù)據(jù),由于我的程序都放在D:\HZQ下,所以我把
DocumentRoot設(shè)置為D:/HZQ;
3、Apache安裝完后在"開始->程序"菜單組中多了Apache Web Server菜單組,運行其中的
Install Apache as a service,這樣的話在"開始->設(shè)置->控制面板->服務(wù)"中就
多了一個名為Apache的服務(wù),您可以用它來啟動或停止Apache服務(wù);
4、打開"開始->設(shè)置->控制面板->服務(wù)",選中Apache這個服務(wù),按"開始"啟動Apache
服務(wù);
5、我在瀏覽器上輸入http://localhost:$APACHE_PORT/,就看到了D:\HZQ下的所有文件,
這時表明Apache服務(wù)已經(jīng)安裝成功。
(三)Apache JServ
1、把ApacheModuleJServ.dll文件拷貝到$APACHE_ROOT\modules目錄下;
2、修改$APACHE_ROOT\conf\httpd.conf:
在該文件中加上LoadModule jserv_module modules/ApacheModuleJServ.dll以
啟動Apache JServ;
3、重新啟動Apache服務(wù)。
(四)Tomcat
1、用WinZIP等解壓縮軟件把tomcat.zip解壓縮到一個目錄下,我把它解壓縮到C:\,它會自動
創(chuàng)建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服務(wù)器,它必須使用一個還未
被使用的端口號,我這里的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

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

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

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Software preparation I am using a virtual machine with CentOS-6.6, with the host name repo. Refer to the steps to install a Linux virtual machine in Windows, I installed JDK in that virtual machine, refer to the guide to installing JDK in Linux. In addition, the virtual machine is configured with a key-free login itself, and the settings for configuring key-free login between each virtual machine are referenced. The download address of Hadoop installation package is: https://mirrors.aliyun.com/apache/hadoop/common/. I am using hadoop 2.6.5 version. Upload the Hadoop installation package to the server and unzip [root@repo~]#tarzxv

NGINX is more suitable for handling high concurrent connections, while Apache is more suitable for scenarios where complex configurations and module extensions are required. 1.NGINX is known for its high performance and low resource consumption, and is suitable for high concurrency. 2.Apache is known for its stability and rich module extensions, which are suitable for complex configuration needs.

NGINX and Apache each have their own advantages and disadvantages, and the choice should be based on specific needs. 1.NGINX is suitable for high concurrency scenarios because of its asynchronous non-blocking architecture. 2. Apache is suitable for low-concurrency scenarios that require complex configurations, because of its modular design.

The steps to deploy a Joomla website on PhpStudy include: 1) Configure PhpStudy, ensure that Apache and MySQL services run and check PHP version compatibility; 2) Download and decompress PhpStudy's website from the official Joomla website, and then complete the installation through the browser according to the installation wizard; 3) Make basic configurations, such as setting the website name and adding content.

PHP code can be executed in many ways: 1. Use the command line to directly enter the "php file name" to execute the script; 2. Put the file into the document root directory and access it through the browser through the web server; 3. Run it in the IDE and use the built-in debugging tool; 4. Use the online PHP sandbox or code execution platform for testing.

[Common Directory Description] Directory/bin stores binary executable files (ls, cat, mkdir, etc.), and common commands are generally here. /etc stores system management and configuration files/home stores all user files. The root directory of the user's home directory is the basis of the user's home directory. For example, the home directory of the user user is /home/user. You can use ~user to represent /usr to store system applications. The more important directory /usr/local Local system administrator software installation directory (install system-level applications). This is the largest directory, and almost all the applications and files to be used are in this directory. /usr/x11r6?Directory for storing x?window/usr/bin?Many

Updating the Tomcat version in the Debian system generally includes the following process: Before performing the update operation, be sure to do a complete backup of the existing Tomcat environment. This covers the /opt/tomcat folder and its related configuration documents, such as server.xml, context.xml, and web.xml. The backup task can be completed through the following command: sudocp-r/opt/tomcat/opt/tomcat_backup Get the new version Tomcat Go to ApacheTomcat's official website to download the latest version. According to your Debian system

Reasons for system performance not recovered after uninstalling the Apache service may include resource occupancy by other services, error messages in log files, resource consumption by abnormal processes, network connection problems, and file system residues. First, check whether there are other services or processes before uninstalling with Apache; second, pay attention to the operating system's log files and find error messages that may occur during the uninstallation process; second, check the system's memory usage and CPU load, and find out abnormal processes; then, use the netstat or ss command to view the network connection status to ensure that no ports are occupied by other services; finally, clean up the remaining configuration files and log files after uninstallation to avoid occupying disk space.
