2014-04-19 09:11:01
来 源
kejihao
Apache
本文介绍配置Apache服务器支持ASP.NET,希望对于初学Apache服务器相关的朋友有帮助,更多Apache安装、配置、报错处理等资源请本站内搜索。
1.下载并安装Apache环境下的ASP.NET模块

笔者目前只找到与Apache2.0.59匹配的ASP.NET模块,最新的版本似乎未有.在安装过程中,程序会要求匹配的APACHE路径.

2.httpd.conf文件配置

#asp.net

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

# Mount the ASP.NET example application假设网站文件位于f:/mobileshop

AspNetMount /mobileshop "f:/mobileshop"

# Map all requests for /active to the application files

Alias /mobileshop "f:/mobileshop" # Allow asp.net scripts to be executed in the active example

<Directory "f:/mobileshop">

Options FollowSymlinks ExecCGI

Order allow,deny

Allow from all

DirectoryIndex Default.htm Default.aspx index.aspx

</Directory>

# For all virtual ASP.NET webs, we need the aspnet_client files

# to serve the client-side helper scripts.

AliasMatch /aspnet_client/system_web/(d+)_(d+)_(d+)_(d+)/(.*)

"C:/Windows/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>

3.重启服务器

由于IIS和Apache下的ASP.NET都是运行在Common Language Runtime(CRL)的基础上,因此Apache环境下的ASP.NET程序的运行速度不会比在IIS下慢。

声明: 此文观点不代表本站立场;转载须要保留原文链接;版权疑问请联系我们。