Rootop 服务器运维与web架构

2011-10-12
发表者 Venus
暂无评论

Could not load file or assembly ‘System.Data.SQLite’ or one of its dependencies. 试图加载格式不正确的程序。

 

Server Error in ‘/’ Application.


Could not load file or assembly ‘System.Data.SQLite’ or one of its dependencies. 试图加载格式不正确的程序。

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.BadImageFormatException: Could not load file or assembly ‘System.Data.SQLite’ or one of its dependencies. 试图加载格式不正确的程序。

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Assembly Load Trace: The following information can be helpful to determine why the assembly ‘System.Data.SQLite’ could not be loaded.

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

 

Stack Trace:

[BadImageFormatException: Could not load file or assembly 'System.Data.SQLite' or one of its dependencies. 试图加载格式不正确的程序。]
   System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
   System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks) +567
   System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +192
   System.Reflection.Assembly.Load(String assemblyString) +35
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +123

[ConfigurationErrorsException: Could not load file or assembly 'System.Data.SQLite' or one of its dependencies. 试图加载格式不正确的程序。]
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +11479520
   System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +484
   System.Web.Configuration.AssemblyInfo.get_AssemblyInternal() +79
   System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +334
   System.Web.Compilation.BuildManager.CallPreStartInitMethods() +280
   System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +1087

[HttpException (0x80004005): Could not load file or assembly 'System.Data.SQLite' or one of its dependencies. 试图加载格式不正确的程序。]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11612256
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +141
   System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +11443374

 


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1

       出现此问题的原因是System.Data.SQLite.dll 的版本问题,开发环境为x86环境,System.Data.SQLite.dll控件默认为32位,服务器为64位系统,导致兼容性出现问题,无法加载dll文件。

       解决方法:

      在网站应用程序池中,点击“高级设置”-“启用32位应用程序”或者使用64位System.Data.SQLite.dll。

参考资料:

System.Data.SQLite.dll is a mixed assembly, i.e. it contains both managed code and native code. Therefore a particular System.Data.SQLite.dll is either x86 or x64, but never both.

Update (courtesy J. Pablo Fernandez): Cassini, the development web server used by Visual Studio when you press F5 or click the green «play» button, is x86 only which means that even if your workstation is x64, you’ll only be able to use the x86 version of System.Data.SQLite.dll.

An alternative is not to use Cassini but IIS7 which is properly x64.

 

2011-10-11
发表者 Venus
暂无评论

关闭redhat6.1系统启动进度条,显示服务启动信息

     修改grub.conf配置文件: 

[root@localhost ~]# vi /boot/grub/grub.conf

      找到下面的配置部分,将”rhgb”去掉,保存即可。

      “rhgb”表示”redhat graphical boot”,红帽图形引导。”quiet”表示不在启动时显示内核信息,默认启用该参数,但是许多管理员都选择删除它,以便看到可靠的内核信息流。

kernel /vmlinuz-2.6.32-71.el6.i686 ro root=UUID=697cb0d9-19f6-414a-90a1-5ceb2f40b03d rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=zh_CN.UTF-8 KEYBOARDTYPE=pc KEYTABLE=us crashkernel=auto rhgb quiet

2011-10-10
发表者 Venus
暂无评论

emos1.5登陆extman系统信息错误 no such file or directory

      邮件服务器为 emos1.5 登陆extman 后台时显示 系统信息 错误 no such file or directory

解决方法:

[root@emos cgi]# ps aux | grep cmdserver
root      2651  0.0  0.0   8284  3576 ?        Ss   Aug30   0:00 /usr/bin/perl
root     20302  0.0  0.0   3920   688 pts/0    S+   16:09   0:00 grep cmdserver
[root@emos cgi]# kill -9 2651
[root@emos cgi]# ps aux | grep cmdserver
root     20304  0.0  0.0   3916   676 pts/0    S+   16:09   0:00 grep cmdserver
[root@emos cgi]# /var/www/extsuite/extman/daemon/cmdserver -v -d
loaded ok

杀掉cmdserver进程,重启即可。

2011-10-10
发表者 Venus
暂无评论

Linux服务器安全—细节积累_BY_NQ

在内核空间中拒绝icmp包(ping包)

echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all    1为打开0为关闭(默认为0)

上面为临时性方法,永久生效用下面方法,编辑/etc/sysctl.conf ,添加:

net.ipv4.icmp_echo_ignore_all = 1

保存退出,执行 sysctl -p 生效。

修改ping时返回的TTL值

echo 128 >  /proc/sys/net/ipv4/ip_default_ttl    128为windowsTTL值,linux默认为64

也是临时性方法,可以设置为开机执行一遍,将命令添加到 /etc/rc.local

打开路由转发临时性方法

echo 1 > /proc/sys/net/ipv4/ip_forward    1为打开0为关闭 (默认为0)

永久性,配置 sysctl.conf ,添加:

net.ipv4.ip_forward = 0

保存。

2011-10-10
发表者 Venus
暂无评论

修复被劫持的IE主页

      浏览器不小心被恶意软件修改了主页,一打开浏览器就跳到主页中定义的地址。

     定为到注册表 HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\MAIN 找到数值名称为“Start Page”部分也没发现有异常,使用360修复浏览器也没效果,最后在注册表中,通过ctrl+f 调出 查找 被修改的主页 域名 为关键字进行搜索,找到后,删除,重启生效。