How to configure Jsp+php environment under Windows IIS

黄舟
Release: 2017-05-27 09:43:43
Original
1849 people have browsed it

We generally use Tomcat with Apache or IIS, allowing Apache to serve the static page requests of the website, while Tomcat, as a dedicated JSP engine, provides JSP parsing to Get better performance.

1. IIS is used to process ASP programs, but what if I want it to be able to process JSP and PHP? The easiest thing to think of is JSPinstallTOMCAT. The default port of TOMCAT is 8080. The default success page after installation is: 127.0.0.1:8080/index.jsp; just use Apache for php. Just configure it. There is AppServ that integrates Mysql and MysqlAdmin. Apache and IIS both use port 80 by default, so they conflict. Only one of them can be started, which means that it supports php but not asp. For jsp, some people integrate it with IIS, and some people integrate it with Apache. Why should it be integrated? As a web server, Tomcat is not as fast as Apache when processing static HTML pages, and it is not as robust as Apache. Therefore, we generally use Tomcat with Apache or IIS to let Apache serve static page requests of the website, while Tomcat serves as a dedicated JSP. Engine, providing JSP parsing for better performance.
Because the application of asp is relatively widespread in China, it is also very easy to learn and there are many users. IIS is directly integrated into the OS by Microsoft, so it is more convenient to obtain and very easy to operate. So below I explain in detail how to configure the jsp and php environment using IIS under Windows (successfully passed under Windows 2000 Advanced Server).
2. Software preparation (if you have not installed IIS, you must install IIS first, IIS is in the component, use Just install it on the OS [operating system] disk)
1. J2SDK: Java2 software development tool, which is the basis of Java applications. JSP is based on Java technology, so J2SDK must be installed before configuring the JSP environment.
2. Tomcat server: A JSP engine developed by the Apache organization. It has the function of a Web server and can be used as an independent Web server.
3, 5, tc4ntiis.zip: A plug-in developed by the Jakarta project team of the Apache organization to enable IIS to support Tomcat.
4. php-4.3.9-installer.exe PHP language parser.
3. Detailed steps
1. Install J2SDK
Under Windows, run the downloaded file directly j2sdk1.4.2_04-windows-i586.exe file, install it to a directory according to the installation wizard, for example, install it to C:\j2sdk1.4.2_04
2, add environment variable
 (1) If your operating system is Win 98/Me, you can use Notepad to edit Autoexec.bat directly and add the following command line:

PATH=%PATH%;c:\j2sdk1.4.2_04\bin 
SET
 JAVA_HOME=c:\j2sdk1.4.2_04 
SET 
CLASS
PATH=.;c:\j2sdk1.4.2_04\lib\tools.jar;c:\j2sdk1.4.2_04\lib\dt.jar
Copy after login

After saving, restart the computer so that the added environment variables can be will be effective.

  (2) If your operating system is Win2000 or xp, then configure the environment variables as follows. Right-click "My Computer" and select "Properties" → "System Properties" → "Advanced" → "Environment Variables" in the pop-up menu. The environment variables dialog box will pop up, and you can edit the system environment. variable. Add three variables: PATH, JAVA_HOME and CLASSPATH. The variable values ​​are the same as above.

3. Install Tomcat

Directly run the downloaded jakarta-tomcat-4.1.30.exe and follow the general Windows program installation steps to install Tomcat. Install It will automatically find the location of J2SDK. For example, install to c:\tomcat4.1. Configure Tomcat's environment variables and add a new environment variable TOMCAT_HOME. The variable value is c:\tomcat4.1. The adding method is the same as the configuration of J2SDK environment variables. Test whether TOMCAT is installed successfully: http://localhost:8080/index.jsp or http://127.0.0.1:8080/index.jsp.
4. Integrate Tomcat and IIS
(1) Download the tc4ntiis.zip is directly decompressed to the c:\tomcat4.1 directory. Cover the four folders bin, conf, logs and server under C:\Tomcat4.1.
(2). Use text editor to open c:\tomcat4.1\conf\ntiis\workers.properties and modify the following values ​​to:

workers.tomcat_home=c:\tomcat4.1 
workers.java_home=c:\j2sdk1.4.2_04
Copy after login

(3)双击f:\tomcat4\conf\ntiis\iis_redirect.reg ,将此注册文件内的信息添加到注册表中,但是要修改log_file、worker_file 、worker_mount_file这三个键的键值,以适合你的环境(比如本文中的Tomcat就安装的是c:\tomcat4.1,而不是默认的c:\tomcat4
(4)打开Internet服务管理器,在默认站点上添加一个新的虚拟目录,名称为jakarta,这个虚拟目录指向f:\tomcat4\bin\native ,并启动该 默认站点。
(5)6、在Internet服务管理器中用鼠标右键单击服务器名,选择"属性"→主属性中"WWW服务"的"编辑" →"ISAPI筛选器"选项卡,添加一个ISAPI筛选器,名字为Jakarta Redirect,可执行文件指定为f:\Tomcat4\bin\native\isapi_redirector.dll。在添加ISAPI过滤器后, Jakarta Redirect的状态是一个红色的向下的箭头,重新启动IIS服务,就会变成绿色的箭头。
(6)配置Tomcat
  用文本编辑器打开f:\Tomcat4\conf\server.xml。因为Tomcat4默认不启用Ajp13,所以查找到如下这段代码:

<!-- 
<Connector className="org.apache.ajp.tomcat4.Ajp13Connector" 
port="8009" minProcessors="5" maxProcessors="75" accept
Count
="10" debug="0"/> 
-->
Copy after login

  把注释符号<!-- --> 删掉就可以启用Ajp13了。

  然后保存,现在Tomcat和IIS的整合配置基本完成了。
(7) 把c:\Tomcat4.1\webapps下的examples文件夹Copy到C:\Inetpub\wwwroot下,然后在IE输入:127.0.0.1/examples/jsp/index.html 点第一个"Execute",如果出现了一个让你猜字的游戏就整合成功,出现下载则失败,重新回看哪里不对。
(8)整合php和IIS
先安装php-4.3.9-installer.exe,如默认安装到c:\php下。在控制面板打开“管理工具”,点击“Internet信息服务,会看到“默认web站点”目录,右击这个目录,点击“属性” .点击“主目录”标签页,点击下面的“配置”按纽出现“应用程序配置”框,再点击“添加“ ,点击”浏览”.找到PHP安装目录下的c:\php.exe文件,然后在扩展名中填入".php"(不要引号注意php前面有一个"."),点击确定,然后一路确定关闭配置窗口,php的环境就整合成功了。如果你中xp的OS,打开c:\盘下的windows找到php.ini ,用记事本打开 ,查找 cgi.force_redirect,找到后将其前面的分号”;“去掉,将其修改为 cgi.force_redirect = 0 ,保存即可.
(9)添加文档文件名 index.jsp和index.php 找到默认web站点,点击"主目录"标签页,点"文档"加上"index.jsp"和"index.php"不要引号,如访问www.abc.com/index.jsp只要输入www.abc.com即可。

The above is the detailed content of How to configure Jsp+php environment under Windows IIS. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template