前提已經搭配好Apache環境
下載安裝 2mod_aspdotnet-2.0.0.msi(到這裡下載http://httpd.apache.org/modules/)
需要配置httpd.conf 檔案 在檔案末尾 加下面代碼
# asp.net 支援
# 這2條配置屬於全域配置,可放在其它響應 LoadModule/AddHandler 語句塊後面
# 我的配置中,下面整個配置塊是放在最後,未分開,這也是為了方便管理
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 語句相當於 Linux 中的 mount 命令,是把Asp程式目錄掛載到一個 URL 地址
# 如果不是整個網站都用Asp,則不應該掛在‘/’下。如:AspNetMount /asptool "D:\\www\\Apache2\\htdocs\\aspweb"
# 注意:整站採用時,全域的DocumentRoot 為 "D:/www/Apache2/htdocs/aspweb"
AspNetMount / "D:/PHPnow/htdocs"
# Map all requests for /active to the application files
# 意思是把所有到‘/asptool’的請求映射到掛載的Asp程式目錄下
# 我的配置中,下面一句是注釋掉的
# Alias /asptool "D:/www/Apache2/htdocs/aspweb"
# Allow asp.net scripts to be executed in the active example
<Directory "D:/PHPnow/htdocs">
Options FollowSymlinks ExecCGI
Order allow,deny
Allow from all
DirectoryIndex default.htm default.aspx index.html index.aspx
</Directory>
# For all virtual ASP.NET webs, we need the aspnet_client files
# to serve the client-side helper scripts.
# 注意:下面兩行需要對應.Net Framework安裝的目錄
AliasMatch /aspnet_client/system_web/(\d+)_(\d+)_(\d+)_(\d+)/(.*) "C:/WIN2003/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>