Rootop 服务器运维与web架构

2011-03-23
发表者 Venus
暂无评论

编译php configure:error:cannot find output from lex,give up

configure时出现以下错误:
configure:error:cannot find output from lex,give up

此错误是说 缺少flex.rpm,从光盘中找到flex-%.i386.rpm,安装,重新编译php,

本人的解决办法:

configure: error: no acceptable cc found in $PATH

yum -y install gcc-c++

configure: error: cannot find output from lex; giving up flex is not installed, install flex.

yum -y install flex

configure: error: xml2-config not found. Please check your libxml2 installation.

yum -y install libxml2-devel

configure: error: Cannot find OpenSSL’s

yum -y install openssl-devel

configure: error: Please reinstall the BZip2 distribution

yum -y install bzip2-devel

configure: error: Please reinstall the libcurl distribution – easy.h should be in /include/curl/

yum -y install curl-devel

configure: error: libjpeg.(a|so) not found.

yum -y install libjpeg-devel

configure: error: libpng.(a|so) not found.

yum -y install libpng-devel

configure: error: freetype2 not found!

yum -y install freetype-devel

configure: error: Unable to locate gmp.h

yum -y install gmp-devel

configure: error: Cannot find pspell

yum -y install aspell-devel

缺哪一个,运行哪一行命令,装上后重新编辑php即可

2011-03-21
发表者 Venus
暂无评论

修改 mysql数据库root密码的安全方法

# mysql -u root -p    //默认无密码,登陆数据库

# mysql> use mysql;     //使用mysql数据库
#
# mysql> update user set password=PASSWORD(‘newpassword’) where user=’root’;

//更新密码
#
# mysql> flush privileges;    //刷新MySQL系统权限的相关表  也可以理解为刷新缓存
#
# mysql> exit

看见 行匹配 和更改为3说明成功。

之前用的mysqladmin方式更改密码的缺点是:

仅能更改一行记录。这样会导致 root用户在 mysql 表里的3行(localhost {HOSTNAME} 127.0.0.1)记录有不同的密码,会对以后使用root用户操作带来隐患。

2011-03-21
发表者 Venus
暂无评论

child process * still did not exit, sending a SIGTERM

有位同学的apache基本一天挂一次,重启httpd服务后正常。检查日志发现一个错误并且是经常性出现:child process * still did not exit, sending a SIGTERM

猜测问题应该出现在子进程中的MaxRequestsPerChild部分,检查他的工作方式:apachectl -l

是prefork模式,然后检查他的配置文件,发现MaxRequestsPerChild部分参数为0,想到有可能是内存泄露了。

对于他这个问题,继续跟进。淡定···

将MaxRequestsPerChild设置成非零值有两个好处:

可以防止(偶然的)内存泄漏无限进行,从而耗尽内存。
给进程一个有限寿命,从而有助于当服务器负载减轻的时候减少活动进程的数量。

今天问题算是解决了:

发现日志说,写入访问日志或者是错误日志意外失败。

df -h 一看/var/logs 使用率已经100%了。那么再次检查httpd.conf文件,确定服务器上挂载的20多个站日志位置都位于此路径下,导致日志无法写入而系统崩溃。

通知它删减日志,运行看看。继续跟进···

过了好几天了,没听见他再反应服务器崩溃,那么可以确定,问题解决了。

2011-03-18
发表者 Venus
暂无评论

configure: error: *** libmcrypt was not found

为了的到mcrypt.so库文件,先后安装编译了mhash和libmcrypt,但是到最后编译mcrypt时报错:

configure: error: *** libmcrypt was not found

最后发现是因为环境变量的问题,gcc编译的时候根据自身定义的变量寻找相关函数库等文件,libmcrypt也是刚安装的,在变量中没有定义出来,所以手动添加:

[root@localhost modules]# export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

再次编译即可。

或者执行一下ldconfig貌似也可以。