Archive by Author

安装Google perftools出现错误

刚刚在64位的centos系统安装Google perftools时,出现下面错误

error Cannot calculate stack trace: need either libunwind or frame-pointers

解决方法是在编译参数里增加

--enable-frame-pointers
Filed in: Linux
1

centos下添加多个IP地址的方法

操作如下,登陆SSH:

vi /etc/syscionfig/network-scripts/ifcfg-eth0:0

第二个IP,就是

vi /etc/syscionfig/network-scripts/ifcfg-eth0:1

第三个IP,就是
ifcfg-eth0:2(由此类推)
Read more...

Filed in: Linux
0

Centos 5.6 yum 安装 openssl 出错

Centos 5.6连这样的错误都有!!!!

Transaction Check Error:
package openssl-0.9.8e-12.el5_5.7.i686 is already installed
file /lib/.libcrypto.so.0.9.8e.hmac from install of openssl-0.9.8e-12.el5_5.7.i686 conflicts with file from package openssl-0.9.8e-12.el5_5.7.i386
file /lib/.libssl.so.0.9.8e.hmac from install of openssl-0.9.8e-12.el5_5.7.i686 conflicts with file from package openssl-0.9.8e-12.el5_5.7.i386
file /lib/libcrypto.so.0.9.8e from install of openssl-0.9.8e-12.el5_5.7.i686 conflicts with file from package openssl-0.9.8e-12.el5_5.7.i386
file /lib/libssl.so.0.9.8e from install of openssl-0.9.8e-12.el5_5.7.i686 conflicts with file from package openssl-0.9.8e-12.el5_5.7.i386
file /usr/bin/openssl from install of openssl-0.9.8e-12.el5_5.7.i686 conflicts with file from package openssl-0.9.8e-12.el5_5.7.i386
file /usr/lib/openssl/engines/lib4758cca.so from install of openssl-0.9.8e-12.el5_5.7.i686 conflicts with file from package openssl-0.9.8e-12.el5_5.7.i386
file /usr/lib/openssl/engines/libaep.so from install of openssl-0.9.8e-12.el5_5.7.i686 conflicts with file from package openssl-0.9.8e-12.el5_5.7.i386
file /usr/lib/openssl/engines/libatalla.so from install of openssl-0.9.8e-12.el5_5.7.i686 conflicts with file from package openssl-0.9.8e-12.el5_5.7.i386
file /usr/lib/openssl/engines/libchil.so from install of openssl-0.9.8e-12.el5_5.7.i686 conflicts with file from package openssl-0.9.8e-12.el5_5.7.i386
file /usr/lib/openssl/engines/libcswift.so from install of openssl-0.9.8e-12.el5_5.7.i686 conflicts with file from package openssl-0.9.8e-12.el5_5.7.i386
file /usr/lib/openssl/engines/libgmp.so from install of openssl-0.9.8e-12.el5_5.7.i686 conflicts with file from package openssl-0.9.8e-12.el5_5.7.i386
file /usr/lib/openssl/engines/libnuron.so from install of openssl-0.9.8e-12.el5_5.7.i686 conflicts with file from package openssl-0.9.8e-12.el5_5.7.i386
file /usr/lib/openssl/engines/libsureware.so from install of openssl-0.9.8e-12.el5_5.7.i686 conflicts with file from package openssl-0.9.8e-12.el5_5.7.i386
file /usr/lib/openssl/engines/libubsec.so from install of openssl-0.9.8e-12.el5_5.7.i686 conflicts with file from package openssl-0.9.8e-12.el5_5.7.i386

解决方法很简单:

rpm -e --justdb --nodeps openssl.i386
yum install openssl
Filed in: Linux
0

Linux命令tar压缩排除指定目录的方法

例如我要压缩 /cat/backup 这个文件夹 (绝对路径),但是不将里面的图片文件夹img也压缩了.可以用tar命令的--exclude 排除掉.方法

tar -zcvf backup.tar.gz --exclude=/cat/backup/img  /cat/backup

排除多个目录

tar -zcvf backup.tar.gz --exclude=/cat/backup/img --exclude=/cat/backup/a --exclude=/cat/backup/b /cat/backup
Filed in: Linux
0

iptables限制同一IP连接数

最近无聊人太多了,一直拿我的小博客来压力测试,所以不得不限制同一个IP的连接数,用iptables就可以简单设置了...

  iptables -I INPUT -p tcp --dport 80 -m connlimit --connlimit-above 10 -j DROP

限制单个地址并发连接数不大于10

Filed in: Linux
3

WordPress在Nginx中启用Apache的mod_rewrite

其实不是真的可以另到 Nginx 支持 Apache 的 mod_rewrite 的.因为如果你的web服务器是 Nginx ,那么你的 WordPress 就会提示你的服务器环境不支持 mod_rewrite 了,但实际上是支持的,例如安装了 WP Super Cache 这插件就有这样的提示了,现在我们只要添加一行代码就可以关闭这个提示,欺骗WordPress ,让它认为是支持 mod_rewrite 方法是在主题的 functions.php 文件添加下面的代码:

add_filter('got_rewrite', 'nginx_has_rewrites');
function nginx_has_rewrites() {
    return true;
}

另外,因为Nginx运行PHP是用PHP-FPM的,所以有时会导致WordPress认为php没有写权限,表现为无法自动升级,和升级插件等,下面这个代码可以修改这个错误.

add_filter('filesystem_method', 'nginx_make_filesystem_direct');
function nginx_make_filesystem_direct() {
    return 'direct';
}
Filed in: WordPress
6
© 2007-2010 猫言猫语. All rights reserved. Powered by WordPress. 3 queries in 0.077 seconds.
Proudly designed by Theme Junkie.