欢迎光临
我们一直在努力

让Apache支持ASP.NET-ASP教程,ASP应用

建站超值云服务器,限时71元/月

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以上。推荐使用2.0.51版本。下载地址:

http://apache.freelamp.com/httpd/binaries/win32/apache_2.0.52-win32-x86-no_ssl.msi

具体的安装过程请参阅其他文章,本文不再赘述。

下面要下载并安装apache环境下的asp.net模块。下载地址:

http://www.apache.org/dist/httpd/mod_aspdotnet/mod_aspdotnet-2.0.0.msi

下载完成后双击打开,一路next即可安装完成。

为了便于管理,我们在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 "d:/program files/apache group/apache2/htdocs/active"

# map all requests for /active to the application files

alias /active "d:/program files/apache group/apache2/htdocs/active"

# allow asp.net scripts to be executed in the active example

<directory "d:/program files/apache group/apache2/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>

其中d:/program files/apache group/apache2是apache的安装目录,应根据实际情况更改。

现在可以在active目录下放上asp.net探针。重启apache之后,即可体验apache下的asp.net了。

由于iis和apache下的asp.net都是运行在common language runtime(crl)的基础上,因此apache环境下的asp.net程序的运行速度不会比在iis下慢。

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 让Apache支持ASP.NET-ASP教程,ASP应用
分享到: 更多 (0)

相关推荐

  • 暂无文章