添加到的machineKey在web.config中网络的场址 [英] Adding machineKey to web.config on web-farm sites

查看:1203
本文介绍了添加到的machineKey在web.config中网络的场址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们(从IT合作伙伴真的)最近改变了一些DNS的web站点养殖,我们有这么两个生产服务器有两间循环DNS切换。在此之前,开关我们并没有真正与 WebResource.axd的文件的问题。由于开关,当我们打的现场公开的网址,我们得到一个错误:


  

CryptographicException


  
  

填充是无效的,不能删除。


当我们打的特定服务器本身,它们加载的罚款。我研究这个问题,似乎因为他们是两个服务器之间共享的资产,我们需要有一个一致的的machineKey 的web.config 每个服务器,这样他们可以加密和两者一致解密。我的问题是:


  1. 我可以生成一个的machineKey 通过在服务器上的一个工具,或者我需要写code做到这一点?

  2. 请我只需要添加的machineKey 的web.config 每台服务器上或者你认为我会需要做别的使两个服务器协同工作? (这两个的web.config 的目前还没有一个的machineKey


解决方案

这应该回答:

<一个href=\"http://msdn.microsoft.com/en-us/library/ff649308.aspx#paght000007_webfarmdeploymentconsiderations\">http://msdn.microsoft.com/en-us/library/ff649308.aspx#paght000007_webfarmdeploymentconsiderations

总之,要设置机器键参考以下链接
<一href=\"http://docs.orchardproject.net/Documentation/Setting-up-a-machine-key\">http://docs.orchardproject.net/Documentation/Setting-up-a-machine-key

和以下行添加到Web.config文件中的所有Web服务器下的System.Web标签,如果它不存在。

 &LT;的machineKey
的validationKey =21F090935F6E49C2C797F69BBAAD8402ABD2EE0B667A8B44EA7DD4374267A75D7
               AD972A119482D15A4127461DB1DC347C1A63AE5F1CCFA​​ACFF1B72A7F0A281B
decryptionKey =ABAA84D7EC4BB56D75D217CECFFB9628809BDB8BF91CFCD64568A145BE59719F
验证=SHA1
解密=AES
/&GT;

请确保您有本机键和web.config文件的永久备份

We (out IT partner really) recently changed some DNS for a web farmed site we have so that the two production server have round-robin DNS switching between the two. Prior to this switch we didn't really have problems with WebResource.axd files. Since the switch, when we hit the live public URL, we get an error:

CryptographicException

Padding is invalid and cannot be removed.

When we hit the specific servers themselves, they load fine. I've researched the issue and it seems since they're sharing assets between two servers, we need to have a consistent machineKey in the web.config for each server so they can encrypt and decrypt consistently between the two. My questions are:

  1. Can I generate a machineKey via a tool on the server, or do I need to write code to do this?
  2. Do I just need to add the machineKey to the web.config on each server or do you think I'll need to do anything else to make the two server work together? (Both web.config's currently do not have a machineKey)

解决方案

This should answer:

http://msdn.microsoft.com/en-us/library/ff649308.aspx#paght000007_webfarmdeploymentconsiderations

In short, to set up the machine key refer the following link http://docs.orchardproject.net/Documentation/Setting-up-a-machine-key

and add the following line to the web.config file in all the webservers under system.web tag if it does not exist.

<machineKey  
validationKey="21F090935F6E49C2C797F69BBAAD8402ABD2EE0B667A8B44EA7DD4374267A75D7
               AD972A119482D15A4127461DB1DC347C1A63AE5F1CCFAACFF1B72A7F0A281B"           
decryptionKey="ABAA84D7EC4BB56D75D217CECFFB9628809BDB8BF91CFCD64568A145BE59719F"
validation="SHA1"
decryption="AES"
/>

Please make sure that you have a permanent backup of the machine keys and web.config file

这篇关于添加到的machineKey在web.config中网络的场址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆