Windows IIS configuration jsp and PHP environment method _win Server

Source: Internet
Author: User
Tags install php php language tomcat server
One, IIS for ASP program processing, but want it can handle JSP and PHP? The most easy to think of is the JSP installed Tomcat, tomcat default port is 8080, the default installed after the success of the page: http://127.0.0.1:8080/index.jsp;php with Apache, the configuration will be OK. There is a appserv that integrates MySQL and mysqladmin. Apache and IIS are the default 80 ports, they have conflicts, can only start one, that is, support PHP does not support ASP. For JSP someone put it and IIS integration, also someone and Apache integration, why to integrate it? When Tomcat handles static HTML pages as a Web server, not as fast as Apache or as robust as Apache, we typically use Tomcat in conjunction with Apache or IIS to make Apache service static page requests to the site, Tomcat, as a dedicated JSP engine, provides JSP parsing for better performance.
As the application of ASP in the domestic is more extensive, but also very easy to learn, the user is also more. IIS is integrated directly into the OS by Mcrosoft, so it's easy to get and easy to operate. So let me explain in detail how to configure the JSP and PHP environment with IIS under Windows (successfully passed under Windows Advanced Server).
Second, the software preparation (not install IIS to install Iis,iis in the components, with os[operating system] disk installed on it)
1, J2SDK:JAVA2 software development tools, is the basis of Java applications. JSP is based on Java technology, so you must install J2SDK before you configure the JSP environment. Its official network: http://java.sun.com Download SDK, currently the latest version: J2sdk1.4.2_04 Download Address: Address: http://java.sun.com/j2se/1.4.1/download.html (49.3M)

Derek Note: I download the address is: http://java.sun.com/javaee/downloads/index.jsp


2, Tomcat server: Apache development of a JSP engine, itself has the function of a Web server, can be used as a stand-alone Web server. Official network: http://www.apache.org Download: http://jakarta.apache.org version 4.1.30 (8.33M)

Derek Note: I downloaded the address: http://tomcat.apache.org/


3, 5, Tc4ntiis.zip:Apache organization Jakarta Project team developed to enable IIS to support Tomcat Plug-ins. Download: http://www.apache.org Here download is not very easy to find, suggest to http://www.cnjbb.org up to download. Address: Http://www.cnjbb.org/attachment/-1/-1/-1/1256/tc4ntiis.zip
4, Php-4.3.9-installer.exe PHP language parser. Official network: Http://www.php.net Download: http://www.php.net
Third, detailed steps
1. Installation J2SDK

Under Windows, run the downloaded J2sdk1.4.2_04-windows-i586.exe file directly, and install to a directory based on the installation wizard, such as installing to the 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\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 environment variables you add are valid.

(2) If your operating system is Win2000 or XP, configure the environment variables as follows. Right click on "My Computer", in the pop-up menu select "Properties" → "system features" → "Advanced" → "Environment variables", Pop-up Environment Variables dialog box, you can edit the system environment variables. Add path, Java_home, and classpath three variables with the same value as above.


3. Install Tomcat

Run the download directly jakarta-tomcat-4.1.30.exe, follow the usual Windows program installation steps to install the Tomcat, installed it will automatically find the location of the J2SDK. For example, install to c:\tomcat4.1. Configure Tomcat environment variable, add a new environment variable tomcat_home, variable value c:\tomcat4.1, add method with J2SDK environment variable configuration. Test whether Tomcat was installed successfully: http://localhost:8080/index.jsp or http://127.0.0.1:8080/index.jsp.
4. Consolidate Tomcat and IIS
(1) Extract the downloaded tc4ntiis.zip directly into the c:\tomcat4.1 directory. Overwrite bin, conf, logs, and server four folders under C:\Tomcat4.1.
(2), open c:\tomcat4.1\conf\ntiis\workers.properties with 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, but modify Log_file, Worker_file, Worker_mount_ The key value of the three keys in the file to suit your environment (for example, Tomcat in this article installs c:\tomcat4.1 instead of the default C:\TOMCAT4
(4) Open Internet Services Manager, add a new virtual directory to the default site, the name Jakarta, the virtual directory to point to F:\tomcat4\bin\native, and start the default site.
(5) 6, right-click the server name in Internet Services Manager, select Properties → the edit → ISAPI filter tab of the WWW service in the main property, add an ISAPI filter named Jakarta Redirect, The executable file is specified as F:\Tomcat4\bin\native\isapi_redirector.dll. After adding an ISAPI filter, the state of the Jakarta redirect is a red downward arrow that restarts the IIS service and becomes a green arrow.
(6) Configure Tomcat

Open F:\Tomcat4\conf\server.xml with a text editor. Because TOMCAT4 does not enable AJP13 by default, the following code is found:

!--
<connector classname= "Org.apache.ajp.tomcat4.Ajp13Connector"
Port= "8009" minprocessors= "5" maxprocessors= "a" acceptcount= "ten" debug= "0"/>
-->

If you delete the annotation symbol!----, you can enable AJP13.

Then save, and now the consolidated configuration of Tomcat and IIS is basically complete.
(7)Copy the examples folder under C:\Tomcat4.1\webapps to C:\Inetpub\wwwroot, then enter in IE: http://127.0.0.1/examples/jsp/index.html Click on the first "Execute", if there is a word to let you guess the game on the integration of success, the download will fail, back to see what is wrong.
(8) Consolidate PHP and IIS
Install Php-4.3.9-installer.exe first, such as the default installation to c:\php. Open Administrative Tools in the Control Panel. Click Internet Information Services to see the default Web Site directory, right-click the directory, and click Properties. Click on the "Home Directory" tab, click the "Configure" button below to appear in the "Application Configuration" box, click "Add", click "Browse". Locate the C:\php.exe file in the PHP installation directory, and then fill in ". php" in the extension (do not quote "."), click OK, and then go all the way to close the configuration window, the PHP environment is integrated successfully. If you are in XP OS, open C:\ Disk under Windows Find php.ini, open with Notepad, look for Cgi.force_redirect, find the semicolon before it ";" Remove, modify it to Cgi.force_redirect = 0, save it.
(9) Add document file name index.jsp and index.php find the Default Web site, click on the Home Directory tab, point "document" Plus "index.jsp" and "index.php" do not quote, such as access to http://www.abc.com/ Index.jsp as long as the input http://www.abc.com can be.

Related Websites
Http://www.javaworld.com (English)
Http://www.java-cn.com (Java Chinese station)
Http://www.cnjsp.com (can find some information about Java and JSP)
Http://www.phpv.net (a PHP community with a lot of PHP information)
Http://www.ofstar.net (the official web of PHP forum for a very nice text database)
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.