2009年3月30日星期一

bma.bricks.module.servlet.ModuleServlet' is not a known servlet

[17:01:23.657] WebApp[http://localhost:8080]
stopping[17:01:23.697] WEB-INF/web.xml:3:
'bma.bricks.module.servlet.ModuleServlet' is not
a known servlet. Servlets belong in the
classpath, often in WEB-INF/classes.[17:01:26.151] WebApp[http://localhost:8080]
stopping[17:01:26.190] WEB-INF/web.xml:3:
'bma.bricks.module.servlet.ModuleServlet' is not
a known servlet. Servlets belong in the
classpath, often in WEB-INF/classes.[17:01:31.461] WebApp[http://localhost:8080]
stopping[17:01:31.501] WEB-INF/web.xml:3:
'bma.bricks.module.servlet.ModuleServlet' is not
a known servlet. Servlets belong in the
classpath, often in WEB-INF/classes.[17:01:34.037] WebApp[http://localhost:8080]
stopping[17:01:34.073] WEB-INF/web.xml:3:
'bma.bricks.module.servlet.ModuleServlet' is not
a known servlet. Servlets belong in the
classpath, often in WEB-INF/classes.
这个故障的原因是没有配置resin服务安装目录下的
conf/default-app.xml文件。找到 optional="true"/>把该行的代码修改为optional="true"/>optional="true"/>optional="true"/>optional="true"/>注意:以上代码必须按照上述顺序配置

2009年3月20日星期五

Got a packet bigger than max_allowed_packet

昨天用导入数据的时候发现有的地方有这个错误。后来才发现我用RPM包装的MYSQL配置文件里面有old_passwords=1去掉就可以了
Got a packet bigger than ‘max_allowed_packet’ bytes or ERROR 1153 (08S01) at line 616: Got a packet bigger than ‘max_allowed_packet’ by tes...
昨天用导入数据的时候发现有的地方有这个错误。
后来才发现我用RPM包装的MYSQL配置文件里面有old_passwords=1去掉就可以了。
还有加了max_allowed_packet=500M这样就不会出错了。
PS:建议在5.0后的版本中关掉old_passwords选项。
如果你不知道你的OLD_PASSWORDS是不是开启了,可以用命令。
show VARIABLES like '%old_passwords%';
query result(1 records)
Variable_name Valueold_passwords OFF

2009年3月19日星期四

samba挂载错误两例解决

在linuxAS4挂载windows的共享目录时(mount -o username=guestego,password=******** //192.168.15.183/360 /mnt),出现以下错误提示:mount: wrong fs type, bad option, bad superblock on //192.168.15.183/360, or too many mounted file systems在mount命令中加入-t smbfs也报同样的错误,后来,加入-t cifs后没有报错,挂载成功!
#mount -t smbfs -o username=guest,passwd=,//192.168.0.21/public/mp3 /mnt/music出错,提示smbfs: mount_data version 1919251317 is not supported解决办法:可能是没有安装samba-client和samba-common的原因,安装这两个包,问题解决!

迁移jsp程序过程出错:bma.bricks.lang.AssertException: Cache[ipLimitCache] create fail

迁移jsp程序过程中出错:bma.bricks.lang.AssertException: Cache[ipLimitCache] create fail at bma.bricks.lang.ExceptionUtil.assertException(ExceptionUtil.java:21) at bma.bricks.cache.CacheManager.createCache(CacheManager.java:93) at bma.bricks.cache.CacheManager.createCache(CacheManager.java:69) at bma.bricks.iplimit.core.IpLimitCoreDomain.configPhaseControl(IpLimitCoreDomain.java:30) at bma.bricks.module.common.PhaseModuleController.phaseControl(PhaseModuleController.java:31) at bma.bricks.module.ModuleManager.processModulePhase(ModuleManager.java:719) at bma.bricks.module.ModuleManager.start(ModuleManager.java:604) at bma.bricks.module.ModuleManager.start(ModuleManager.java:577) at bma.bricks.module.servlet.ModuleServlet.init(ModuleServlet.java:75) at javax.servlet.GenericServlet403.init(GenericServlet.java:70)
同时迁移过去的有两个站点,另外一个站点可以正常运行,加上服务器原有的二个站点,都可以正常运行,除了新评论系统以外.访问这个站点时,显示403错误,开始的时候怀疑是目录权限问题,修改了目录权限,还是不行.检查配置,mm-config.xml 里面关于IpLimitCoreDomain的配置: {type:'lru',size:20}
请教开发人员,发现这原来是程序的一个"跟文件在操作系统的存储顺序有关系"的bug造成的,更新了程序目录里WEB-INF/lib的project_comments.jar的包,重新启动resin,故障解决!
更新的内容CREATE TABLE game_platform_model_ref( id int not null auto_increment, platform_id int not null, model_id int not null, primary key(id))ENGINE=InnoDB DEFAULT CHARSET=utf8;
create INDEX game_platform_model_ref_i1 ON game_platform_model_ref(platform_id);
CREATE TABLE game_platform_model_ref( id int not null auto_increment, platform_id int not null, model_id int not null, primary key(id))ENGINE=InnoDB DEFAULT CHARSET=utf8;
create INDEX game_platform_model_ref_i1 ON game_platform_model_ref(platform_id);

2009年3月1日星期日

Linux下NFS配置注意的问题

启动服务portmap,nfs#/etc/rc.d/init.d/portmap start (or:#service portmap start) #/etc/rc.d/init.d/nfs start (or:#service nfs start) 可以到/var/log/messages里面查看是否正确激活9.exportfs的用法 如果我们修改了/etc/exports后,并不需要重启nfs服务,只要用exportfs重新扫描一次/etc/exports,并且重新加载即可 语法: exportfs [-aruv] -a: 全部挂载(或卸载) /etc/exports档案内的设定 -r: 重新挂载/etc/exports里面的设定,也同步的更新/etc/exports和/var/lib/nfs/xtab里面的内容 -u:卸载某一目录 -v:在export的时候,将分享的目录显示到荧屏上. 例子 #exportfs -rv //重新export一次 #exportfs -au //全部卸载
10./var/lib/nfs/xtab里面可以查看每个目录的分享权限(但是我怎么也没有找到,靠,找到了,原来要有人mount上nfs后才会出现内容),如:/tmp node3(ro,sync,wdelay,hide,secure,root_squash,no_all_squash,subtree_check,secure_locks,mapping=identity,anonuid=-2,anongid=-2) 为什么anonuid=-2呢?呵呵!其实它说的是将 65536 - 2 的值,也就是 65534 的那个 UID 啦!对照一下 /etc/passwd ,你就会发现,哇!原来那就是 nobody 的啦
11.showmount命令 语法: showmount [-ae] hostname -a: 显示目前主机与client所连上来的使用目录的状态 -e: 显示hostname的/etc/exports里面共享的目录
12.查看激活的portnumber #netstat -utln nfs 自己所开启的 port ,就是那个 2049 的 port 啦!就是 NFS 主要产生的 port NFS server 在前面我们就提过了,他是 RPC server 的一种,而 NFS 由于提供了多个 program ( 例如 rpc.mountd, rpc.rquotad, rpc.nfsd... ) ,因此就需要激活多个 port 了!而且这些 port 是『随机产生的』,也就是那个 port number 不会是固定的啦!每次 restart nfs 都会得到不一样的 port number 呢!那么 Client 端怎么知道要连接上那个 port 来呼叫需要的 program 呢?呵呵!那就是 sunrpc ( port 111 ) 那个 portmap 服务所产生的 port number 的功用啦!Client 会先连接到 sunrpc 那个 port 去知道应该到那个 port 去呼叫所需要的程序!所以啰, rpc.xxxx 等之类的 daemon 自然就不需要有固定的 port number 啰!
***********************************************NFS客户端的设定 #mount -t nfs hostname(orIP):/directory /mountpoint 搞定,就这么简单 为了担心会不小心将 NFS 端挂进来的具有 SUID 权限档案的程序执行,root可以将NFS 所分享的目录以较为安全的情况挂载进来,可以 #mount -t nfs -o nosuid,ro hostname:/directory /mountponit
可能出问题的地方:1.权限的设定不符合2.忘记了激活portmap,此时会报错: mount: RPC: Port mapper failure - RPC: Unable to receive 或者 mount: RPC: Program not registered 那么,启动portmap,并且重新启动nfs #service portmap start #service nfs restart3.被防火墙搞掉 重新设置防火墙,包括iptables与TCP_Wrappers,因为激活了portmap,所以port 111必须提供出去.因此在iptables rules中,要增加: iptables -A INPUT -p TCP --dport 111 -j ACCEPT iptables -A INPUT -p UDP --dport 111 -j ACCEPT 如果还不行,那就是TCP_Wrappers的问题,检查/etc/hosts.deny,如果有一行是: ALL: ALL: deny 那就必须在/etc/hosts.allow中增加: portmap: ALL: allow 如果我们的NFS针对内部网络开发,对于外部网络只对学术网络开发(140.0.0.0/8),可以: iptables -A INPUT -i eth0 -p TCP -s 192.168.0.0/24 --dport 111 -j ACCEPT iptables -A INPUT -i eth0 -p UDP -s 192.168.0.0/24 --dport 111 -j ACCEPT iptables -A INPUT -i eth0 -p TCP -s 140.0.0.0/8 --dport 111 -j ACCEPT iptables -A INPUT -i eth0 -p UDP -s 140.0.0.0/8 --dport 111 -j ACCEPT 还可以使用TCP_Wrappers,在/etc/hosts.allow里面规定连上 NFS 主机的主机 IP 与名称,例如 #vi /.etc/hosts.allow portmap: 192.168.0.0/255.255.255.0 :allow portmap: 140.113.23.23 :allow portmap: .sdu.edu.cn :allow RPC Server的相关命令 rpcinfo #rpcinfo -p hostname(orIP) 要注意的问题: 需要注意的是,由于 NFS 使用的这个 RPC 在 client 端连上主机时,那么你的主机想要关机,那可就会成为『不可能的任务』!我还不知道正确的原因是什么,但是,如果你的 Server 上面还有 Client 在联机,那么你要关机,可能得要等到数个钟头才能够正常的关机成功!嗄!真的假的!不相信吗?不然您自个儿试试看! ^_^!所以啰,建议您的 NFS Server 想要关机之前,能更先『关掉 portmap 与 nfs 』这两个东西!如果无法正确的将这两个 daemons 关掉,那么先以 netstat -utlp 找出 PID ,然后以 kill 将他关掉先!这样才有办法正常的关机成功喔!这个请特别特别的注意呢! 在TurboLinux8.0 for AMD64 (kernel 2.4.21-4smp),mount NFS时候报错为: portmap: server localhost not responding, timed out 解决办法: mount -t nfs -o nolock node1:/public /public 即增加-o nolock参数,原因: Unfsd doesn't support NLM locking, and it's causing the lockd daemon to be started (which again requires the portmapper to be installed etc.)

2008年7月23日星期三

Call to undefined function get_magic_quotes_gpc() 错误解决

在调试程序时,出现错误信息
Fatal error: Call to undefined function get_magic_quotes_gpc() in C:\AppServ\www\admin\global.inc.php on line 19
将C:\AppServ\www\admin\global.inc.php on line 19: { $magic_quotes_gpc = get_magic_quotes_gpc()修改为:if(function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc());

如何关闭win2003的关闭事件跟踪程序 

推荐Windows Server 2003 和 Windows XP 64-Bit Edition 版本 2003 默认情况下,所有 Windows Server 2003 操作系统和 Windows XP 64-Bit Edition 版本 2003 都会启用“关闭事件跟踪程序”。 要禁用所有 Windows Server 2003 操作系统和 Windows XP 64-Bit Edition 版本 2003 中的“关闭事件跟踪程序”,请使用组策略禁用“显示‘关闭事件跟踪程序’”策略。要使用本地组策略实现此目的,请按照下列步骤操作: 1. 单击“开始”,然后单击“运行”。 2. 键入 gpedit.msc,然后单击“确定”。 3. 依次展开“计算机配置”、“管理模板”和“系统”。 4. 双击“显示‘关闭事件跟踪程序’”。 5. 单击“已禁用”,然后单击“确定”。