


How to configure Jsp+php environment under Windows IIS
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
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
(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"/> -->
把注释符号<!-- --> 删掉就可以启用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!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

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)

Hot Topics











VS Code can run on Windows 8, but the experience may not be great. First make sure the system has been updated to the latest patch, then download the VS Code installation package that matches the system architecture and install it as prompted. After installation, be aware that some extensions may be incompatible with Windows 8 and need to look for alternative extensions or use newer Windows systems in a virtual machine. Install the necessary extensions to check whether they work properly. Although VS Code is feasible on Windows 8, it is recommended to upgrade to a newer Windows system for a better development experience and security.

There are six ways to run code in Sublime: through hotkeys, menus, build systems, command lines, set default build systems, and custom build commands, and run individual files/projects by right-clicking on projects/files. The build system availability depends on the installation of Sublime Text.

To install Laravel, follow these steps in sequence: Install Composer (for macOS/Linux and Windows) Install Laravel Installer Create a new project Start Service Access Application (URL: http://127.0.0.1:8000) Set up the database connection (if required)

In Laravel development, dealing with complex model relationships has always been a challenge, especially when it comes to multi-level BelongsToThrough relationships. Recently, I encountered this problem in a project dealing with a multi-level model relationship, where traditional HasManyThrough relationships fail to meet the needs, resulting in data queries becoming complex and inefficient. After some exploration, I found the library staudenmeir/belongs-to-through, which easily installed and solved my troubles through Composer.

Installing Git software includes the following steps: Download the installation package and run the installation package to verify the installation configuration Git installation Git Bash (Windows only)

The reasons for the installation of VS Code extensions may be: network instability, insufficient permissions, system compatibility issues, VS Code version is too old, antivirus software or firewall interference. By checking network connections, permissions, log files, updating VS Code, disabling security software, and restarting VS Code or computers, you can gradually troubleshoot and resolve issues.

VS Code is available on Mac. It has powerful extensions, Git integration, terminal and debugger, and also offers a wealth of setup options. However, for particularly large projects or highly professional development, VS Code may have performance or functional limitations.

IIS and PHP are compatible and are implemented through FastCGI. 1.IIS forwards the .php file request to the FastCGI module through the configuration file. 2. The FastCGI module starts the PHP process to process requests to improve performance and stability. 3. In actual applications, you need to pay attention to configuration details, error debugging and performance optimization.
