IIS安裝及IIS無權訪問解決方案(Failed to access IIS metabase解決)

來源:互聯網
上載者:User

Failed to access IIS metabase解決方案:

原因:IIS沒有註冊

解決辦法:在CMD中進入目錄C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727,運行aspnet_regiis

1、aspnet_regiis -ga administrator(administrator為目前使用者)

C:\Documents and Settings\Administrator>cd c:\\windows\\microsoft.net\\framework\\v2.0.50727

2、aspnet_regiis -i (註冊IIS)

3、iisreset /noforce (重啟IIS)

以下是安裝方法及IIS相關問題(來源於網路):

(Win2000 使用IIS5.0  WinXP使用 IIS5.1)
xp iis5.1安裝包,附安裝說明。;
IIS5.1安裝包適合用於windows xp專業版(xp家庭版沒這功能,大部分用的盜版xp都是專業版,OEM版一般為家庭版)
很多人說安裝包沒用,沒安裝檔案,我暈,不是這樣安裝的,下面我來說一下iis5.1的大概目錄方法:
1:控制台/添加或刪除程式/刪除window組件
2:選擇Internet資訊服務(IIS),點下一步往下安裝即可.
3:安裝過程一般出提示要你插入xp光碟片,大家不用管它,點瀏覽到下載的目錄中即可,此安裝包100%有效]
 

一步:IIS的安裝

A.在控制台中選擇“添加/刪除程式”,在出現的對話方塊中選擇“添加/刪除Windows組件”(1)。

B.在出現的複選框中選擇安裝Internet資訊服務(IIS)(2),這一組件約需19MB的空間。

C.提示要你插入xp光碟片,大家不用管它,點瀏覽到下載的目錄中即可.

安裝過程中可能還會彈出提示框,需要光碟片中的檔案,點擊瀏覽,就會有預設檔案,選中它就可以。

 

 

第二步:IIS中Web伺服器的基本配置

IIS中Web伺服器的基本配置主要包括如下幾部分:

A.開啟IIS伺服器的配置視窗,選擇“開始”→“程式”→“管理工具”→“Internet服務管理員”,或者“選擇”→“控制台”→

“管理工具”→“Internet服務管理員”也可,。

B.在開啟的視窗中滑鼠右擊“預設Web網站”,選擇“屬性”菜單。

C.在出現的“預設Web網站屬性”視窗中,選擇“主目錄”標籤,用以設定Web內容在硬碟中的位置,預設目錄為

“C:\Inetpub\Wwwroot”,你可根據需要自己設定

 

D.在屬性視窗處選擇“文檔”標籤,設定自己預設的首頁網頁名稱,例如“Myfirstweb.htm”,將其添加並移動到列表

的最頂端

E.確認預設的Web網站是否已經啟動,如果沒有可以滑鼠右鍵點擊“預設Web網站”,選擇“啟動”,在開啟的IE地址欄

中鍵入原生IP地址,即可看到自己指定的首頁已經開始在Internet上發布了。

這裡只是介紹IIS最基本的設定選項,大家還可以按照需要去具體設定上面提到的“預設Web網站屬性”,通過它來配

置IIS的安全和其他一些參數。

==========================================================================================

無權訪問解決方案:

1 可以在IIS的預設網站下:把相應web應用程式的屬性-->目錄安全性-->存取控制許可權-->啟用匿名訪問給勾上
   如果強制需要輸入使用者名稱 IUSER_PC-201007081813  後面那一串是我的本機號碼
   本機號碼可以在  進階--->立即尋找中 最下面的名稱裡面就可以看到自己的號碼

 
2  對於根目錄,可能是由於你沒有配置預設頁面。。。
3 如果不能,說明配置不正確,本機IIS沒有監視80連接埠。查看本機80連接埠是否被監聽,可以運行cmd進入命令列視窗,然後執行netstat -an|more,尋找local address列是否有0.0.0.0:80這一項,對應的state列是否是LISTENING狀態?不過不是那就是沒有配置好
4 在本地安全性原則->本地策略->使用者權利指派
有一條拒絕從網路訪問本電腦,你看下裡面限定的使用者是否有everyone或者IIS使用者,再看看從網路訪問本電腦裡面是否有everyone

========================================================================
微軟官方解決方案:您無權訪問解決
注意:Windows 整合身分識別驗證、Windows NT 質詢/響應 (NTCR) 和 Windows NT LAN 管理器 (NTLM) 是相同的,在

本文中作為同義字來使用。

    * 當您使用 Windows 整合身分識別驗證(Microsoft Windows NT 質詢/響應)時,Internet Explorer 會提示輸

入密碼。

      要使 Internet Explorer 自動驗證使用者登入和密碼並保持安全性,必須滿足以下條件:
          o 必須在 IIS 的 Web 網站屬性中啟用 Windows 整合身分識別驗證,也稱為 Windows NT 質詢/響應。首先

嘗試匿名驗證,然後進行 Windows 整合身分識別驗證、簡要身分識別驗證(如果適用),最後進行基本(明文)身份

驗證。
          o 用戶端和 Web 服務器都必須在基於 Microsoft Windows NT 或基於 Microsoft Windows 2000 的同

一個域內,或者在受信任的基於 Windows NT 或基於 Windows 2000 的不同域內(在這些域內可以授予使用者帳戶訪

問基於 IIS 的電腦資源的許可權)。
          o 使用者的瀏覽器必須是 Internet Explorer。Internet Explorer 是唯一支援 Windows 整合身分識別驗證 

(NTCR) 的瀏覽器。
          o Internet Explorer 必須把所請求的 URL 視為 Intranet(本地)。如果所請求的 URL 的電腦名稱

稱部分包含句點(如 http://www.microsoft.com 和 http://10.0.0.1),Internet Explorer 會假定在 

Internet 中存在所請求的地址而不自動傳遞任何憑據。不包含句點的地址(如 http://webserver)被認為在 

Intranet (本地);Internet Explorer 會自動傳遞憑據。唯一的例外是在 Internet Explorer 中的 Intranet 

地區內包括的地址。
          o Internet Explorer 的 Intranet 地區的安全性設定必須設為“只在 Intranet 地區自動登入”。這是 

Internet Explorer 的預設設定。有關 Internet Explorer 安全性地區的其他資訊,請單擊下面的文章編號,以

查看 Microsoft 知識庫中相應的文章:
            174360  (http://support.microsoft.com/kb/174360/EN-US/ ) 如何在 Internet Explorer 中使用

安全區域
          o 請求 Web 頁的使用者必須具有訪問該 Web 頁以及該 Web 頁中引用的所有對象的適當的檔案系統 

(NTFS) 許可權。例如,一位使用者可能對某個 Web 頁具有完全控制權,但如果該 Web 頁引用了位於某個安全檔案夾

中的圖形,他仍會收到輸入密碼的提示。
    * 當您使用基本(明文)身分識別驗證或簡要身分識別驗證時,Internet Explorer 會提示輸入密碼。

      當您使用基本(明文)身分識別驗證或簡要身分識別驗證時,Internet Explorer 不會自動傳遞您的使用者名稱和密碼。

因此,當您使用這幾種驗證方法時,您總是收到要求憑據的提示。
    * 在使用匿名驗證時,Internet Explorer 提示輸入密碼。

      匿名驗證從不提示您輸入密碼,因為 IIS 已經知道匿名帳戶的使用者名稱和密碼。您收到輸入密碼的提示

是因為 Internet Explorer 已經被強制使用匿名驗證以外的其他驗證方法。發生這種情況是因為匿名用

戶帳戶(預設情況下是 IUSR_computername)沒有獲得對以下一個或多重專案的訪問權:
          o 所請求的檔案或 Web 頁
          o 任何嵌入到該檔案或 Web 頁中的所請求的對象(例形)
          o 與所請求的檔案或 web 頁相關聯的 ISAPI 副檔名(例如,.shtml 檔案)

=================================================================
Failed to access IIS metabase解決 
由於先安裝NET 再安裝IIS造成  重新裝NET即可
我的NET安裝目錄 
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
然後在CMD中輸入 C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727> aspnet_regiis –u
卸載後再輸入 C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>  aspnet_regiis –i
大功告成

================================================================= 
virtual directory not being configured as an application in IIS. 解決

路徑設定不合理可能會出現這樣的情況
虛擬路徑的設定 應該到該web.config所在的那一級檔案夾,否則會有衝突,具體原因在後面
EX:我的網站在D:\My Documents\Visual Studio 2008\Projects\WebSiteSQL1\PrecompiledWeb\WebSiteSQL1裡面
那麼虛擬路徑也應該設定為這個檔案夾

Configuration Error

Description:An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message:It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level.  This error can be caused by a virtual directory not being configured as an application in IIS.

解決方案:
情況1:When you create an new web application using visual studio.net, it automatically creates the virtual directory and configures it as an application.
However, if you manually create the virtual directory and it is not configured as an application, then you will not be able to browse the application and
may get the above error. The debug information you get as mentioned above, is applicable to this scenario.

To resolve it, Right Click on the virtual directory - select properties and then click on "Create" next to the "Application" Label and the textbox. It will
automatically create the "application" using the virtual directory's name. Now the application can be accessed.

當使用.net建立一個新的web程式時,通常會自動的建立虛擬目錄並設定為網站程式。
但是如果你手工建立虛擬目錄而沒有設定為網站程式,你就不能瀏覽網站的網頁並出現上述的錯誤。

按右鍵“預設網站”->建立->虛擬目錄,將虛擬目錄指向程式所在處,設定網站程式,就可以訪問了。

情況2:When you have sub-directories in your application, you can have web.config file for the sub-directory. However, there are certain properties which cannot
be set in the web.config of the sub-directory such as authentication, session state (you may see that the error message shows the line number where the
authentication or sessionstate is declared in the web.config of the sub-directory). The reason is, these settings cannot be overridden at the sub-directory level
unless the sub-directory is also configured as an application (as mentioned in the above point).

Mostly we have the practice of adding web.config in the sub-directory if we want to protect access to the sub-directory files (say, the directory is admin and we
wish to protect the admin pages from unathorized users).

But actually, this can be achieved in the web.config at the application's root level itself, by specifing the location path tags and authorization, as follows:-

<location path="Admin">
<system.web>
<authorization>
<allow roles="administrators" />
<deny users="*" />
</authorization>
</system.web>
</location>

However, if you wish to have a web.config at the sub-directory level and protect the sub-directory, you can just specify the Authorization mode as follows:-

<configuration>
<system.web>
<authorization>
<allow roles="administrators" />
<deny users="*" />
</authorization>
</system.web>
</configuration>

Thus you can protect the sub-directory from unauthorized access.

當你把web.config放在網站程式中的子檔案夾時,有一些屬性不能設定,如authentication, session state
(錯誤資訊顯示子檔案夾中web.config聲明的authentication, session state 所在的行號)。
原因是這些設定不能被子檔案夾的許可權覆蓋(override),除非子檔案夾本身被設定成網站程式。
通常情況下我們希望把web.config放在子檔案夾中來保護對子檔案夾中檔案的訪問
(假設目錄是admin,我們希望保護admin裡面的檔案不被未授權的使用者訪問)

實際上,當web.config在網站程式根目錄時,也能做到,如下:
<location path="Admin">
<system.web>
<authorization>
<allow roles="administrators" />
<deny users="*" />
</authorization>
</system.web>
</location>

如果你想把web.config放在子目錄,可以這樣設定:
<configuration>
<system.web>
<authorization>
<allow roles="administrators" />
<deny users="*" />
</authorization>
</system.web>
</configuration>

這樣可以做到保護子檔案夾不被未授權的使用者訪問。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.