生活随笔
收集整理的這篇文章主要介紹了
用 Apache 发布 ASP.NET 网站
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
由于服務(wù)器需要發(fā)布 JSP 、PHP、ASP.NET?幾種網(wǎng)站進(jìn)行測(cè)試,Apache 肯定是支持 JSP? 和 PHP?。鑒于 Apache 的開放精神?,ASP.Net?應(yīng)該也是支持的,于是乎 Google之。配置步驟如下:
1.下載 ASP.NET 解析模塊(mod_aspdotnet )
下載地址:http://sourceforge.net/projects/mod-aspdotnet/?,直接安裝。在...\apache\modules目錄下會(huì)出現(xiàn)一個(gè)名為 mod_aspdotnet.so 的模塊。
2.配置 Apache 使其支持此模塊
創(chuàng)建配置文件 mod_aspdotnet.conf, 保存在 ...\apache\conf 目錄下,其內(nèi)容如下:
[plain]?view plaincopy
#?ASP.NET?Support??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?/aspnet?"f:/demo"??????#?Map?all?requests?for?/active?to?the?application?files??????Alias?/aspnet?"f:/demo"????????#?Allow?asp.net?scripts?to?be?executed?in?the?active?example??????<Directory?"f:/demo">??????????Options?FollowSymlinks?ExecCGI??????????Order?allow,deny??????????Allow?from?all??????????DirectoryIndex?index.aspx?Default.aspx?index.html??????</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>?? 注意:下面兩句不能換行,且網(wǎng)站本地路徑中不能包含中文字符。
AddHandler asp.net asax ascx ashx asmx aspx axd config cs csproj licx rem resources resx soap vb vbproj vsdisco webinfo
AliasMatch /aspnet_client/system_web/(\d+)_(\d+)_(\d+)_(\d+)/(.*) \"C:/Windows/Microsoft.NET/Framework/v$1.$2.$3/ASP.NETClientFiles/$4"
然后再 httpd.conf 文件末尾添加
[plain]?view plaincopy
#mod_aspdotnet?support??Include?conf/mod_aspdotnet.conf?? 最后重啟 Apache 即可。
3. 測(cè)試
編寫測(cè)試頁default.aspx,放在“f:/demo” 目錄下
輸入測(cè)試頁:http://localhost:8080/aspnet/default.aspx
總結(jié)
以上是生活随笔為你收集整理的用 Apache 发布 ASP.NET 网站的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。