生活随笔
收集整理的這篇文章主要介紹了
用 Apache 发布 ASP.NET 网站
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
由于服務器需要發布 JSP 、PHP、ASP.NET?幾種網站進行測試,Apache 肯定是支持 JSP? 和 PHP?。鑒于 Apache 的開放精神?,ASP.Net?應該也是支持的,于是乎 Google之。配置步驟如下:
1.下載 ASP.NET 解析模塊(mod_aspdotnet )
下載地址:http://sourceforge.net/projects/mod-aspdotnet/?,直接安裝。在...\apache\modules目錄下會出現一個名為 mod_aspdotnet.so 的模塊。
2.配置 Apache 使其支持此模塊
創建配置文件 mod_aspdotnet.conf, 保存在 ...\apache\conf 目錄下,其內容如下:
[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>?? 注意:下面兩句不能換行,且網站本地路徑中不能包含中文字符。
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. 測試
編寫測試頁default.aspx,放在“f:/demo” 目錄下
輸入測試頁:http://localhost:8080/aspnet/default.aspx
總結
以上是生活随笔為你收集整理的用 Apache 发布 ASP.NET 网站的全部內容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。