为什么要在apache下发布ASP.NET,看这篇文章您一定有自己的原因。

我是因为XP系统里面同时装IIS 和 AppServer会有问题。

步骤:

1.环境搭建,这个不废话,我安装的是.NET2.0 apache2.2 你可以使用 phpnow,xampp,phpstudy都可以,或者是自己动手搭建,需要下载PHP mysql apache软件

2.下载apache下.NET组件包:这里为大家准备好了https://files.cnblogs.com/gosky/Apache2.2%E4%B8%8BASPNET%E7%BB%84%E5%BB%BAmod_aspdotnet.rar

    安装目录与apache相同 安装完成后查看 \Apache2.2.21\modules目录下是否存在mod_aspdotnet.so组件

4.新建一个net目录,即为ASP.NET文件的根目录(相当于WWW目录),程序就发布到这里面。

在Apache下发布ASP.NET程序

 

5.修改配置文件,打开httpd.conf  使用其他集成环境自己找到。

在Apache下发布ASP.NET程序

 

6.重点来了,在末尾添加:

#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
AspNetMount /abc "E:/wamp/net"
Alias /abc "E:/wamp/net"
#/SampleASP是用于执行asp.net的目录的别名,c:/SampleASP是它的实际地址
# 打开脚本运行权限
<Directory "E:/wamp/net">
Options FollowSymlinks ExecCGI
Order allow,deny
Allow from all
DirectoryIndex index.htm index.aspx
#设置默认文件
</Directory>
# 对于ASP.NET虚拟页面,需要如下aspnet_client文件来支持客户端帮助脚本
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>
#asp.net

注意蓝色:两个地方要修改

不出问题 重启Apache服务即可。
在net目录下新建 default.aspx 即可访问 http://127.0.0.1/net/default.aspx

在Apache下发布ASP.NET程序

这个错误标识你的应用没有发布在根目录下面。

 
祝你早日成功!
原文请参考:http://www.cnblogs.com/webflash/archive/2009/07/06/1517686.html

 

相关文章:

  • 2021-06-28
  • 2022-12-23
  • 2022-12-23
  • 2021-07-14
  • 2022-12-23
猜你喜欢
  • 2021-12-24
  • 2021-07-12
  • 2022-12-23
  • 2021-06-21
  • 2022-12-23
  • 2022-01-20
  • 2021-06-29
相关资源
相似解决方案