1. IIS is used for ASP Program But what about JSP and PHP? The easiest way to think of it is to install Tomcat in JSP. The default port of Tomcat is 8080. The successful page after the default installation is http: // 127.0.0.1: 8080/index. JSP; PHP can be used with Apache and configured. Appserv is integrated with MySQL and mysqladmin. Apache and IIS both use port 80 by default, and there is a conflict between them. Only one of them can be started, that is, ASP is not supported when PHP is supported. Some people integrate JSP with IIS and Apache. Why? As a Web server, Tomcat does not process static html pages as quickly as Apache and does not have Apache robustness. Therefore, we generally use Tomcat with Apache or IIS, apache provides services for website static page requests, while tomcat, as a dedicated JSP Engine, provides JSP parsing for better performance.
Because ASP is widely used in China, it is very easy to learn and has many users. IIS is directly integrated into the OS by mcrosoft, so it is easy to obtain and operate. So next I will explain in detail how to use IIS in Windows to configure the JSP and PHP environments (successfully passed in Windows 2000 Advanced Server ).
2. Software preparation (If IIS is not installed, install IIS first. In IIS components, install IIS on the OS [Operating System] disk)
1. j2sdk: the software development tool of Java2 is the basis of Java applications. JSP is based on Java technology, so you must install j2sdk before configuring the JSP environment. Its official network: http://java.sun.com download SDK, the latest version: j2sdk1.4.2 _ 04: Address: http://java.sun.com/j2se/1.4.1/download.html (49.3 m)
Derek Note: My download address is: http://java.sun.com/javaee/downloads/index.jsp
2. Tomcat server: a JSP engine developed by Apache. It has the Web server function and can be used as an independent web server. Http://www.apache.org version 4.1.30 (8.33 m)
Derek Note: I download address: http://tomcat.apache.org/
3. 5. tc4ntiis.zip: this plug-in is developed by the Jakarta project team of Apache to support tomcat. Download: http://www.apache.org download here is not very easy to find, it is recommended to download to the http://www.cnjbb.org. Address: http://www.cnjbb.org/attachment/-1/-1/-1/1256/tc4ntiis.zip
4、php-4.3.9-installer.exe PHP language parser. Net: http://www.php.net download: http://www.php.net
3. Detailed steps
1. Install j2sdk
Run the j2sdk1.4.2_04-windows-i586.exe file in windows and install it in a directory according to the installation wizard, for example, to c: \ j2sdk1.4.2 _ 04.
2. Add Environment Variables
(1) If your operating system is WIN 98/Me, you can use NotePad to directly edit autoexec. BAT and add the following command line:
Path = % PATH %; C: \ j2sdk1.4.2 _ 04 \ bin
Set java_home = c: \ j2sdk1.4.2 _ 04
Set classpath =.; C: \ j2sdk1.4.2 _ 04 \ Lib \ tools. jar; C: \ j2sdk1.4.2 _ 04 \ Lib \ DT. Jar
After saving, restart the computer so that the added environment variables will be valid.
(2) If your operating system is Win2000 or XP, configure the environment variables as follows. Right-click my computer and choose Properties> system features> advanced> environment variables from the shortcut menu. The environment variables dialog box is displayed, you can edit the environment variables of the system. Add three variables: path, java_home, and classpath. The variable value is the same as the preceding one.
3. install Tomcat
Run the downloaded jakarta-tomcat-4.1.30.exe directly and install Tomcat according to the general installation steps of Windows programs. During installation, Tomcat is automatically located in j2sdk. For example, install it in c: \ tomcat4.1. Configure the Tomcat environment variable and add a new environment variable tomcat_home. The variable value is c: \ tomcat4.1. Add the same method as j2sdk environment variable configuration. Test whether Tomcat is successfully installed: http: // localhost: 8080/index. jsp or http: // 127.0.0.1: 8080/index. jsp.
4. Integrate Tomcat and IIS
(1) decompress the downloaded tc4ntiis.zip file to the C: \ tomcat4.1 directory. It overwrites the bin, Conf, logs, and server folders in c: \ tomcat4.1.
(2) Open c: \ tomcat4.1 \ conf \ ntiis \ workers. properties in a text editor and modify the following values:
Workers. tomcat_home = c: \ tomcat4.1
Workers. java_home = c: \ j2sdk1.4.2 _ 04
(3) double-click F: \ tomcat4 \ conf \ ntiis \ iis_redirect.reg to add the information in this registration file to the Registry, however, you need to modify the key values of the three keys LOG_FILE, worker_file, and worker_mount_file to suit your environment (for example, tomcat in this article is installed with c: \ tomcat4.1 instead of the default C: \ tomcat4
(4) Open the Internet Service Manager and add a new virtual directory named Jakarta to the default site. The virtual directory points to F: \ tomcat4 \ bin \ native, and start the default site.
(5) 6. In Internet Service Manager, right-click the server name and select the "edit"> "ISAPI filter" tab of "WWW Service" in "properties" → Main Properties, add an ISAPI filter named Jakarta redirect. the executable file is F: \ tomcat4 \ bin \ native \ isapi_redirector.dll. After the ISAPI filter is added, the Jakarta redirect status is a red downward arrow. After the IIS service is restarted, it turns into a green arrow.
(6) Configure Tomcat
Open F: \ tomcat4 \ conf \ Server. XML in a text editor. Because tomcat4 does not enable ajp13 by default, the following section is found:Code:
<! --
<Connector classname = "org. Apache. AJP. tomcat4.ajp13connector"
Port = "8009" minprocessors = "5" maxprocessors = "75" acceptcount = "10" DEBUG = "0"/>
-->
Annotate the symbol <! --> Delete to enable ajp13.
Save the configuration. Now the configuration of Tomcat and IIS is complete.
(7) copy the examples folder under c: \ tomcat4.1 \ webapps to c: \ Inetpub \ wwwroot, and enter: http: // 127.0.0.1/examples/JSP/index.html: Click the first "execute". If a game appears for you to guess, the game is integrated successfully, and the download fails, check again.
(8) Integrate PHP and IIS
install php-4.3.9-installer.exe first. For example, install php-4.3.9-installer.exe in c: \ PHP by default. Open "Administrative Tools" in the control panel and click "Internet Information Service". The "Default web site" directory is displayed. Right-click this directory and click "properties ". click the "main directory" tab, click the "configuration" button below to display the "Application configuration" box, and then click "add", click "Browse ". find the c: \ php.exe file in the PHP installation directory, and enter ". PHP "(do not quote note that there is one before PHP ". "), click" OK ", and close the Configuration window all the way. The PHP environment is integrated successfully. If your xp OS is running, open windows on the c: \ drive and find PHP. INI, open it in notepad and find CGI. force_redirect: Find the semicolon (;) in front of it and modify it to CGI. force_redirect = 0. Save it.
(9) Add the document file name index. JSP and index. find the default web site in PHP, click the "main directory" tab, click "document", and add "index. JSP and index. PHP "do not use quotation marks. For example, to access http://www.abc.com/index.jsp, you only need to enter http://www.abc.com.
// related websites
http://www.javaworld.com
http://www.java-cn.com (Java Chinese site)
http://www.cnjsp.com (you can find some information about Java and JSP)
http://www.phpv.net (a php community , there are a lot of PHP Information)
http://www.ofstar.net (a very good text database of PHP Forum official network)