专注网站设计、制作、开发

精良的设计开发团队、优质贴心的售前售后服务、全程的技术支持!

全国咨询热线:400-806-2015

专业网站定制热线: 400-806-2015

Window + Apache 2.0 + ASP.NET(mod_aspdotnet)Apache架设ASP.NET

2018-11-22 23:11 - 作者:顺茂企服

在Apache安装目录下,找到conf文件夹,打开httpd.conf文件添加mod_aspdotnet.so


LoadModule aspdotnet_module "modules/mod_aspdotnet.so"
判断mod_aspdotnet加载,并对应.Net Framework



<IfModule mod_aspdotnet.cpp>
AddHandler asp.net asax ascx ashx asmx aspx axd config cs csproj licx rem resources resx soap vb vbproj vsdisco webinfo
# For all virtual ASP.NET webs, we need the aspnet_client files
# to serve the client-side helper scripts.
AliasMatch ^/(?i)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>
因为我配置的是虚拟主机,所以在httpd-vhosts.conf中增加虚拟主机


<VirtualHost *:80>
    ServerAdmin job@7lib.com
    DocumentRoot "C:/WWWASPX/asp.hbsmwlkj.com"
    ServerName asp.hbsmwlkj.com
    ServerAlias asp.hbsmwlkj.com
	
	
<IfModule mod_aspdotnet.cpp>
AspNetMount / "C:/WWWASPX/asp.hbsmwlkj.com"
<Directory "C:/WWWASPX/www.91fashang.com">
Options FollowSymlinks ExecCGI
Order allow,deny
Allow from all
</Directory>
</IfModule>


    ErrorLog "C:/WWWASPX/asp.hbsmwlkj.com.logs/error.log"
    CustomLog "C:/WWWASPX/asp.hbsmwlkj.com.logs/access.log" common

</VirtualHost>