寻觅生命中的那一片浅草......

rsync error: error in rsync protocol data stream

今天去检查备份文件,发现有台服务器的文件没有同步过来
手动同步一下,报以下错误

rsync: connection unexpectedly closed (0 bytes received so far) [receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(359)

试过以下方法,都不可以
重启rsync
重装rsync
查看rsync的密码文件,没有错

最后服务器上看
netstat -tlnp
发现监听873端口的变成了rpc.statd,而不是rsync
tcp        0      0 0.0.0.0:873                 0.0.0.0:*                   LISTEN      3659/rpc.statd

晚上搜索了,知道这是nfslock的进程,马上
service portmap stop
service nfs stop
service nfslock stop

chkconfig –level 2345 portmap off
chkconfig –level 2345 nfslock off
chkconfig –level 2345 nfs off

再开启
/usr/local/bin/rsync –daemon

此时同步,终于成功了

CentOS5.3_64位编译PHP出错

64位的系统给php添加curl的时候,
cd /usr/local/src/php-5.2.6/ext/curl/
/usr/local/php-fcgi/bin/phpize
./configure –with-php-config=/usr/local/php-fcgi/bin/php-config
居然出现一下错误!
checking for gnutls support in libcurl… no
checking for curl_easy_perform in -lcurl… no
configure: error: There is something wrong. Please check config.log for more information.

我赶紧检查有没有装curl的devel
rpm -qa |grep curl

全都有!
查了半天资料, 还是找到结果了, 只要以下包都安装了, 就可以完美通过!
curl-devel-7.15.5-2.el5
e2fsprogs-devel-1.39-15.el5
krb5-devel-1.6.1-25.el5
libidn-devel-0.6.5-1.1
openssl-devel-0.9.8b-10.el5
至于每个包的作用, 自己去查吧! 呵呵

转载自:

http://www.linuxquestions.org/questions/linux-software-2/install-php-on-a-64bit-centos-problem.-help.-673530/

SysAdmin to SysAdmin:bring out your inner xargs

xargs is your friend. Using xargs, you can pull off feats of greatness and not have to write a script to do it. xargs can take care of things right on the command line. Though I focus mainly on files in this article (it’s what I use it for almost exclusively), it’s important to remember that xargs acts on standard input, which could mean lines redirected from /var/log/messages or urls or whatever else you can manage to point in its direction.

One of the things I use xargs for in the course of my work is package management. My department standardized on Red Hat for all Linux boxes, which means I use RPM a lot. Sometimes, though, RPM isn’t the most wonderful tool in the world to deal with. One thing that makes RPM nice, though, is that it can take flags, file arguments and options in any order (for the things I’m using it for anyway). Let’s look at an example scenario you can use even if you’re not working with centralized software management in a mid-size network:

I’m a huge fan of Galeon. Back when they released 1.0.2, I had to have it. Unfortunately, my Ximian installation put packages tagged with their name on my system, and the Galeon RPM didn’t recognize them, which created dependency errors. <whine> “I can’t find mozilla-0.9.7″</whine>.

Having had some issues on my workstation at the office (it works fine on two other machines), I decided to uninstall any trace of Mozilla, and get standard Mozilla packages. But I don’t have a lot of time to do this stuff, so here’s what I did:

$ > rpm -qa | grep mozilla | xargs -n1 -p rpm -e –nodeps

What this says in English, is “Using RPM, query all (-qa) packages, look for mozilla in the package name, and send the results one at a time (-n1), to RPM’s uninstall command, and I don’t care about dependencies, thank you very much (“rpm -e –nodeps”). Also, in case there’s something that contains the word “mozilla” that I DON’T want erased, prompt me (-p) before uninstalling.”

The above command saves you from having to manually list the packages containing the string “mozilla,” then manually running separate “rpm -e” commands against them one at a time.

How about something REALLY useful! I rip CDs constantly using grip. Inevitably, I’ll reinstall and forget to not format the /mp3 partition, or I’ll upgrade grip and forget to change the directories it uses to store stuff… whatever. Eventually, I have MP3s all over my hard drive. What I do then is this:

$ > find / -name *.mp3 -type f -print | xargs tar -cvzf mp3z.tar.gz

This finds all the mp3z on my entire drive and puts ’em all in a tar file, and then I can untar them wherever I want :) I actually could’ve piped that xargs “tar” line into a “tar xvzf” line to automatically untar them. I also could’ve left out the “-type f” if I had grip set up to use a custom directory structure that I wanted to preserve. You get the idea :) PS – this works for other types of files, too, like finding all the files that belong to you, tarring them and sending the tar to a backup somewhere, so it does have legitimate use.

Ok, so this is good for stuff that takes the file name or other argument as the last thing on the line – but what about things like “cp,” that take an argument, and then another piece of input like a directory to copy to or a file to copy over or something? That’s where the ‘-i’ flag comes in. This flag allows you to specify some string that will then be replaced with the arguments you send to xargs in place. Expanding on the “cp” example:

$> ls *.mp3 | xargs -n1 -i cp {} backup/.

This command takes all of the MP3 files in the current directory, and feeds them one at a time (-n1) to the cp command, where the file argument coming in from ls will replace the curly braces. Notice I didn’t specify a string with “-i.” I don’t think I’ve ever had to. The default string that xargs will look to replace when using the -i flag is the curly braces.

As your command lines get a little more complex, or you start using xargs in scripts, there are a couple of useful troubleshooting flags you may find helpful if you run into issues. One, the -p flag, will prompt you for a yes or no before executing a command on anything. The other, which is a real life saver, is “-t,” and it does NOT prompt you for a yes or no (unless you use it with -p), but it will output the command it’s trying to execute, so if something isn’t quite right, you’ll be able to spot it right away.

转载自:http://www.linux.com/archive/feature/113662

傻瓜式搭建Nginx+PHP+Mysql服务器

1.下载 一键安装包LNMP

wget http://licess.googlecode.com/files/LNMP.zip

2. 64位机器

yum -y install libjpeg-devel

yum -y install libpng-devel

3.

unzip LNMP.zip

cd LNMP

chmod +x install.sh down.sh

./down.sh
./install.sh

4.安装Google的TCMalloc库
64位系统安装libunwind库

wget http://download.savannah.gnu.org … d-0.99-alpha.tar.gz
tar zxvf libunwind-0.99-alpha.tar.gz
cd libunwind-0.99-alpha/
CFLAGS=-fPIC ./configure
make CFLAGS=-fPIC
make CFLAGS=-fPIC install

wget http://google-perftools.googleco … erftools-1.1.tar.gz
tar zxvf google-perftools-1.1.tar.gz
cd google-perftools-1.1/
./configure
make && make install

echo “/usr/local/lib” > /etc/ld.so.conf.d/usr_local_lib.conf
/sbin/ldconfig

vi /usr/local/mysql/bin/mysqld_safe

在# executing mysqld_safe的下一行,加上:

代码:

export LD_PRELOAD=/usr/local/lib/libtcmalloc.so

保存后退出,然后重启MySQL服务器。

/etc/init.d/mysql restart

使用lsof命令查看tcmalloc是否起效:
代码:

/usr/sbin/lsof -n | grep tcmalloc

如果发现以下信息,说明tcmalloc已经起效:

mysqld 6074 mysql mem REG 8,3 1650572 11506841 /usr/local/lib/libtcmalloc.so.0.0.0

程序安装路径:
MySQL : /usr/local/mysql
PHP : /usr/local/php
Nginx : /usr/local/nginx
PHPMyAdmin /web/www/phpmyadmin
Web目录 /web/www

让Nginx开机后手动执行 /root/run.sh 后Nginx会运行 ,开机自动运行可以运行 LNMP目录下面的 startup.sh 文件即可。

转载自:http://www.mghost.cn/redirect.php?tid=1743&goto=lastpost

搭建CentOS5.3本地HTTP_YUM源

下载ISO,挂载
mount -o loop /export/CentOS-5.3-x86_64-bin-DVD.iso /media/
mkdir -p /var/www/html/CentOS5
cd /var/www/html/CentOS5
cp -a /media/* .

安装软件

yum -y install createrepo

生成xml文件
createrepo /var/www/html/CentOS5/CentOS
这样操作后 /var/www/html/CentOS5/CentOS下会多出一个repodata目录

如果要生成带group信息的也就是可以用yum grouplist或yum groupinstall的,则需要用以下命令

createrepo -g /var/www/html/CentOS5/repodata/comps.xml CentOS/

删除旧的repodate
rm -rf /var/www/html/CentOS5/repodata

假设你用的域名是www.example.com
假设你已经配置好Apache或Nginx,并可以通过http://www.example.com/访问到你的/var/www/html目录
编写CentOS5-HTTP.repo文件
vi CentOS5-HTTP.repo
[CentOS5-HTTP]
name=CentOS-$releasever – CentOS5-CentOS5-HTTP
baseurl=http://www.example.com/CentOS5/CentOS/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

保存退出

将CentOS5-HTTP.repo分发到客户端
保存到
/etc/yum.repos.d/

测试安装lrzsz软件

yum –disablerepo=\* –enablerepo=CentOS5-HTTP -y install lrzsz

至此,配置完毕

2025年七月
« 5月    
 123456
78910111213
14151617181920
21222324252627
28293031