eygle.com   eygle.com
eygle.com  
 

« November 14, 2006 | Blog首页 | November 16, 2006 »



November 15, 2006

MT归档分页插件(Paged Archives)几个问题的解决

作者:eygle

出处:http://blog.eygle.com

九月的时候,dcba曾经向我推荐过一个MT的归档分页插件Paged Archives,当我们某个分类的文档越来越多,单一页面显示显然不再适合,我之前将分类通过只显示标题进行处理,而利用这个插件则可以实现分页,效果很不错,我现在的按月归档使用了这一插件。

不过昨天这一插件出现了一个问题,在作者的网站上发现有很多人遇到,主要症状就是链接显示错误,错误链接类似如下格式显示:

http://localhost/mt//opt/apache/mt/2.html

我猜测是程序中路径处理部分存在Bug,检查了半天也没有发现,问了DCBA他也没有发现问题,而他使用是正常的;最后考虑可能是版本的问题,将这个插件降低到版本1.1,问题解决。

这个插件的另外一个问题是,在apache日志中经常可以发现如下错误:
"my" variable $filepath masks earlier declaration in same scope at ..../pagedarchives.pl line 222

这是一个常见的错误,暂时的解决方案是将222行的:
my $filepath="$path/$pagebasename$ii$ext";
修改为:
$filepath="$path/$pagebasename$ii$ext";

即可。

这是一个不错的插件,希望作者能够尽快修正这一Bug。

-The End-

Posted by eygle at 4:18 PM | Comments (5)


Linux下sshd启动失败问题解决一例

作者:eygle

出处:http://blog.eygle.com

今天一台Redhat Linux AS4出了问题,ssh无法连接。

检查日志(/var/log/secure 文件)发现如下错误提示:

sshd[3862]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use.
sshd[3862]: fatal: Cannot bind any address.
sshd[3879]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use.
sshd[3879]: fatal: Cannot bind any address.

提示显示端口22被占用,绑定失败。

网上可以找到类似的案例,一般的解释是ipv4与ipv6启动冲突。
在 /etc/ssh/sshd_config 文件中存在以下设置:

ListenAddress 0.0.0.0 ListenAddress ::

其中0.0.0.0是ipv4的地址,::是IPv6的表示,如果IPv4地址绑定22端口,则后续绑定会失败,通常的建议是如果不使用IPv6,则可以注释后面一行。

可是我们的问题还没有这么简单,因为缺省的,以上两行配置已经被注释。

检查系统开放的端口及服务:

[root@cmjp1 ~]# nmap -sT -O localhost

Starting nmap 3.70 ( http://www.insecure.org/nmap/ ) at 2006-11-15 14:00 CST
Insufficient responses for TCP sequencing (3), OS detection may be less accurate
Interesting ports on cmjp1.hurray.com.cn (127.0.0.1):
(The 1655 ports scanned but not shown below are in state: closed)
PORT STATE SERVICE
22/tcp open ssh
25/tcp open smtp
111/tcp open rpcbind
631/tcp open ipp
873/tcp open rsync
Device type: general purpose
Running: Linux 2.4.X|2.5.X|2.6.X
OS details: Linux 2.4.0 - 2.5.20, Gentoo 1.2 linux (Kernel 2.4.19-gentoo-rc5), Linux 2.4.20,
Linux 2.4.20 - 2.4.22 w/grsecurity.org patch, Linux 2.5.25 - 2.6.3 or Gentoo 1.2
Linux 2.4.19 rc1-rc7)
Uptime 0.089 days (since Wed Nov 15 11:52:15 2006)

Nmap run completed -- 1 IP address (1 host up) scanned in 2.199 seconds

可以发现22端口已经启动,但是客户端是无法通过ssh协议连接的。

同时在系统中观察到另外的一个现象是,即使通过ssh作为客户端访问远程主机也不能连接:

[root@cmjp ~]# ssh root@172.16.33.130
The authenticity of host '172.16.33.130 (172.16.33.130)' can't be established.
RSA key fingerprint is 20:7c:8e:15:19:f7:e7:0c:5d:ce:6f:1c:c6:de:f2:0b.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '172.16.33.130' (RSA) to the list of known hosts.
root@172.16.33.130's password:
Segmentation fault

Segmentation fault多半说明应用程序存在问题,导致指针访问错误,通过重新安装sshd程序,最终解决了该问题。

-The End-

Posted by eygle at 1:49 PM | Comments (2)



CopyRight © 2004-2008 eygle.com, All rights reserved.