在Apache中配置ASP.NET环境

本文前提是成功安装好了FrameWork 2.0

一、下载所需软件

1. apache

2.mod_aspdotnet-2.0.0.msi(到这里下载http://httpd.apache.org/modules/

二、安装

1.安装apache 2.0.58值得注意的是,需要先停止IIS (net stop w3svc)

2.安装mod_aspdotnet-2.0.0.msi

三、需要配置httpd.conf 文件 在文件末尾 加下面代码

# asp.net 支持
# 这2条配置属于全局配置,可放在其它响应 LoadModule/AddHandler 语句块后面
# 我的配置中,下面整个配置块是放在最后,未分开,这也是为了方便管理
LoadModule aspdotnet_module “modules/mod_aspdotnet.so”
AddHandler asp.net asax ascx ashx asmx aspx axd config cs csproj licx rem resources resx soap vb vbproj vsdisco webinfo

# 下面的整段配置可以放在虚拟主机中
<IfModule mod_aspdotnet.cpp>

# Mount the ASP.NET example application
# AspNetMount 语句相当于 Linux 中的 mount 命令,是把Asp程序目录挂载到一个 URL 地址
# 如果不是整个网站都用Asp,则不应该挂在‘/’下。如:AspNetMount /asptool “D:\\www\\Apache2\\htdocs\\aspweb”
# 注意:整站采用时,全局的DocumentRoot 为 “D:/www/Apache2/htdocs/aspweb”
AspNetMount /”D:/PHPnow/htdocs”

# Map all requests for /active to the application files
# 意思是把所有到‘/asptool’的请求映射到挂载的Asp程序目录下
# 我的配置中,下面一句是注释掉的
# Alias /asptool “D:/www/Apache2/htdocs/aspweb”

# Allow asp.net scripts to be executed in the active example
<Directory “D:/PHPnow/htdocs”>
Options FollowSymlinks ExecCGI
Order allow,deny
Allow from all
DirectoryIndex default.htm default.aspx index.html index.aspx
</Directory>
# For all virtual ASP.NET webs, we need the aspnet_client files
# to serve the client-side helper scripts.

# 注意:下面两行需要对应.Net Framework安装的目录
AliasMatch /aspnet_client/system_web/(\d+)_(\d+)_(\d+)_(\d+)/(.*) “C:/WIN2003/Microsoft.NET/Framework/v$1.$2.$3/ASP.NETClientFiles/$4”

<Directory “C:/Windows/Microsoft.NET/Framework/v*/ASP.NETClientFiles”>
Options FollowSymlinks
Order allow,deny
Allow from all
</Directory>

</IfModule>
# asp.net 支持 End.

其中E:/www/http/asp 是ASP.NET网页目录

重启Apache就OK了

运行的时候错误,把    Web.config文件中第46行的   <!–<authentication mode=”Windows” />–> 删掉