当前位置: 移动技术网 > 网络运营>服务器>Linux > 让apache也支持asp环境的方法

让apache也支持asp环境的方法

2019年05月02日  | 移动技术网网络运营  | 我要评论

注:注意上面方法只限于在windows下 并且装了framework一般win7已经自带有了

1、首先 下载一个mod_aspdotnet-2.2.0.2006-setup-r2.msi
2、安装好后在apache的moudles目录会生成一个mod_aspdotnet.so文件
3、修改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>   
     aspnetmount / "d:/xampp/xampp/htdocs/"   
    alias / "d:/xampp/xampp/htdocs/"   
    <directory "d:/xampp/xampp/htdocs/">   
         options followsymlinks execcgi   
        order allow,deny   
        allow from all   
        directoryindex index.htm index.aspx   
    </directory>   
    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>

#asp.net

其中红色为你网站放置的目录

4、重新启动apache ok成功

看看其它文章

按照网上的说明尝试装iis,好歹装上了可是不好使,看来xp home是不支持iis,于是转向apache。

下载安装好apache 2.2.9 http://www.apache.org/,一切正常,又发现不支持asp和.net的程序,晕;

google一番,找到sun java system active server pages 4.0

http://www.sun.com/software/chilisoft/,

下载下来安装好,重启机器,ok,asp没问题了;

继续google,找到apache下面的一个项目mod_aspdotnet,发现apache已经不支持此项目了,

此项目改投sourceforge,mod_aspdotnet-2.2.0 http://sourceforge.net/projects/mod-aspdotnet,

下载安装,修改apache的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>

以上部分代码,注意不要有空行,相关路径按照实际情况填写

又又发现此版本只支持.net framework1.1,于是卸掉2.0重装1.1,ok了,只是对.net 2.0的语法不支持

最终测试成功的环境

windows xp home edition
apache 2.2.9
sun one asp 4.0
.net frmawork 1.1
mod_aspdotnet 2.2.0
万恶的microsoft

ko我们的安装就可以了,大家看看可以正常运行不哦。

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网