Configure JSP and PHP environments with IIS under Windows

xiaoxiao2021-03-06  66

First, IIS is used for the processing of the ASP program, but you want it to handle JSP and PHP? The easiest thing to think is that the JSP installation Tomcat is good. Tomcat default port is 8080, the default installed success page: http://127.0.0.1: 8080 / index.jsp; PHP uses apache, configure it It is okay. There is AppServ integrates mysql and mysqladmin. Apache and IIS are all defaults with 80 ports, which they have conflicts, only one of them, that is, support PHP does not support ASP. Some people integrate it and IIS for JSP, and some people and apache integrate, why do you integrate? In terms of Web server, Tomcat is not as fast as Apache, and there is no Apache, so we generally use Tomcat with Apache or IIS to provide services to the website's static page request, while Tomcat as a dedicated JSP Engine, providing JSP parsing to get better performance. Since the application of ASP is relatively wide, it is also very easy to learn, and users are more. IIS It is integrated with mcrosoft in OS, so it is also convenient to obtain, and it is also very easy to operate. So below, in detail, use IIS to configure JSP and PHP environments under Windows (successfully passed under Windows 2000 Advanced Server). Second, Software Preparation (No IIS is installed first, IIS in the component, with OS [operation System] On disk installation can be installed) 1, J2SDK: Java2 software development tool is the basis of the Java application. JSP is based on Java technology, so you must install J2SDK before configuring the JSP environment. Its official website: http://java.sun.com Download SDK, currently the latest version: J2SDK1.4.2_04 Download address: Http://java.sun.com/j2se/1.4.1/download.html (49.3 M) 2, Tomcat server: Apache organization developed a JSP engine that itself has a web server function, which can be used as a stand-alone web server. Official website: http://www.apache.org Download: http://jakarta.apache.org version 4.1.30 (8.33m) 3,5, TC4NTIS.ZIP: APACHE organization Jakarta project group developed to make IIS support Tomcat Plugin. Download: http://www.apache.org This is not very easy to find here, it is recommended to download at http://www.cnjbb.org. Address: [URL] http://www.cnjbb.org/attachment/-1/-1/-1/1256/TC4NTIS.ZIP [/ URL] 4, PHP-4.3.9-Installer.exe PHP Language Resolution Official Website: http://www.php.net Download: http://www.php.net 3, detailed step 1, install J2SDK

Under Windows, run the downloaded J2SDK1.4.2_04-windows-i586.exe file directly, install it to 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 edit autoexec.bat directly with Notepad, add the following command line:

Path =% path%; C: /J2SDK1.4.2_04/binset java_home = c: /j2sdk1.4.2_04set classpath = .; c: /j2sdk1.4.2_04/lib/tools.jar; c: /j2sdk1.4.2_04/ After lib / dt.jar saves, restart your computer so that the environment variable added is valid.

(2) If your operating system is Win2000 or XP, then configure environment variables as follows. Right-click My Computer, select "Properties" → "System Features" → "Advanced" → Environment Variables in the pop-up menu, and the Environment Variable dialog box can edit the environment variable. Add three variables in Path, Java_Home and ClassPath, and the variable value.

3, install Tomcat

Directly run the downloaded jakarta-tomcat-4.1.30.exe, follow the general Windows program installation steps to install Tomcat, which will automatically look for the J2SDK. For example, install it to c: /tomcat4.1. Configure the environment variable of Tomcat, add a new environment variable tomcat_home, the variable value is c: /tomcat4.1, add the method as the J2SDK environment variable. Test Tomcat is successful: http: // localhost: 8080 / index.jsp or http://127.0.0.1:8080/index.jsp. 4, integrated Tomcat and IIS (1) Download TC4NTIS.ZIP directly to directly decompress the download Under the C: /Tomcat4.1 directory. Overwrites BIN, CONF, LOGS, and Server four folders under C: / Tomcat4.1. (2), open C: / Tomcat4.1/conf/ntiis/Workers.properties with text editor, modify the following value:

Workers.tomcat_home = c: /tomcat4.1 workers.java_home = c: /j2sdk1.4.2_04 (3) Double-click F: /Tomcat4/conf/ntiis/iis_redirect.reg, add information within this registration file to the registry But to modify the key value of the three keys of log_file, worker_file, worker_mount_file to suit your environment (such as the Tomcat in this article is c: /tomcat4.1, not the default C: / Tomcat4 (4) Open the Internet Service Manager, add a new virtual directory on the default site, named Jakarta, this virtual directory points to F: / tomcat4 / bin / native, and launch the default site. (5) 6, in the Internet Service Manager Right-click the server name, select the "WWW Service" → "ISAPI Filter" → "ISAPI Filter" → "ISAPI Filter" → "WWW Service" in the primary property, add an ISAPI filter, the name is Jakarta Redirect, the executable is specified as f: /tomcat4/bin/native/isapi_redirector.dll. After adding the ISAPI filter, the status of Jakarta Redirect is a red down arrow, restarting the IIS service, will become a green arrow. (6) Configuration Tomcat

Use the text editor to open f: /tomcat4/conf/server.xml. Because Tomcat4 does not enable AJP13 by default, find out the following code:

-> Note The AJP13 can be enabled if the symbol is deleted.

Then save, now Tomcat and IIS integration configuration are basically completed. (7) Under the EXAMPLES folder copy to C: / Tomcat4.1/webapps under the C: / INETPUB / WWWROOT, then enter: http://127.0.0.1/examples/jsp/index.html point first "Execute", if there is a game that makes you guess, it is successful, and there is a failure, and it will be right again. (8) Integrating PHP and IIS first installing PHP-4.3.9-Installer.exe, if the default is installed under C: / PHP. Open Administrative Tools, click on "Internet Information Service, you will see the" Default Web Site "directory, right-click this directory, click" Properties ". Click the" Main Directory "tab, click" Configure "below The "Application Configuration" box appears, then click "Add", click "Browse". Find the c: / php.exe file in the PHP installation directory, then fill in ".php" in the extension (do not quotation attention PHP There is a "."), Click OK, then determine the configuration window all the way, the PHP environment is integrated. If you are Xp OS, open the Windows under the C: / Disc to find php.ini, open with Notepad Find cgi.force_redirect, find the previous semicolon ";" removed, change it to cgi.force_redirect = 0, save it. (9) Add a document file name index.jsp and index.php find the default Web Site, click on "Main Directory" tab, click "Document" plus "index.jsp" and "index.php" do not quotation, such as access http://www.abc.com/index.jsp As long as you enter http: / / www.abc.com.

// Related Website http://www.javaworld.com (English) http://www.java-cn.com (Java Chinese Station) http://www.cnjsp.com (You can find some about Java and JSP) Information) http://www.phpv.net (a PHP community, there are many PHP information) http://www.ofstar.net (a very good text database of PHP forum's official website) if there is I will contact me again. E-mail: chinahom@china.com.cn Chinahom@163.com QQ: 3932818

转载请注明原文地址:https://www.9cbs.com/read-86361.html

New Post(0)