vista中配置iis7+php+mysql+zend+gd+asp+.net+access+jsp

2007/6/18 1:39:04    发布:walf_man

windows server 2008/vista(32/64)中配置iis7.0+php+mysql+zend+gd+asp+asp.net+access+jsp 
---gmkey(http://bbs.87169.cn) 
首先让我们开启iis7.0,在命令符中输入下列命令: 
start /w pkgmgr /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;IIS-HttpRedirect;IIS-ApplicationDevelopment;IIS-ASPNET;IIS-NetFxExtensibility;IIS-ASP;IIS-CGI;IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-ServerSideIncludes;IIS-HealthAndDiagnostics;IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-HttpTracing;IIS-CustomLogging;IIS-ODBCLogging;IIS-Security;IIS-BasicAuthentication;IIS-WindowsAuthentication;IIS-DigestAuthentication;IIS-ClientCertificateMappingAuthentication;IIS-IISCertificateMappingAuthentication;IIS-URLAuthorization;IIS-RequestFiltering;IIS-IPSecurity;IIS-Performance;IIS-HttpCompressionStatic;IIS-HttpCompressionDynamic;IIS-WebServerManagementTools;IIS-ManagementConsole;IIS-ManagementscriptingTools;IIS-ManagementService;IIS-IIS6ManagementCompatibility;IIS-Metabase;IIS-WMICompatibility;IIS-Legacyscripts;IIS-LegacySnapIn;IIS-FTPPublishingService;IIS-FTPServer;IIS-FTPManagement;WAS-WindowsActivationService;WAS-ProcessModel;WAS-NetFxEnvironment;WAS-ConfigurationAPI 
  
下文中无意外,我将php、MySQL、Zend装在F盘: 
打开我的电脑->属性->高级系统设置->环境变量里,添加上可执行文件的查找路径(PATH)和 php.ini 的查找路径(PHPRC): 
F:\php;F:\php\ext; 
接下来是PHP的配置,建议下载压缩包,随便解压到任何一个位置,比如我放在F:\php下,编辑文件夹里的php.ini-dist文件, 
extension=php_gd2.dll 
extension=php_mbstring.dll 
extension=php_mysql.dll 
去掉前面的分号,至此已经支持gd库 
  
将     extension_dir = "./" 
改为  extension_dir = "F:/php/ext/" 
注意后面一定要/结尾 
  
查找session.save_path,并去掉前面的勾,设置你想要的会话 
  
; where MODE is the octal representation of the mode. Note that this 
; does not overwrite the process’s umask. 
session.save_path = "F:/tmp" 
  
然后改名为php.ini并复制到c:\windows系统目录中 
  
配置如图: 
在ISAPI and CGI Restrictions选项中进行, 
  
在Handler Mappings中右击"添加脚本映射",如图 
在Default Document中添加index.php,Default.php
请根据自己的需要调整 
下面进行应用程序,缓冲池配置 
  
右击"添加应用程序缓冲池 
"  
在在配置好的缓冲池上右击"设置默认缓冲池",并进行如图配置,当然如果你不想遇到错误的话,可以不进行 
  
在你的站点上右击“高级设置”,并进行如下设置 
  
站点默认属性,进行以下设置 
  
好了,现在可以正常浏览了,而且不会出现错误哦, 
写个页面测试一下吧。 
<? 
phpinfo( 
?> 
  

配置mysql 
下载最新的安装程序,根据提示安装就行了,最后下载最新版的phpMyAdmin进行管理, 
  
关于zend相同,下载最新版并按照提示进行安装,最后需要指出的是,你会发现zend并不能正常工作,没关系, 
在“我的电脑”右击属性,进行"环境变量"的设置, 
在path中进行路径指定, 
如我装在F盘 
F:\php;F:\php\ext;F:\Zend\lib;F:\Zend\lib\Optimizer-3.2.2\php-5.2.x; 
  

IIS7配置ASP+Access使用环境 

默认装完IIS7之后,使用ASP程序会发现提示数据库连接失败, 
先要设置应用程序池(Application Pool)为Classic .NET AppPool,而不是默认的Default AppPool,可以在网站目录里对每个站点设置,也可以在站点进行单独设置。 
  
选择好要设置的站点之后,点右边的“基本设置”即可调出应用程序池设置对话框。 

    设置应用程序池(Application Pool)为Classic .NET AppPool(不分大小写),然后给“系统盘:\Windows\ServiceProfiles\NetworkService\AppData\Local\Temp”目录添加一个“Authenticated Users”用户,其中AppData目录是隐藏的,将Authenticated Users的权限中的完全控制打开。 
  
因为MS Jet引擎改变了临时目录的位置,但是又没有对临时的存取权限,导致数据库使用失败。 

启用父路径支持 
  
在站点主页上选择“ASP”,然后在“行为”组中将“启用父路径”设置为True即可。 

IIS7+JSP使用环境 

 1.安装JDK 1.5与Tomcat 5.5,生产环境 
建议安装exe版本以服务的方式运行,JDK和exe版的Tomcat基本不需要配置. 

使用解压缩工具将jakarta-tomcat.zip解压在F盘上,产生了目录jakarta-tomcat, 
解压后的文件存放于F:\ jakarta-tomcat。 

设置环境变量 
在“系统变量”下方单击“新建”按钮。 
在“变量名”中输入“JAVA_HOME”,在变量值中输入JDK所在的目录“F:\Java\jdk”, 
单击“确定” 

在Tomcat安装目录下的bin子目录中,双击startup.bat就是启动Tomcat的脚本文件, 

打开http://127.0.0.1:8080/(127.0.0.1表示本地机器,8080是Tomcat默认监听的端口号),将出现Tomcat页面。 

Tomcat的文档首页位置是Tomcat安装目录下的webapps\tomcat-docs\index.html。 
关闭Tomcat服务器,双击F:\ jakarta-tomcat\bin目录下的shutdown.bat文件。 

注意IIS和Tomcat都使用各自默认的端口80和8080. 

    2.在IIS中把JSP相关的请求发送到Tomcat需要Tomcat Connector的支持. 
由于Tomcat定位为JSP容器,所以Tomcat为主流的Web Server 和 OS 都提供支持. 
在上面的链接中下载 isapi_redirect.dll ,把它放到Tomcat 目录里面的 bin\win32\i386 里. 

按以下要求进行 Connector 进行配置, 
要求: 
The Tomcat redirector requires three entities:  

isapi_redirect.dll - The IIS server plugin, either obtain a pre-built DLL or build it yourself (see the build section).  
workers.properties - A file that describes the host(s) and port(s) used by the workers (Tomcat processes). A sample workers.properties can be found under the conf directory.  
uriworkermap.properties - A file that maps URL-Path patterns to workers. A sample uriworkermap.properties can be found under the conf directory as well.  

The installation includes the following parts:  
Configuring the ISAPI redirector with a default /examples context and checking that you can serve servlets with IIS.  
Adding more contexts to the configuration.  
注册表设置 

ISAPI redirector reads configuration from the registry, create a new registry key named :  

"HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Jakarta Isapi Redirector\1.0"  
 Using a properties file for configuration 

The ISAPI redirector can read it’s configuration from a properties file instead of the registry. This has the advantage that you can use multiple ISAPI redirectors with independant configurations on the same server. The redirector will check for the properties file during initialisation, and use it in preference to the registry if present.  

Create a properties file in the same directory as the ISAPI redirector called isapi_redirect.properties i.e. with the same name as the ISAPI redirector DLL but with a .properties extension. A sample isapi_redirect.properties can be found under the conf directory.  

The property names and values in the properties file are the same as for the registry settings described above. For example:  

# Configuration file for the Jakarta ISAPI Redirector 

# The path to the ISAPI Redirector Extension, relative to the website 
# This must be in a virtual directory with execute privileges 
extension_uri=/jakarta/isapi_redirect.dll 

# Full path to the log file for the ISAPI Redirector 
log_file=c:\tomcat\logs\isapi_redirect.log 

# Log level (debug, info, warn, error or trace) 
log_level=info 

# Full path to the workers.properties file 
worker_file=c:\tomcat\conf\workers.properties 

# Full path to the uriworkermap.properties file 
worker_mount_file=c:\tomcat\conf\uriworkermap.properties 

Notes:  
Back-slashes - ’\’ - are not escape characters.  
Comment lines begin with ’#’.  
Using a simple rewrite rules 

The ISAPI redirector with version 1.2.16 can do a simple URL rewriting. Althought not as powerfull as Apache Httpd’s mod_rewrite, it allows a simple exchange of request uris  

The rule is in the form rewritten=real-url.  

The rules must be simple strings. For example:  

# Simple rewrite rules 

/jsp/=/jsp-examples/ 
/servlets/=/servlets-examples/ 


Note that the uriworkermap or mount point must point to that new rule. 

workers.properties 示例 
# workers.properties.minimal - 

# This file provides minimal jk configuration properties needed to 
# connect to Tomcat. 

# The workers that jk should create and work with 

worker.list=ajp13w 



# Defining a worker named ajp13w and of type ajp13 
# Note that the name and the type do not have to match. 

worker.ajp13w.type=ajp13 
worker.ajp13w.host=localhost 
worker.ajp13w.port=8009 

  workders.properties添加worker,要修改worker.list项,多个worker使用,号分隔, 
通过 worker.<worker_name>.<property_name>的形式定义workder的属性. 
如上例中的 ajp13w,其中type表示Tomcat端使用的协议,除了ajp13外,常见的还有旧版的ajp12协议,host自然就是指tomcat所在的主机,我的理解是应该可以把它指到其他的主机上面,实现负载均衡等高级应用.port一般不需要更改, 

注意这个port是提供ajp13服务的,与 8080的http是两回事. 
配置时ajp13服务没有正常启动,重启服务器, 
确认服务器有无启动,可查看logs下stdout开头的日志文件,发现"INFO: JK2: ajp13 listening on /0.0.0.0:8009" 字样的行,说明Tomcat的 ajp13已经正常运行. 

uriworkermap.properties示例 
# uriworkermap.properties - IIS 

# This file provides sample mappings for example ajp13w 
# worker defined in workermap.properties.minimal 
# The general sytax for this file is: 
# [URL]=[Worker name] 

/servlets-examples/*=ajp13w 

# Optionally filter out all .jpeg files inside that context 
# For no mapping the url has to start with exclamation (!) 

  uriworkermap.properties配置,等号左边是url的样式,右手边是worker名称.Connector会把匹配该样式请求转发到指定worker进行处理. 

相当于在IIS把/servlets-examples/映射到Tomcat的/servlets-examples/应用程序. 

可把IIS站点根目录和Tomcat站点根目录指到同一目录,然后再把*.jsp和*.do映射到Tomcat去处理,这种方法应该比较适合生产环境 

 3.打开 IIS管理器 , 
 在ISAPI和CGI限制 里面把isapi_redirect.dll添加进去,并设为允许, 

在网站里面的"Default Web Site"添加应用程序.程序名应对应注册表中extension_uri的设置.然后将物理路径指向isapi_redirect.dll所在的目录.完成后点击应用程序,进入处理程序映射, 
点击右手边的"编辑处理程序权限...",把"执行"项勾打上. 
     
添加ISAPI筛选器以便Connector能截取到URL请求. 
点击"Default Web Site" -> "ISAPI 筛选器" ,把isapi_redirect.dll添加进去,名称随便. 
     
完成后,Connector就可对请求进行过滤,把符合配置文件请求重写到extension_uri指定的uri进行处理,这里为/jakarta/isapi_redirect.dll,然后isapi_redirect.dll再转发到tomcat的8009由tomcat处理完成后再循原路发回去. 

   如对 workers.properties 进行更改,需要重启IIS. 
注意:VISTA下面uriworkermap.properties的动态加载功能也无法正常运行.每次更改也需要重启IIS. 


后话:如果你喜欢c++正在研究64系统编程、又或者你喜欢安全方面的一些问题请你加入,msn:me.s@w.cn           qq:240453805 
不过你要给我一篇你的原创文章,而我将给你我记事本的邀请码,里面有我原创文章, 
主要是关于c++ server pages/人工智能/手机系统... 

发表评论:

即刻认识你所在地区的8万帅哥美女
免费注册,简单容易!匿名电邮,既隐秘又安
全!注意:绝不含有或容许任何色情成份!
chinesefriendfinder.com

[评论最长字数:1000,查看结果请刷新]

◎请在这里发表您的看法,发言请遵守国家有关法律、法规,尊重网上道德,承担一切因您的行为而直接或间接引起的法律责任。