2015-12-21 70 views
0

我們正在將網站內核託管到Azure網站。當在日誌文件看,我注意到了記錄錯誤的大量:Sitecore 8.1:通過其訪問權限禁止的azure網站127.0.0.1

ManagedPoolThread #11 2015:12:20 19:47:59 ERROR Exception in UrlAgent (url: http://localhost/sitecore/service/keepalive.aspx) 
Exception: System.Net.WebException 
Message: Unable to connect to the remote server 
Source: System 
    at System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request) 
    at System.Net.WebClient.DownloadData(Uri address) 
    at System.Net.WebClient.DownloadData(String address) 
    at Sitecore.Web.WebUtil.ExecuteWebPage(String url, NameValueCollection headers) 
    at Sitecore.Web.WebUtil.ExecuteWebPage(String url) 
    at Sitecore.Tasks.UrlAgent.Run() 

Nested Exception 

Exception: System.Net.Sockets.SocketException 
Message: An attempt was made to access a socket in a way forbidden by its access permissions 127.0.0.1:80 
Source: System 
    at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) 
    at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception) 

我們正在使用IP安全的IP白名單。起初,它可能是這個,並添加到白名單127.0.0.1。不過,我仍然收到上述錯誤。

某處我閱讀的azure網絡應用程序不支持localhost或類似的。

有沒有人遇到過這個問題,並有解決方案?

UPDATE:

應用由馬立克提供的解決方案。但是我們也看到新的錯誤:

Exception: System.Net.WebException 

Message: The remote server returned an error: (403) Forbidden. 

Source: System 

    at System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request) 

    at System.Net.WebClient.DownloadData(Uri address) 

    at System.Net.WebClient.DownloadData(String address) 

    at Sitecore.Web.WebUtil.ExecuteWebPage(String url, NameValueCollection headers) 

    at Sitecore.Web.WebUtil.ExecuteWebPage(String url) 

    at Sitecore.Tasks.UrlAgent.Run() 

回答

2

可以在web.config指定的keepalive任務配置服務器的URL:

<agent type="Sitecore.Tasks.UrlAgent" method="Run" interval="00:15:00"> 
    <param desc="url">http://YOUR_VALID_HOSTNAME/sitecore/service/keepalive.aspx</param> 
    <LogActivity>true</LogActivity> 
    </agent> 
+0

應用建議的更改,我們看到不同的錯誤。請參閱上面的更新。 –

1

您可以使用相對URL,而不是絕對的。例如:

<param desc="url">/sitecore/service/keepalive.aspx</param> 

如果您使用的是帶有Azure的Web應用程序的靜態/動態IP的限制,不要忘了內部的Azure的IP地址添加到<ipSecurity />部分。

<security> 
    <ipSecurity allowUnlisted="false"> 
    <clear/> 
    <add ipAddress="0.0.0.0" allowed="true"/> 
    ... 
    </ipSecurity> 
</security>