Apache添加mod_aspdotnet.so支持ASP.NET配置指南
时间:2010-11-13 来源:lty
##################################################################
#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:/dotnet_document
AspNetMount /mytest "f:/dotnet_document"
# Map all requests for /active to the application files
Alias /mytest "f:/dotnet_document"
# Allow asp.net scripts to be executed in the active example
<Directory "f:/dotnet_document">
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>
##################################################################
6.编写测试文件index.aspx存放到f:\dotnet_document目录下,内容如下:
<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
</script>
<html xmlns="http://www.w3.org/1999/xhtml"; >
<head runat="server">
<title>Hello World! - mod_aspdotnet</title></head>
<body>
<form id="form1" runat="server">
<div>
<% Response.Write("<h1>Hello World!</h1>")%>
</div>
</form>
</body></html>
6.重启Apache服务器,打开浏览器输入http://127.0.0.1/mytest回车,看到如下结果,说明Apache的mod_aspdotnet模块工作正常了。