Apache run asp.net==>2.0以上的版本

以下内容,丛网上COPY过来的...

 

Apache是目前广泛使用的一种网络服务器程序,不仅在UNIX/LINUX平台上被大量使用,而且在Windows平台上也有许多站点放弃了IIS而转向Apache。.NET是微软推出的功能强大的开发技术,其目标就是与Java抗衡。ASP.NET非常适合于中小企业的Web应用,其性能较ASP3.0有了极大的提高。下面就介绍让Apache支持ASP.NET的办法。

    首先,必须要有Windows环境和.NET Framework的支持。此外还建议安装.NET开发工具如.NET Framework SDK或者VisualStudio.NET。需要注意的是Windows的版本应为2000、2003和XP。Win9X系列不能安装.NET Framework。然后需要安装Apache。应该使用Win32平台的Apache,版本2.0以上。下载地址:http://labs.renren.com/apache-mirror/httpd/binaries/win32/httpd-2.2.15-win32-x86-no_ssl.msi

下载并安装Apache环境下的ASP.NET模块。下载地址:http://downloads.sourceforge.net/project/mod-aspdotnet/mod_aspdotnet/2.x.0.2006/mod_aspdotnet-2.2.0.2006-setup-r2.msi 下载完成后双击打开,一路Next即可安装完成。注:is not a valid path to an installed instance of apache,遇到这个错误,说明你的apache和apache模块不匹配。

    为了便于管理,我们在htdocs目录下新建一个active目录,专门存放.aspx文件。现在需要对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
<IfModule mod_aspdotnet.cpp>
# Mount the ASP.NET example application
AspNetMount /active "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/active"
# Map all requests for /active to the application files
Alias /active "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/active"
# Allow asp.net scripts to be executed in the active example
<Directory "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/active">
Options FollowSymlinks ExecCGI
Order allow,deny
Allow from all
DirectoryIndex Default.htm Default.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>
</IfModule>

 

 

    其中C:/Program Files/Apache Software Foundation/Apache2.2/是Apache的安装目录,/active 指的是虚拟目录,而"C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/active" 指向的是虚拟目录/active所对应的绝对路径,所以呢打开网站网址时,要加上虚拟目录名称,如www.127.0.0.1.com/active/Default.aspx,应根据实际情况更改。现在可以在active目录下放上ASP.NET探针。重启Apache之后,即可体验Apache下的ASP.NET了。

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

 

 

如果采用apache发布aspnet时,得注意安全性,还有mod_aspdotnet 是Apache基金会一个已经停止的项目,该项目以模块方式为Apache Web 服务器提供对微软 ASP.NET 应用支持。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值