2015-12-21 71 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>