在Windows NT 4.0下安裝Apache+Servlet+JSP
Jun 21, 2016 am 09:13 AMapache|js|servlet|window
版本:1.0
作者:何志強(qiáng)(hhzqq@sina.com)
時(shí)間: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文件進(jìn)行安裝,使用缺省配置進(jìn)行安裝,JDK的缺省安裝目錄為
C:\jdk1.2.2,JRE的缺省安裝目錄為C:\Program Files\JavaSoft\JRE\1.2;
2、重啟計(jì)算機(jī);
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、測(cè)試applet:
??? 1)打開(kāi)command窗口;
??? 2)切換到C:\jdk1.2.2\demo\applets\TicTacToe目錄;
??? 3)運(yùn)行appletviewer example1.htm;
??? 4)一切正常;
5、測(cè)試application:
1)在我的D:\HZQ\Java目錄下創(chuàng)建一個(gè)test.java文件,內(nèi)容如下:
??? public class test
??? {
??? ???public static void main(String arc[]){
??? ??????System.out.println("JDK安裝成功了,朋友!");
??? ???}
??? };
??? 2)打開(kāi)command窗口;
??? 3)切換到D:\HZQ\Java目錄;
??? 4)運(yùn)行javac test.java進(jìn)行編譯;
??? 5)運(yùn)行java test運(yùn)行這個(gè)程序;
??? 6)一切正常。
(二)Apache Server
1、雙擊apache_1_3_12_win32.exe文件進(jìn)行安裝,使用缺省配置進(jìn)行安裝,缺省安裝目錄為
C:\Program Files\Apache Group\Apache,我用$APACHE_ROOT來(lái)代替安裝目的地;
2、修改$APACHE_ROOT\conf\httpd.conf:
??? 1)PORT
設(shè)置Apache Web Server運(yùn)行時(shí)使用的端口號(hào),由于我這里的IIS也在運(yùn)行,IIS使
用了80端口號(hào),于是我把它改成Port 8080,以后在瀏覽器上輸入
http://localhost:8080/才能訪問(wèn)到Apache Web Server服務(wù)器,輸入
http://localhost/時(shí)能訪問(wèn)到IIS,這樣兩個(gè)Web Server都可以用了哦,我用
???????????????$APACHE_PORT標(biāo)識(shí);
2)DocumentRoot
設(shè)置文檔根目錄,當(dāng)您在瀏覽器上輸入http://localhost:$APACHE_PORT/時(shí),服
務(wù)器會(huì)從文檔根目錄讀取數(shù)據(jù),由于我的程序都放在D:\HZQ下,所以我把
DocumentRoot設(shè)置為D:/HZQ;
3、Apache安裝完后在"開(kāi)始->程序"菜單組中多了Apache Web Server菜單組,運(yùn)行其中的
Install Apache as a service,這樣的話在"開(kāi)始->設(shè)置->控制面板->服務(wù)"中就
多了一個(gè)名為Apache的服務(wù),您可以用它來(lái)啟動(dòng)或停止Apache服務(wù);
4、打開(kāi)"開(kāi)始->設(shè)置->控制面板->服務(wù)",選中Apache這個(gè)服務(wù),按"開(kāi)始"啟動(dòng)Apache
服務(wù);
5、我在瀏覽器上輸入http://localhost:$APACHE_PORT/,就看到了D:\HZQ下的所有文件,
這時(shí)表明Apache服務(wù)已經(jīng)安裝成功。
(三)Apache JServ
1、把ApacheModuleJServ.dll文件拷貝到$APACHE_ROOT\modules目錄下;
2、修改$APACHE_ROOT\conf\httpd.conf:
在該文件中加上LoadModule jserv_module modules/ApacheModuleJServ.dll以
啟動(dòng)Apache JServ;
3、重新啟動(dòng)Apache服務(wù)。
(四)Tomcat
1、用WinZIP等解壓縮軟件把tomcat.zip解壓縮到一個(gè)目錄下,我把它解壓縮到C:\,它會(huì)自動(dòng)
創(chuàng)建tomcat子目錄,這樣在C盤就多了一個(gè)目錄C:/tomcat,我用$TOMCAT標(biāo)識(shí);
2、打開(kāi)$APACHE_ROOT\conf\httpd.conf文件,在該文件最后加上類似這樣一句話:
Include $TOMCAT/etc/tomcat.conf
在我這里為Include C:/tomcat/etc/tomcat.conf;
3、修改Tomcat運(yùn)行的端口號(hào),注意Tomcat自己有一個(gè)獨(dú)立的HTTP服務(wù)器,它必須使用一個(gè)還未
被使用的端口號(hào),我這里的8081還未被占用,我用$TOMCAT_PORT標(biāo)識(shí),分配給Tomcat:
1)打開(kāi)$TOMCAT/server.xml;
2)修改ContextManager:
4、雙擊$TOMCAT目錄下的startup.bat來(lái)啟動(dòng)Tomcat;
5、在瀏覽器上輸入http://localhost:$TOMCAT_PORT/,能看到Tomcat Version 3.0這一頁(yè)
就表示Tomcat安裝成功了;
6、在瀏覽器上輸入http://localhost:$APACHE_PORT/examples/servlets/,能看到
Servlet Examples with Code這一頁(yè)就表示Apache+Servlet也成功了;
7、在瀏覽器上輸入http://localhost:$APACHE_PORT/examples/jsp/,能看到JSP Samples
這一頁(yè)就表示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)

[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

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.

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.

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

The command to start the Apache service on macOS is sudoapachectlstart, and the configuration file is located in /etc/apache2/. The main steps include: 1. Edit the httpd.conf file, modify the Listen port such as Listen8080; 2. Adjust the DocumentRoot path to the personal directory such as /Users/your_username/Sites, and update the corresponding permission settings; 3. Use the sudoapachectlgraceful command to restart Apache to ensure that the configuration takes effect; 4. Enable the mod_deflate module to compress data to improve page loading speed.

The reasons for file deletion failure during Apache uninstall include file permission issues, locking files, and running processes. Solutions include: 1. Stop the Apache service: sudosystemctlstoppapache2; 2. Manually delete the Apache directory: sudorm-rf/etc/apache2/usr/sbin/apache2; 3. Use lsof to find and terminate the process of locking the file: sudolsof|grepapache2, and then sudokill-9; 4. Try to delete the file again.

Configuring Apache to connect to MySQL database requires the following steps: 1. Make sure that Apache and MySQL are installed; 2. Configuring Apache to support PHP, by adding LoadModule and AddHandler instructions in httpd.conf or apache2.conf; 3. Configuring PHP to connect to MySQL, enable mysqli extension in php.ini; 4. Create and test the connected PHP file. Through these steps, the connection between Apache and MySQL can be successfully implemented.

Java middleware is a software that connects operating systems and application software, providing general services to help developers focus on business logic. Typical applications include: 1. Web server (such as Tomcat and Jetty), which handles HTTP requests; 2. Message queue (such as Kafka and RabbitMQ), which handles asynchronous communication; 3. Transaction management (such as SpringTransaction), which ensures data consistency; 4. ORM framework (such as Hibernate and MyBatis), which simplifies database operations.
