posted @ 2010-09-12 12:03 ZhangPeng.Chen 阅读(292) 评论(1) 编辑
posted @ 2010-06-24 14:34 ZhangPeng.Chen 阅读(20) 评论(0) 编辑
Machine Name: S20129
Request URL: http://www.site1.com/page1|||RequestType:GET|||UserHostAddress:...|||UrlReferrer:
Error Message:
Error Source: System.Web Error
StackTrace:
at System.Web.CachedPathData.GetConfigPathData(String configPath)
at System.Web.CachedPathData.GetVirtualPathData(VirtualPath virtualPath, Boolean permitPathsOutsideApp)
at System.Web.HttpContext.GetFilePathData() at System.Web.HttpContext.GetConfigurationPathData()
at System.Web.Configuration.RuntimeConfig.GetConfig(HttpContext context)
at System.Web.HttpContext.get_ImpersonationToken()
at System.Web.ClientImpersonationContext.Start(HttpContext context, Boolean throwOnError)
at System.Web.HttpApplication.ThreadContext.SetImpersonationContext()
at System.Web.HttpApplication.ThreadContext.Enter(Boolean setImpersonationContext)
at System.Web.HttpApplication.OnThreadEnterPrivate(Boolean setImpersonationContext)
at System.Web.HttpApplication.ApplicationStepManager.ResumeSteps(Exception error) ========================================
还原错误http://www.site1.com/page1.
以dot结尾会出现以上错误
posted @ 2011-02-23 15:55 ZhangPeng.Chen 阅读(41) 评论(0) 编辑
Machine Name: ...
Request URL: http://www.site1.com/page1|||RequestType:GET|||UserHostAddress:...|||UrlReferrer:
Error Message:
Error Source: System.Web
Error StackTrace:
at System.Web.Util.FileUtil.CheckSuspiciousPhysicalPath(String physicalPath)
at System.Web.HttpContext.ValidatePath()
at System.Web.HttpApplication.ValidatePathExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) ========================================
今天查看Live上的Log文件,看看有哪些异常。
看到如下这个错误,异常发生在System.Web.Util.FileUtil.CheckSuspiciousPhysicalPath(String physicalPath)
System.Web.dll中有如下代码{
if (((physicalPath != null) && (physicalPath.Length > 0))
&& (Path.GetFullPath(physicalPath) != physicalPath))
{
throw new HttpException(0x194, "");
}
}
还原异常
http://www.site1.com/page1%20posted @ 2011-02-23 15:16 ZhangPeng.Chen 阅读(53) 评论(0) 编辑
posted @ 2011-01-05 09:27 ZhangPeng.Chen 阅读(143) 评论(0) 编辑
@echo On @Rem 删除SVN版本控制目录 @PROMPT [Com]
@for /r . %%a in (.) do @if exist "%%a\.svn" rd /s /q "%%a\.svn"
@Rem for /r . %%a in (.) do @if exist "%%a\.svn"
@echo "%%a\.svn"
@echo Mission Completed. @pause
posted @ 2010-10-13 21:09 ZhangPeng.Chen 阅读(96) 评论(0) 编辑
负载均衡
通常面对高并发与大数据量都会使用负载均衡,使用多台服务器来共同承担压力。
接着许许多多的问题就来了。
Http Request => (Server1, Server2, Server3)
1. 服务器数据同步
1.1 数据库同步
通常只会用一个数据库服务器,所以数据库同步,不用额外处理。
1.2 文件同步
比如管理员登录后台,添加了一张图片,管理员的请求被均衡到Server1,那么这张图片会被保存在Server1,那么我们需要同步到Server2,Server3。
可以使用软件监测某些目录来达到同步的目的,比如更新部署也是一样,每台服务器分别更新是相当麻烦,而且还要测试每台服务器是否一致,所以我们需要
可以同步的工具。
1.3 Session
无法使用会话,因为会话会容易丢失,比如你的请求在Server1上,保存到Session中,你的下一个请求可能在Server2,就丢失了。
不过Session有一些选项可以指定是否持久化,可以保存到数据库中等等。
1.4 验证票
配置machine key之类的,保证多台服务器生成的验证票之类的是一致的。
1.5 静态变量要小心
现在是每台服务器都有一份。
1.6 缓存
一定要保证多台服务器间缓存数据的一致性和同步性,使用Memcache
2. 压力测试
posted @ 2010-09-12 12:03 ZhangPeng.Chen 阅读(292) 评论(1) 编辑
Web.config中使用如下配置
<system.net>
<mailSettings>
<smtp from="info@site.com">
<network host="localhost" port="25" />
</smtp>
</mailSettings>
</system.net>
使用localhost直接发送邮件。
在服务器上部署遇到异常:Mailbox unavailable. The server response was: 5.7.1 Unable to relay for info@site.com
需要配置IIS6 Manager的SMTP server
1. Open IIS6 Manager using Control Panel => Administrative Tools.
2. Open SMTP Virtual Server properties.
3. On General tab, Set IP address of the Web server instead of "All Unassigned".
4. In Access tab, click on Relay button, this will open Relay Restrictions dialog.
5. In relay computers list, add the ip addres 127.0.0.1.
posted @ 2010-08-18 16:31 ZhangPeng.Chen 阅读(722) 评论(0) 编辑
场景:
一个dialog插件
dialog.show(url)
1. 显示loading
2. 使用iframe加载url
3. iframe加载完成,自动调整iframe的高度
4. 显示dialog,隐藏loading
第3步,自动调整iframe高度,我们可以使用$iframe.contents().find("body").height()获取iframe中内容的高度。
不过由于dialog还没被显示出来,所以获取的高度始终是0,这样我们就没办法自动调整iframe的高度。
解决方案:
隐藏的时候使用visibility: hidden; display: block; 替换 display: none; 这样我们就可以获取到高度了。
显示的时候使用visibility: block;
posted @ 2010-08-18 16:26 ZhangPeng.Chen 阅读(51) 评论(0) 编辑
posted @ 2010-07-30 15:11 ZhangPeng.Chen 阅读(482) 评论(0) 编辑
posted @ 2010-07-28 17:44 ZhangPeng.Chen 阅读(214) 评论(1) 编辑
