顯示具有 IIS 標籤的文章。 顯示所有文章
顯示具有 IIS 標籤的文章。 顯示所有文章

2016年8月4日 星期四

[IIS][ASP.NET] 拒絕訪問Temp目錄

創建BlogConfigurationSettings 的配置節處理程序時出錯: 拒絕訪問臨時目錄。以其運行XmlSerializer 的身份“IIS APPPOOL\www.cnblogs.com”沒有足夠的權限訪問臨時目錄。CodeDom 將使用此進程用於進行編譯的用戶帳戶,因此如果用戶對系統臨時目錄沒有訪問權限,則將無法編譯。使用Path.GetTempPath() API 可找到臨時目錄位置。
Access to the temp directory is denied. Identity 'IIS APPPOOL\www.cnblogs.com' under which XmlSerializer is running does not have sufficient permission to access the temp directory. CodeDom will use the user account the process is using to do the compilation, so if the user doesnt have access to system temp directory, you will not be able to compile. Use Path.GetTempPath() API to find out the temp directory location.
CS0016: 未能寫入輸出文件“c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\946055b8\92eead15\App_global.asax.qakaesxx.dll”--“拒絕訪問。 ”
開始以為是“C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files”文件夾權限的問題,但怎麼設置這個權限也解決不了問題。
後來在應用程序池設置中將“加載用戶配置文件”(Load User Profile)設置為true,問題就解決。




[IIS][ASP.NET] 拒絕訪問Temp目錄

創建BlogConfigurationSettings 的配置節處理程序時出錯: 拒絕訪問臨時目錄。以其運行XmlSerializer 的身份“IIS APPPOOL\www.cnblogs.com”沒有足夠的權限訪問臨時目錄。CodeDom 將使用此進程用於進行編譯的用戶帳戶,因此如果用戶對系統臨時目錄沒有訪問權限,則將無法編譯。使用Path.GetTempPath() API 可找到臨時目錄位置。
Access to the temp directory is denied. Identity 'IIS APPPOOL\www.cnblogs.com' under which XmlSerializer is running does not have sufficient permission to access the temp directory. CodeDom will use the user account the process is using to do the compilation, so if the user doesnt have access to system temp directory, you will not be able to compile. Use Path.GetTempPath() API to find out the temp directory location.
CS0016: 未能寫入輸出文件“c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\946055b8\92eead15\App_global.asax.qakaesxx.dll”--“拒絕訪問。 ”
開始以為是“C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files”文件夾權限的問題,但怎麼設置這個權限也解決不了問題。
後來在應用程序池設置中將“加載用戶配置文件”(Load User Profile)設置為true,問題就解決。

2016年7月20日 星期三

009 在IIS7中顯示ASP偵錯訊息





在IIS7中顯示ASP偵錯訊息
最近接到一個案子,是學校的案子,所以因為學校的政策關係,沒辦法使用我比較熱悉的ASP.net,只能硬著頭皮,用高職學的ASP來寫程式,而我的作業系統上WINDOWS 7內建的是IIS 7 。但是發現了一個問題,當我程式發生錯誤的時候他出現很不討喜的錯誤訊息
An error occurred on the server when processing the URL. Please contact the system administrator.
If you are the system administrator please click here to find out more about this error.
image 
我本人之前還笨笨的把他移到IIS 5上去執行,這樣來來回回浪費了不少時間!

原來,在IIS 7中 ASP的偵錯訊息是預設關閉的

只要在IIS 7 中你需要改的站台中
image
看到ASP這個按鈕點下去
image
有一個「將錯誤傳送到瀏覽器」
把他改成True
之後套用!

你在開啟一次你錯誤的網頁

image

偵測出ASP.NET設定沒有套用到整合式Managed管線模式

執行ASP.NET應用程式時,發生【HTTP錯誤500.21-Internal Server Error,處理常式 "PageHandlerFactory-Integrated" 的模組清單中有錯誤的模組 "ManagedPipelineHandler"】錯誤的故障排除

本文將介紹在執行ASP.NET應用程式時,發生【HTTP錯誤500.21-Internal Server Error,處理常式 "PageHandlerFactory-Integrated" 的模組清單中有錯誤的模組 "ManagedPipelineHandler"】錯誤的故障排除
當您嘗試在IIS 7.5上執行ASP.NET應用程式(以.NET Framework 4.0為例)時,遇到處理常式 "PageHandlerFactory-Integrated" 的模組清單中有錯誤的模組 "ManagedPipelineHandler"的錯誤時該如何排除,本文將提供可能的解決方案。
2011-09-27_174647
若您是先安裝.NET Framework 4.0獨立安裝程式再啟用IIS角色就可能遇到上述的錯誤訊息,原因在於IIS角色在啟用時並未更新現有的應用程式以使用ASP.NET 4 版本的應用程式集區 ,以及在 IIS Metabase 中未更新傳統模式及 IIS 整合模式下ASP.NET 4的處理常式與指令對應,以至於出現上述的錯誤訊息。
解決步驟如下:
  • Win + R開啟執行視窗後輸入cmd按確定,開啟命令提示字元。
  • 依據作業系統的位元數切換至相對應的目錄。
    • 32位元的作業系統請切換至【%systemroot%\Microsoft.NET\Framework】。
    • 64位元的作業系統請切換至【%systemroot%\Microsoft.NET\Framework64】。
  • 輸入【aspnet_regiis -i】後按ENTER,下圖的為在64位元的作業系統下所做的範例。
image
依照上述步驟即可於IIS 7.5上執行ASP.NET 4.0應用程式。以本文所舉的情境為例,建議要讓ASP.NET順利在IIS 7.5上執行的設定步驟如下:
  1. 啟用IIS角色,並選取ASP.NET角色服務。
  2. 安裝.Net Framework 4.0獨立安裝程式。
【參考資料】


error
在本機電腦上安裝及解除安裝 ASP.NET 的管理公用程式。
Copyright (C) Microsoft Corporation.  著作權所有,並保留一切權利。
開始安裝 ASP.NET (4.0.30319.0)。
這個作業系統版本不支援這個選項。系統管理員應該改用 [開啟或關閉 Windows 功能] 對
話方塊、[伺服器管理員] 管理工具或 dism.exe 命令列工具,隨著 IIS8 一起安裝/解除安
裝 ASP.NET 4.5。如需詳細資訊,請參閱 http://go.microsoft.com/fwlink/?LinkID=2167
71。
完成安裝 ASP.NET (4.0.30319.0)。

C:\Windows\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis -i
Microsoft (R) ASP.NET RegIIS 版本 4.0.30319.0
在本機電腦上安裝及解除安裝 ASP.NET 的管理公用程式。
Copyright (C) Microsoft Corporation.  著作權所有,並保留一切權利。
開始安裝 ASP.NET (4.0.30319.0)。
這個作業系統版本不支援這個選項。系統管理員應該改用 [開啟或關閉 Windows 功能] 對
話方塊、[伺服器管理員] 管理工具或 dism.exe 命令列工具,隨著 IIS8 一起安裝/解除安
裝 ASP.NET 4.5。如需詳細資訊,請參閱 http://go.microsoft.com/fwlink/?LinkID=2167
71。
完成安裝 ASP.NET (4.0.30319.0)。

How do I enable upload of large files in classic ASP on IIS 7?

Recently I had to get an old ASP application working in IIS 7.5 on a W2K8 server. Almost everything works fine, except that I can't seem to get it to accept uploads larger than ~200kB. I did find a setting, that from what I can understand should to the trick, in the applicationHost.config, I set the max request size to 100 MB like this:
<location path="TheNameOfMySite">
    <system.webServer>
        <security>
            <requestFiltering>
                <requestLimits maxAllowedContentLength="104857600" />
            </requestFiltering>
        </security>
    </system.webServer>
</location>
Unfortunately, this seems to do nothing at all, it still refuses to accept any files larger than about 200 kB, and in the log file it gives this error message:
ASP_0104_:_80004005|Operation_not_Allowed
Googling that points to increasing the maxAllowedContentLength as I have done above. So I'm fresh out of ideas, but confident that the clever stackoverflow crowd can solve this in less time than it took for me to write this question.

The maxAllowedContentLength controls how much data is allowed to be sent in a response. However you want to control how much can be accepted in a request. This is handled by themaxRequestEntityAllowed attribute of the limits element in the asp section of the config file. An example might look like:-
<system.webServer>
  <asp>
     <cache diskTemplateCacheDirectory="%SystemDrive%\inetpub\temp\ASP Compiled Templates" />
     <limits scriptTimeout="00:02:00"
        queueConnectionTestTime="00:00:05"
        requestQueueMax="1000"
        maxRequestEntityAllowed="104857600"
        />
  </asp>
You can configure this in the IIS7 manager under the "Limit Properties" category in the property grid for the ASP feature. Alternatively you can use a command line:-
appcmd set config /section:asp /limits.maxRequestEntityAllowed:104857600
Note that extending this value increase the window for DOS attack where the attacker sends large content to the server so don't be tempted to extend this beyond what you really need.

IIS7.0 ASP 啟用上層路徑

http://itgroup.blueshop.com.tw/inmarkblue/markshu?n=convew&i=6684

開啟IIS管理員
ASP/ 開啟功能
將啟用上層路徑 及 將錯誤傳送到瀏覽器 選取

部署傳統 ASP 伺服器

若要部署傳統 ASP 伺服器

使用 Web Platform Installer (Web PI) 可以讓您輕鬆安裝 IIS 以及在 IIS 上執行的應用程式。 因為 Web PI 會安裝最新版本的可用 Web Platform 提供項目,所以只需要幾個簡單的按選動作,您就可以下載並安裝任何新工具或更新。 如需深入了解 Web PI,請參閱深入了解並安裝 Web PI (英文)。
您也可以藉由使用 Windows 使用者介面 (UI) 或是從命令列來執行這個程序。

若要在 Windows Server 2008 或 Server 2008 R2 中使用 UI

  1. 按一下 [開始],指向 [系統管理工具],然後按一下 [伺服器管理員]。
  2. 在 [角色摘要] 中,按一下 [新增角色]。
  3. 使用 [新增角色精靈] 新增 [網頁伺服器 (IIS)] 角色。
    如需如何安裝預設 IIS 7 網頁伺服器的詳細資訊,請參閱部署靜態內容伺服器 (IIS 7)。
  4. 在 [選取角色服務] 頁面上,注意預設安裝之預先選擇的角色服務,然後選取下列其他角色服務:
    • ASP
    • 要求篩選
    • ISAPI 擴充程式
  5. 在 [要安裝的功能摘要] 頁面上,確認您所做的選擇,然後按一下 [安裝]。
  6. 在 [安裝結果] 頁面上,確認成功完成要安裝的網頁伺服器 (IIS) 角色以及所需的角色服務,然後按一下 [關閉]。
  7. 若要確認 IIS 安裝成功,請將下列網址輸入網頁瀏覽器:
    http://localhost
    您應該會看見預設的 IIS 7 歡迎使用畫面。

若要在 Windows Vista 或 Windows 7 中使用 UI

  1. 按一下 [開始],然後按一下 [控制台]。
  2. 在 [控制台] 中,按一下 [程式集],再按一下 [開啟或關閉 Windows 功能]。
  3. 在 [Windows 功能] 對話方塊中,按一下 [Internet Information Services] 以安裝預設功能,然後選取下列其他功能:
    • ASP
    • 要求篩選
    • ISAPI 擴充程式
  4. 按一下 [確定],關閉 [Windows 功能] 對話方塊。
  5. 若要確認 IIS 安裝成功,請將下列網址輸入網頁瀏覽器:
    http://localhost
    您應該會看見預設的 IIS 歡迎使用畫面。

若要使用命令列

  • 將下列命令輸入成一個指令碼:
    Start /w pkgmgr /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;IIS-ApplicationDevelopment;IIS-ASP;IIS-ISAPIExtensions;IIS-HealthAndDiagnostics;IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-Security;IIS-RequestFiltering;IIS-HttpCompressionStatic;IIS-WebServerManagementTools;IIS-ManagementConsole; WAS-WindowsActivationService;WAS-ProcessModel;WAS-NetFxEnvironment;WAS-ConfigurationAPI