<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>I@laoer.com &#187; Linux</title>
	<atom:link href="http://i.laoer.com/category/linux/feed" rel="self" type="application/rss+xml" />
	<link>http://i.laoer.com</link>
	<description>技术、生活、感悟 -- Laoer的博客</description>
	<lastBuildDate>Mon, 15 Feb 2010 08:36:53 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Nginx下alias支持PHP的问题</title>
		<link>http://i.laoer.com/nginx-alias-php.html</link>
		<comments>http://i.laoer.com/nginx-alias-php.html#comments</comments>
		<pubDate>Wed, 06 Jan 2010 02:01:04 +0000</pubDate>
		<dc:creator>Laoer</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Nginx]]></category>

		<guid isPermaLink="false">http://i.laoer.com/?p=411</guid>
		<description><![CDATA[这几天在配置Nginx，PHP用FastCGI，想装一个phpMyAdmin管理数据库，phpMyAdmin不想放在网站根目录下，这样不容易和网站应用混在一起，这样phpMyAdmin的目录就放在别处，在Apache里，有alias，比较方便，在Nginx下没有虚拟目录概念的，是用location配合alias使用，我先试了简单的配置方式
location /web/ {
alias  /data/web/;
index  index.html index.htm index.php;
}
location ~ .*\.(php&#124;php5)?$ {
fastcgi_pass  127.0.0.1:9000;
fastcgi_index index.php;
include fcgi.conf;
}
我用http://localhost/web/可以访问到/data/web目录下的静态文件，但访问php文件，却报No input file specified.的错误，而且在Nginx的error日志上却什么信息也没有，我在网上搜索了一下，判断应该是php文件并没有被后端的FastCGI运行，我又继续搜索一些文章，试着增加了一段配置
location /web/ {
alias  /data/web/;
index  index.html index.htm index.php;
}
location ~ ^/web/.+\.php$ {
root /data/;
rewrite /web/(.*\.php?) /$1 break;
include fcgi.conf;
fastcgi_pass   127.0.0.1:9000;
fastcgi_index  index.php;
fastcgi_param SCRIPT_FILENAME /data/web$fastcgi_script_name;
}
location ~ .*\.(php&#124;php5)?$ {
fastcgi_pass  127.0.0.1:9000;
fastcgi_index index.php;
include fcgi.conf;
}
这下可以了，原理应该是采用rewrite的方法，对于/web/下php类型的的请求交给后端的FastCGI处理，并且指定了php脚本的位置，这样我们就可以配置phpMyAdmin了，配置如下
location /phpmyadmin/ {
alias  /data/phpmyadmin/;
index  index.html index.htm index.php;
}
location ~ ^/phpmyadmin/.+\.php$ {
root /data/;
rewrite /phpmyadmin/(.*\.php?) /$1 break;
include fcgi.conf;
fastcgi_pass   127.0.0.1:9000;
fastcgi_index  [...]]]></description>
			<content:encoded><![CDATA[<p>这几天在配置Nginx，PHP用FastCGI，想装一个phpMyAdmin管理数据库，phpMyAdmin不想放在网站根目录下，这样不容易和网站应用混在一起，这样phpMyAdmin的目录就放在别处，在Apache里，有alias，比较方便，在Nginx下没有虚拟目录概念的，是用location配合alias使用，我先试了简单的配置方式</p>
<p>location /web/ {<br />
alias  /data/web/;<br />
index  index.html index.htm index.php;<br />
}</p>
<p>location ~ .*\.(php|php5)?$ {<br />
fastcgi_pass  127.0.0.1:9000;<br />
fastcgi_index index.php;<br />
include fcgi.conf;<br />
}</p>
<p>我用http://localhost/web/可以访问到/data/web目录下的静态文件，但访问php文件，却报No input file specified.的错误，而且在Nginx的error日志上却什么信息也没有，我在网上搜索了一下，判断应该是php文件并没有被后端的FastCGI运行，我又继续搜索一些文章，试着增加了一段配置</p>
<p>location /web/ {<br />
alias  /data/web/;<br />
index  index.html index.htm index.php;<br />
}</p>
<p>location ~ ^/web/.+\.php$ {<br />
root /data/;<br />
rewrite /web/(.*\.php?) /$1 break;<br />
include fcgi.conf;<br />
fastcgi_pass   127.0.0.1:9000;<br />
fastcgi_index  index.php;<br />
fastcgi_param SCRIPT_FILENAME /data/web$fastcgi_script_name;<br />
}</p>
<p>location ~ .*\.(php|php5)?$ {<br />
fastcgi_pass  127.0.0.1:9000;<br />
fastcgi_index index.php;<br />
include fcgi.conf;<br />
}</p>
<p>这下可以了，原理应该是采用rewrite的方法，对于/web/下php类型的的请求交给后端的FastCGI处理，并且指定了php脚本的位置，这样我们就可以配置phpMyAdmin了，配置如下</p>
<p>location /phpmyadmin/ {<br />
alias  /data/phpmyadmin/;<br />
index  index.html index.htm index.php;<br />
}</p>
<p>location ~ ^/phpmyadmin/.+\.php$ {<br />
root /data/;<br />
rewrite /phpmyadmin/(.*\.php?) /$1 break;<br />
include fcgi.conf;<br />
fastcgi_pass   127.0.0.1:9000;<br />
fastcgi_index  index.php;<br />
fastcgi_param SCRIPT_FILENAME /data/phpmyadmin$fastcgi_script_name;<br />
}</p>
<p>location ~ .*\.(php|php5)?$ {<br />
fastcgi_pass  127.0.0.1:9000;<br />
fastcgi_index index.php;<br />
include fcgi.conf;<br />
}</p>
<p>要注意的是</p>
<p>location ~ .*\.(php|php5)?$ {<br />
fastcgi_pass  127.0.0.1:9000;<br />
fastcgi_index index.php;<br />
include fcgi.conf;<br />
}</p>
<p>这段，要放在phpmyadmin的后面，放在前面就有问题，这是和Nginx的location规则有关，具体看Nginx的文档，另外，phpMyAdmin里要配置一下URI的绝对路径，就可以了。</p>
]]></content:encoded>
			<wfw:commentRss>http://i.laoer.com/nginx-alias-php.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux下Memcached安装事项</title>
		<link>http://i.laoer.com/linux-memcached-install.html</link>
		<comments>http://i.laoer.com/linux-memcached-install.html#comments</comments>
		<pubDate>Mon, 13 Apr 2009 01:47:00 +0000</pubDate>
		<dc:creator>Laoer</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Memcached]]></category>

		<guid isPermaLink="false">http://i.laoer.com/?p=269</guid>
		<description><![CDATA[在Linux下安装Memcached，先要安装libevent，在http://www.monkey.org/~provos/libevent/下载
Memcache在http://www.danga.com/memcached/download.bml下载
可能是我将libevent安装在/usr/local/libevent目录的缘故，在启动memchached时报一个错误
./memcached: error while loading shared libraries: libevent-1.4.so.2: cannot open shared object file: No such file or directory
我们先运行下面的命令，将libevent的lib目录加入LD_LIBRARY_PATH里
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/libevent/lib
之后再启动memcached就好了。
]]></description>
			<content:encoded><![CDATA[<p>在Linux下安装Memcached，先要安装libevent，在<a href="http://www.monkey.org/~provos/libevent/" target="_blank">http://www.monkey.org/~provos/libevent/</a>下载</p>
<p>Memcache在<a href="http://www.danga.com/memcached/download.bml" target="_blank">http://www.danga.com/memcached/download.bml</a>下载</p>
<p>可能是我将libevent安装在/usr/local/libevent目录的缘故，在启动memchached时报一个错误</p>
<p>./memcached: error while loading shared libraries: libevent-1.4.so.2: cannot open shared object file: No such file or directory</p>
<p>我们先运行下面的命令，将libevent的lib目录加入LD_LIBRARY_PATH里</p>
<p>export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/libevent/lib</p>
<p>之后再启动memcached就好了。</p>
]]></content:encoded>
			<wfw:commentRss>http://i.laoer.com/linux-memcached-install.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ORA-12547: TNS:lost contact问题</title>
		<link>http://i.laoer.com/ora-12547-tns-lost-contact.html</link>
		<comments>http://i.laoer.com/ora-12547-tns-lost-contact.html#comments</comments>
		<pubDate>Fri, 10 Apr 2009 06:31:46 +0000</pubDate>
		<dc:creator>Laoer</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[数据库]]></category>
		<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://i.laoer.com/?p=266</guid>
		<description><![CDATA[今天在Oracle Enterprise Linux上安装Oracle，后面创建数据实例的时候出现了ORA-12547: TNS:lost contact的错误，按理来说，Oracle Enterprise Linux可是就是针对Oracle的，怎么会出现这样的错误，在网上搜索了一下，可能是没有安装libaio包的缘故，我就试试吧。
在安装盘第3张里找到了libaio-0.3.105-2.i386.rpm和libaio-devel-0.3.105-2.i386.rpm，如果身边没有安装盘，可以到http://rpmfind.net上面去搜索一下，安装后，重起电脑，把以前安装过的Oracle卸载掉，重新安装，没有问题了。
以后需要注意，在安装Linux的时候就把这个包选进去。
]]></description>
			<content:encoded><![CDATA[<p>今天在Oracle Enterprise Linux上安装Oracle，后面创建数据实例的时候出现了ORA-12547: TNS:lost contact的错误，按理来说，Oracle Enterprise Linux可是就是针对Oracle的，怎么会出现这样的错误，在网上搜索了一下，可能是没有安装libaio包的缘故，我就试试吧。</p>
<p>在安装盘第3张里找到了libaio-0.3.105-2.i386.rpm和libaio-devel-0.3.105-2.i386.rpm，如果身边没有安装盘，可以到<a href="http://rpmfind.net/" target="_blank">http://rpmfind.net</a>上面去搜索一下，安装后，重起电脑，把以前安装过的Oracle卸载掉，重新安装，没有问题了。</p>
<p>以后需要注意，在安装Linux的时候就把这个包选进去。</p>
]]></content:encoded>
			<wfw:commentRss>http://i.laoer.com/ora-12547-tns-lost-contact.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux挂载USB硬盘的方法</title>
		<link>http://i.laoer.com/linux-mount-usb-disk.html</link>
		<comments>http://i.laoer.com/linux-mount-usb-disk.html#comments</comments>
		<pubDate>Thu, 09 Apr 2009 08:40:12 +0000</pubDate>
		<dc:creator>Laoer</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://i.laoer.com/?p=260</guid>
		<description><![CDATA[先检查Linux是否加载usb模块
lsmod &#124; grep usb
如果没有信息，则执行
modprobe usb-storage
之后把USB的硬盘接上，执行
fdisk -l
可以看到
Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14         587     4610655   82  Linux swap
/dev/sda3             588        9729    73433115   83  Linux
Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 [...]]]></description>
			<content:encoded><![CDATA[<p>先检查Linux是否加载usb模块</p>
<p>lsmod | grep usb</p>
<p>如果没有信息，则执行</p>
<p>modprobe usb-storage</p>
<p>之后把USB的硬盘接上，执行</p>
<p>fdisk -l</p>
<p>可以看到</p>
<p>Disk /dev/sda: 80.0 GB, 80026361856 bytes<br />
255 heads, 63 sectors/track, 9729 cylinders<br />
Units = cylinders of 16065 * 512 = 8225280 bytes</p>
<p>Device Boot      Start         End      Blocks   Id  System<br />
/dev/sda1   *           1          13      104391   83  Linux<br />
/dev/sda2              14         587     4610655   82  Linux swap<br />
/dev/sda3             588        9729    73433115   83  Linux</p>
<p>Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes<br />
255 heads, 63 sectors/track, 121601 cylinders<br />
Units = cylinders of 16065 * 512 = 8225280 bytes</p>
<p>Disk /dev/sdb doesn&#8217;t contain a valid partition table</p>
<p>可以看到/dev/sda是我们已有的硬盘，/dev/sdb就是USB硬盘了，提示改硬盘还没有分区，接下来我们就对/dev/sdb做分区，执行命令</p>
<p>fdisk /dev/sdb</p>
<p>之后会提示</p>
<p>Command (m for help):</p>
<p>可以输入m看一下help，我们输入n，新创建一个分区，之后出现</p>
<p>Command action<br />
e   extended<br />
p   primary partition (1-4)</p>
<p>输入p，创建主分区，之后</p>
<p>Partition number (1-4):</p>
<p>输入1，会提示</p>
<p>First cylinder (1-121601, default 1):</p>
<p>直接回车，即默认1，也就是从1开始，提示</p>
<p>Using default value 1<br />
Last cylinder or +size or +sizeM or +sizeK (1-121601, default 121601):</p>
<p>直接回车，因为我把整个硬盘分1个区，所以就用最大值，回车就可以了，提示</p>
<p>Using default value 121601</p>
<p>Command (m for help):</p>
<p>这时候我们可以输入p，看一下分区情况</p>
<p>Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes<br />
255 heads, 63 sectors/track, 121601 cylinders<br />
Units = cylinders of 16065 * 512 = 8225280 bytes</p>
<p>Device Boot      Start         End      Blocks   Id  System<br />
/dev/sdb1               1      121601   976760001   83  Linux</p>
<p>Command (m for help):</p>
<p>这时候输入w，写入分区表，这样就完成了，会提示</p>
<p>The partition table has been altered!</p>
<p>Calling ioctl() to re-read partition table.<br />
Syncing disks.</p>
<p>我们再执行fdisk -l看一下情况</p>
<p>Disk /dev/sda: 80.0 GB, 80026361856 bytes<br />
255 heads, 63 sectors/track, 9729 cylinders<br />
Units = cylinders of 16065 * 512 = 8225280 bytes</p>
<p>Device Boot      Start         End      Blocks   Id  System<br />
/dev/sda1   *           1          13      104391   83  Linux<br />
/dev/sda2              14         587     4610655   82  Linux swap<br />
/dev/sda3             588        9729    73433115   83  Linux</p>
<p>Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes<br />
255 heads, 63 sectors/track, 121601 cylinders<br />
Units = cylinders of 16065 * 512 = 8225280 bytes</p>
<p>Device Boot      Start         End      Blocks   Id  System<br />
/dev/sdb1               1      121601   976760001   83  Linux</p>
<p>我们已经看到/dev/sdb1了，现在要对/dev/sdb1做一下格式化，在linux上可以将格式化成多种格式，比如ext3 、reiserfs 、ext2 、fat32 、msdos等，我们还是格式化成ext3的默认格式，执行</p>
<p>mkfs.ext3 /dev/sdb1</p>
<p>mke2fs 1.35 (28-Feb-2004)<br />
Filesystem label=<br />
OS type: Linux<br />
Block size=4096 (log=2)<br />
Fragment size=4096 (log=2)<br />
122109952 inodes, 244190000 blocks<br />
12209500 blocks (5.00%) reserved for the super user<br />
First data block=0<br />
Maximum filesystem blocks=247463936<br />
7453 block groups<br />
32768 blocks per group, 32768 fragments per group<br />
16384 inodes per group<br />
Superblock backups stored on blocks:<br />
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,<br />
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,<br />
102400000, 214990848</p>
<p>Writing inode tables: done     (在这个地方会等待，直到done)<br />
Creating journal (8192 blocks): done<br />
Writing superblocks and filesystem accounting information:</p>
<p>直接回车就之后就完成格式化</p>
<p>done</p>
<p>This filesystem will be automatically checked every 30 mounts or<br />
180 days, whichever comes first.  Use tune2fs -c or -i to override.</p>
<p>之后我们可以把/dev/sdb1挂载到系统中，比如</p>
<p>mount /dev/sdb1 /u02/oradata1</p>
<p>用df命令看一下</p>
<p>Filesystem           1K-blocks      Used Available Use% Mounted on<br />
/dev/sda3             72279384   9336512  59271220  14% /<br />
/dev/sda1               101086      8741     87126  10% /boot<br />
none                   1553948         0   1553948   0% /dev/shm<br />
/dev/sdb1            961432072    110656 912483416   1% /u02/oradata1</p>
<p>/dev/sdb1已经mount到/u02/oradata1了。</p>
]]></content:encoded>
			<wfw:commentRss>http://i.laoer.com/linux-mount-usb-disk.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LVS和Nginx的一些杂记</title>
		<link>http://i.laoer.com/lvs-keepalived-nginx.html</link>
		<comments>http://i.laoer.com/lvs-keepalived-nginx.html#comments</comments>
		<pubDate>Fri, 03 Apr 2009 04:47:22 +0000</pubDate>
		<dc:creator>Laoer</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[keepalived]]></category>
		<category><![CDATA[LVS]]></category>
		<category><![CDATA[Nginx]]></category>

		<guid isPermaLink="false">http://i.laoer.com/?p=245</guid>
		<description><![CDATA[LVS（Linux Virtual Server）是章文嵩博士创立的开源项目，可以帮助我们建立高可用性和高扩展性的Linux集群，LVS性能非常好，在暂时不能花费巨资购买F5、NetDispatcher之类硬件的时期，LVS还是能够很好的满足需要的。
LVS的Linux组件IPVS在新版本的Linux内核里已经支持，不需要单独再安装，可以通过命令
lsmod &#124;grep ip_vs
检查内核是否支持IPVS。
ipvsadm是LVS的管理软件，在编译安装的时候要注意，先做一个ln连接，类似
ln -s /usr/src/kernels/2.6.9-42.EL-smp-i686 /usr/src/linux
或
ln -s /usr/src/kernels/2.6.18-8.el5-x86_64 /usr/src/linux
keepalived是一个很方便的LVS管理工具，只要需要配置keepalived的配置文件就可以了，不用一条一条的执行ipvsadm命令了。
将keepalived加为服务的方法（keepalived默认安装在/usr/local/etc下）
cp /usr/local/etc/rc.d/init.d/keepalived /etc/rc.d/init.d/
cp /usr/local/etc/sysconfig/keepalived /etc/sysconfig/
mkdir /etc/keepalived
cp /usr/local/etc/keepalived/keepalived.conf /etc/keepalived/
cp /usr/local/sbin/keepalived /usr/sbin/
关于虚拟IP与真实服务器IP的端口对应问题
在测试中，发现虚拟IP的端口只能和真实服务器IP的端口对应，比如虚拟IP的端口是80，后面对应的真实服务器的端口也只能是80，不能任意配置，真实服务器的端口，让我非常的不解，是我配置错误？还是LVS或keepalived得问题呢？
在Nginx服务器里也可以实现简单的Load Balance，举例
upstream tomcats {
ip_hash;
server 127.0.0.1:8080 max_fails=3 fail_timeout=30s;
server 127.0.0.1:8280 max_fails=3 fail_timeout=30s;
}
server {
location / {
proxy_pass http://tomcats;
}
}
其中，ip_hash的作用在于很据用IP做hash算法，分配到相应的后端服务上，这样的话，用可以基本上固定的分配到某台机子上，就不用担心Session的问题，fail_timeout和max_fails是指在单位时间重试的次数，如果连接不成功，则不会再向其转发请求。
]]></description>
			<content:encoded><![CDATA[<p>LVS（<a href="http://www.linuxvirtualserver.org/" target="_blank">Linux Virtual Server</a>）是章文嵩博士创立的开源项目，可以帮助我们建立高可用性和高扩展性的Linux集群，LVS性能非常好，在暂时不能花费巨资购买F5、NetDispatcher之类硬件的时期，LVS还是能够很好的满足需要的。</p>
<p>LVS的Linux组件IPVS在新版本的Linux内核里已经支持，不需要单独再安装，可以通过命令</p>
<p>lsmod |grep ip_vs</p>
<p>检查内核是否支持IPVS。</p>
<p><a href="http://www.linuxvirtualserver.org/software/ipvs.html" target="_blank">ipvsadm</a>是LVS的管理软件，在编译安装的时候要注意，先做一个ln连接，类似</p>
<p>ln -s /usr/src/kernels/2.6.9-42.EL-smp-i686 /usr/src/linux<br />
或<br />
ln -s /usr/src/kernels/2.6.18-8.el5-x86_64 /usr/src/linux</p>
<p><a href="http://www.keepalived.org/" target="_blank">keepalived</a>是一个很方便的LVS管理工具，只要需要配置keepalived的配置文件就可以了，不用一条一条的执行ipvsadm命令了。</p>
<p>将keepalived加为服务的方法（keepalived默认安装在/usr/local/etc下）</p>
<p>cp /usr/local/etc/rc.d/init.d/keepalived /etc/rc.d/init.d/<br />
cp /usr/local/etc/sysconfig/keepalived /etc/sysconfig/<br />
mkdir /etc/keepalived<br />
cp /usr/local/etc/keepalived/keepalived.conf /etc/keepalived/<br />
cp /usr/local/sbin/keepalived /usr/sbin/</p>
<p>关于虚拟IP与真实服务器IP的端口对应问题<br />
在测试中，发现虚拟IP的端口只能和真实服务器IP的端口对应，比如虚拟IP的端口是80，后面对应的真实服务器的端口也只能是80，不能任意配置，真实服务器的端口，让我非常的不解，是我配置错误？还是LVS或keepalived得问题呢？</p>
<p>在Nginx服务器里也可以实现简单的Load Balance，举例</p>
<p>upstream tomcats {<br />
ip_hash;<br />
server 127.0.0.1:8080 max_fails=3 fail_timeout=30s;<br />
server 127.0.0.1:8280 max_fails=3 fail_timeout=30s;<br />
}<br />
server {<br />
location / {<br />
proxy_pass http://tomcats;<br />
}<br />
}</p>
<p>其中，ip_hash的作用在于很据用IP做hash算法，分配到相应的后端服务上，这样的话，用可以基本上固定的分配到某台机子上，就不用担心Session的问题，fail_timeout和max_fails是指在单位时间重试的次数，如果连接不成功，则不会再向其转发请求。</p>
]]></content:encoded>
			<wfw:commentRss>http://i.laoer.com/lvs-keepalived-nginx.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>试用Nginx</title>
		<link>http://i.laoer.com/nginx.html</link>
		<comments>http://i.laoer.com/nginx.html#comments</comments>
		<pubDate>Thu, 05 Mar 2009 02:22:16 +0000</pubDate>
		<dc:creator>Laoer</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Nginx]]></category>

		<guid isPermaLink="false">http://i.laoer.com/?p=137</guid>
		<description><![CDATA[Nginx是一款性能非常强劲的Web服务器，也可以用来做反向代理服务器，现在用Nginx做服务器站点越来越多了。

上图是Nginx和Lighttpd的主机数量比较
最近我试用了一下Nginx，做了一个Nginx+Tomcat的测试，具体步骤如下：
groupadd www
useradd -g www www
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-7.8.tar.gz
wget http://sysoev.ru/nginx/nginx-0.7.39.tar.gz
tar zxvf pcre-7.8.tar.gz
cd pcre-7.8
./configure
make
make install
cd ..
tar zxvf nginx-0.7.39.tar.gz
cd nginx-0.7.39
./configure &#8211;user=www &#8211;group=www &#8211;prefix=/usr/local/nginx &#8211;with-http_stub_status_module &#8211;with-http_ssl_module
make
make install
cd /usr/local/nginx/conf/
我们编辑nginx.conf文件，内容如下
user  www www;
worker_processes  3;
error_log  logs/error.log  notice;
pid        logs/nginx.pid;
events {
use epoll;
worker_connections  1024;
}
http {
include       mime.types;
default_type  application/octet-stream;
include    /usr/local/nginx/conf/proxy.conf;
log_format  main  &#8216;$remote_addr &#8211; $remote_user [$time_local] &#8220;$request&#8221; &#8216;
&#8216;&#8221;$status&#8221; $body_bytes_sent &#8220;$http_referer&#8221; &#8216;
&#8216;&#8221;$http_user_agent&#8221; &#8220;$http_x_forwarded_for&#8221;&#8216;;
#access_log  logs/access.log  main;
sendfile        on;
tcp_nopush     on;
#keepalive_timeout  0;
keepalive_timeout  65;
#gzip  on;
server {
listen       80;
server_name  [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Nginx" href="http://www.nginx.net/" target="_blank">Nginx</a>是一款性能非常强劲的Web服务器，也可以用来做反向代理服务器，现在用Nginx做服务器站点越来越多了。</p>
<p><img class="alignnone size-full wp-image-178" title="netcraft_chart_with_lighttpd" src="http://i.laoer.com/wp-content/uploads/2009/03/netcraft_chart_with_lighttpd.png" alt="netcraft_chart_with_lighttpd" width="300" height="200" /></p>
<p>上图是Nginx和Lighttpd的主机数量比较</p>
<p>最近我试用了一下Nginx，做了一个Nginx+Tomcat的测试，具体步骤如下：</p>
<p>groupadd www<br />
useradd -g www www</p>
<p>wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-7.8.tar.gz<br />
wget http://sysoev.ru/nginx/nginx-0.7.39.tar.gz</p>
<p>tar zxvf pcre-7.8.tar.gz<br />
cd pcre-7.8<br />
./configure<br />
make<br />
make install<br />
cd ..</p>
<p>tar zxvf nginx-0.7.39.tar.gz<br />
cd nginx-0.7.39<br />
./configure &#8211;user=www &#8211;group=www &#8211;prefix=/usr/local/nginx &#8211;with-http_stub_status_module &#8211;with-http_ssl_module<br />
make<br />
make install</p>
<p>cd /usr/local/nginx/conf/</p>
<p>我们编辑nginx.conf文件，内容如下</p>
<p>user  www www;<br />
worker_processes  3;</p>
<p>error_log  logs/error.log  notice;</p>
<p>pid        logs/nginx.pid;</p>
<p>events {<br />
use epoll;<br />
worker_connections  1024;<br />
}</p>
<p>http {<br />
include       mime.types;<br />
default_type  application/octet-stream;</p>
<p>include    /usr/local/nginx/conf/proxy.conf;</p>
<p>log_format  main  &#8216;$remote_addr &#8211; $remote_user [$time_local] &#8220;$request&#8221; &#8216;<br />
&#8216;&#8221;$status&#8221; $body_bytes_sent &#8220;$http_referer&#8221; &#8216;<br />
&#8216;&#8221;$http_user_agent&#8221; &#8220;$http_x_forwarded_for&#8221;&#8216;;</p>
<p>#access_log  logs/access.log  main;</p>
<p>sendfile        on;<br />
tcp_nopush     on;</p>
<p>#keepalive_timeout  0;<br />
keepalive_timeout  65;</p>
<p>#gzip  on;</p>
<p>server {<br />
listen       80;<br />
server_name  localhost;</p>
<p>#charset koi8-r;</p>
<p>access_log  logs/localhost.access.log  main;</p>
<p>#location / {<br />
#    root   html;<br />
#    index  index.html index.htm;<br />
#}</p>
<p>location / {<br />
proxy_pass http://localhost:8080;<br />
}</p>
<p>#location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {<br />
#    expires      30d;<br />
#}</p>
<p>#location ~ .*\.(js|css)?$ {<br />
#   expires      1h;<br />
#}</p>
<p>location /NginxStatus {<br />
stub_status             on;<br />
access_log              on;<br />
auth_basic              &#8220;NginxStatus&#8221;;<br />
}</p>
<p>#error_page  404              /404.html;</p>
<p># redirect server error pages to the static page /50x.html<br />
#<br />
error_page   500 502 503 504  /50x.html;<br />
location = /50x.html {<br />
root   html;<br />
}</p>
<p>}</p>
<p>}</p>
<p>同时我们要在/usr/local/nginx/conf下创建proxy.conf文件，内容如下</p>
<p>proxy_redirect off;<br />
proxy_set_header Host $host;<br />
proxy_set_header X-Real-IP $remote_addr;<br />
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<br />
client_max_body_size 10m;<br />
client_body_buffer_size 128k;<br />
proxy_connect_timeout 90;<br />
proxy_send_timeout 90;<br />
proxy_read_timeout 90;<br />
proxy_buffers 32 4k;</p>
<p>保存之后，进入/usr/local/nginx/目录下，执行sbin/nginx，即可启动Nginx。</p>
<p>客户端浏览器输入http://ServerIP，可以看到Tomcat的欢迎页面，证明Ngnix已经转发HTTP请求给后端的Tomcat了，打开http://ServerIP/NginxStatus可以查看Nginx的状态，在Shell下我们还可以查看一下HTTP头</p>
<p>curl -I http://localhost<br />
HTTP/1.1 200 OK<br />
Server: nginx/0.7.39<br />
Date: Thu, 05 Mar 2009 02:08:54 GMT<br />
Content-Type: text/html;charset=ISO-8859-1<br />
Connection: keep-alive<br />
Content-Length: 8132</p>
<p>关于Nginx的配置，还是需要看它的文档<a href="http://wiki.nginx.org/Main" target="_blank">http://wiki.nginx.org/Main</a>，国内张宴的<a href="http://blog.s135.com/post/366.htm" target="_blank">《Nginx 0.7.x + PHP 5.2.8（FastCGI）搭建胜过Apache十倍的Web服务器（第4版）[原创]》</a>非常不错，可以参考。</p>
]]></content:encoded>
			<wfw:commentRss>http://i.laoer.com/nginx.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux下切分Tomcat的catalina.out日志文件</title>
		<link>http://i.laoer.com/rotating-catalina-out-in-tomcat-using-cronolog.html</link>
		<comments>http://i.laoer.com/rotating-catalina-out-in-tomcat-using-cronolog.html#comments</comments>
		<pubDate>Wed, 18 Feb 2009 06:35:27 +0000</pubDate>
		<dc:creator>Laoer</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tomcat]]></category>

		<guid isPermaLink="false">http://i.laoer.com/?p=87</guid>
		<description><![CDATA[随着Tomcat的运行，catalina.out文件会越来越大，虽然Tomcat每日会生成一个catalina.ymd.log的文件，但catalina.out主文件仍然不断增加，需要对catalina.out按日切分才好，在网上找了一下，看到一篇《rotating catalina.out in tomcat 5.5 using cronolog》，就用公司的Tomcat配置一下。
cronolog工具已经在服务器上装过，一个对日志切分的小工具，其主页在http://cronolog.org/，我们也用它来切分Apache的日志。
进入Tomcat的bin目录，打开catalina.sh文件，找到tomcat启动的相关行，或者你直接查找catalina.out，一般我们修改下面行中的内容（因为我们一般不会在-security条件下运行），

1
2
3
4
5
6
7
8
9
10
11
12
13
    else
    “$_RUNJAVA” $JAVA_OPTS $CATALINA_OPTS \
    -Djava.endorsed.dirs=”$JAVA_ENDORSED_DIRS” -classpath “$CLASSPATH” \
    -Dcatalina.base=”$CATALINA_BASE” \
    -Dcatalina.home=”$CATALINA_HOME” \
    -Djava.io.tmpdir=”$CATALINA_TMPDIR” \
    org.apache.catalina.startup.Bootstrap “$@” start  \
    &#62;&#62; “$CATALINA_BASE”/logs/catalina.out 2&#62;&#38;1 &#38;
&#160;
 [...]]]></description>
			<content:encoded><![CDATA[<p>随着Tomcat的运行，catalina.out文件会越来越大，虽然Tomcat每日会生成一个catalina.ymd.log的文件，但catalina.out主文件仍然不断增加，需要对catalina.out按日切分才好，在网上找了一下，看到一篇<a href="http://www.camelrichard.org/rotating-catalina-out-tomcat-5-5-using-cronolog" target="_blank">《rotating catalina.out in tomcat 5.5 using cronolog》</a>，就用公司的Tomcat配置一下。</p>
<p>cronolog工具已经在服务器上装过，一个对日志切分的小工具，其主页在<a href="http://cronolog.org/" target="_blank">http://cronolog.org/</a>，我们也用它来切分Apache的日志。</p>
<p>进入Tomcat的bin目录，打开catalina.sh文件，找到tomcat启动的相关行，或者你直接查找catalina.out，一般我们修改下面行中的内容（因为我们一般不会在-security条件下运行），</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">    <span style="color: #000000; font-weight: bold;">else</span>
    “<span style="color: #007800;">$_RUNJAVA</span>” <span style="color: #007800;">$JAVA_OPTS</span> <span style="color: #007800;">$CATALINA_OPTS</span> \
    -Djava.endorsed.dirs=”<span style="color: #007800;">$JAVA_ENDORSED_DIRS</span>” <span style="color: #660033;">-classpath</span> “<span style="color: #007800;">$CLASSPATH</span>” \
    -Dcatalina.base=”<span style="color: #007800;">$CATALINA_BASE</span>” \
    -Dcatalina.home=”<span style="color: #007800;">$CATALINA_HOME</span>” \
    -Djava.io.tmpdir=”<span style="color: #007800;">$CATALINA_TMPDIR</span>” \
    org.apache.catalina.startup.Bootstrap “$<span style="color: #000000; font-weight: bold;">@</span>” start  \
    <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> “<span style="color: #007800;">$CATALINA_BASE</span>”<span style="color: #000000; font-weight: bold;">/</span>logs<span style="color: #000000; font-weight: bold;">/</span>catalina.out <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">&amp;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-z</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$CATALINA_PID</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$!</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #007800;">$CATALINA_PID</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
    <span style="color: #000000; font-weight: bold;">fi</span></pre></td></tr></table></div>

<p>修改<br />
org.apache.catalina.startup.Bootstrap &#8220;$@&#8221; start  \<br />
&gt;&gt; &#8220;$CATALINA_BASE&#8221;/logs/catalina.out 2&gt;&amp;1 &amp;<br />
为<br />
org.apache.catalina.startup.Bootstrap &#8220;$@&#8221; start 2&gt;&amp;1 \<br />
| /usr/local/sbin/cronolog &#8220;$CATALINA_BASE&#8221;/logs/catalina.%Y-%m-%d.out &gt;&gt; /dev/null &amp;<br />
同时，上面有一行<br />
touch &#8220;$CATALINA_BASE&#8221;/logs/catalina.out<br />
可以注释掉，完成之后重起Tomcat就可以了，在logs目录下可以看到catalina.2009-02-18.out的日志，是按日生成的。</p>
]]></content:encoded>
			<wfw:commentRss>http://i.laoer.com/rotating-catalina-out-in-tomcat-using-cronolog.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Redhat Linux下src rpm的安装方法</title>
		<link>http://i.laoer.com/redhat-linux-src-rpm-install.html</link>
		<comments>http://i.laoer.com/redhat-linux-src-rpm-install.html#comments</comments>
		<pubDate>Wed, 18 Feb 2009 01:22:04 +0000</pubDate>
		<dc:creator>Laoer</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://i.laoer.com/?p=80</guid>
		<description><![CDATA[方法一：
1.　执行rpm -i your-package.src.rpm
2.　cd /usr/src/redhat/SPECS
3.　rpmbuild -bp your-package.specs 一个和你的软件包同名的specs文件
4.　cd /usr/src/redhat/BUILD/your-package/ 一个和你的软件包同名的目录
5.　./configure 这一步和编译普通的源码软件一样，可以加上参数
6.　make
7.　make install
方法二:
1.　执行rpm -i you-package.src.rpm
2.　cd /usr/src/redhat/SPECS (前两步和方法一相同)
3.　rpmbuild -bb your-package.specs 一个和你的软件包同名的specs文件
这时，在/usr/src/redhat/RPM/i386/ （根据具体包的不同，也可能是i686,noarch等等) 在这个目录下，有一个新的rpm包，这个是编译好的二进制文件。执行：
rpm -i new-package.rpm即可安装完成。
]]></description>
			<content:encoded><![CDATA[<p>方法一：<br />
1.　执行rpm -i your-package.src.rpm<br />
2.　cd /usr/src/redhat/SPECS<br />
3.　rpmbuild -bp your-package.specs 一个和你的软件包同名的specs文件<br />
4.　cd /usr/src/redhat/BUILD/your-package/ 一个和你的软件包同名的目录<br />
5.　./configure 这一步和编译普通的源码软件一样，可以加上参数<br />
6.　make<br />
7.　make install</p>
<p>方法二:<br />
1.　执行rpm -i you-package.src.rpm<br />
2.　cd /usr/src/redhat/SPECS (前两步和方法一相同)<br />
3.　rpmbuild -bb your-package.specs 一个和你的软件包同名的specs文件</p>
<p>这时，在/usr/src/redhat/RPM/i386/ （根据具体包的不同，也可能是i686,noarch等等) 在这个目录下，有一个新的rpm包，这个是编译好的二进制文件。执行：</p>
<p>rpm -i new-package.rpm即可安装完成。</p>
]]></content:encoded>
			<wfw:commentRss>http://i.laoer.com/redhat-linux-src-rpm-install.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>在Linux上安装awstats</title>
		<link>http://i.laoer.com/linux-install-awstats.html</link>
		<comments>http://i.laoer.com/linux-install-awstats.html#comments</comments>
		<pubDate>Wed, 11 Feb 2009 04:31:25 +0000</pubDate>
		<dc:creator>Laoer</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[awstats]]></category>

		<guid isPermaLink="false">http://i.laoer.com/?p=47</guid>
		<description><![CDATA[awstats是一个Apache/Windows IIS的日志分析工具，每次安装的时候都参考车东的《AWStats简介》，这次我把安装步骤记录下来，下次再安装时就比较方便了。
我的Apache安装在/usr/local/apache/，access_log日志文件用cronolog工具按天截断
wget http://nchc.dl.sourceforge.net/sourceforge/awstats/awstats-6.9.tar.gz
tar zxvf awstats-6.9.tar.gz
mv awstats-6.9/wwwroot/cgi-bin /usr/local/apache/cgi-bin/awstats
(wwwroot下还有一些静态文件夹，最后Copy到相应Web目录下)
下面安装GeoIP相关包，GeoIP是一个ip-location的工具，可以根据IP确定位置，包括国家、城市，具体参考其网站 http://www.maxmind.com/app/ip-location
wget http://geolite.maxmind.com/download/geoip/api/c/GeoIP.tar.gz
wget http://geolite.maxmind.com/download/geoip/api/perl/Geo-IP-1.36.tar.gz
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
tar zxvf GeoIP.tar.gz
cd GeoIP-1.4.5
./configure
make
make install
cd ..
tar zxvf Geo-IP-1.36.tar.gz
cd Geo-IP-1.36
perl Makefile.PL（注意，在这里可能出错，是因为找不到GeoIP的包，可以用perl Makefile.PL LIBS=&#8217;-L/usr/local/lib&#8217; INC=&#8217;-I/usr/local/include&#8217;）
make
make install
cd ..
gunzip GeoIP.dat.gz
mv GeoIP.dat /usr/local/apache/cgi-bin/awstats/
gunzip GeoLiteCity.dat.gz
mv GeoLiteCity.dat /usr/local/apache/cgi-bin/awstats/
cd /usr/local/apache/cgi-bin/awstats/
mv awstats.model.conf common.conf
修改common.conf文件，加入
LoadPlugin=&#8221;decodeutfkeys&#8221;
LoadPlugin=&#8221;geoip GEOIP_STANDARD /usr/local/apache/cgi-bin/awstats/GeoIP.dat&#8221;
LoadPlugin=&#8221;geoip_city_maxmind GEOIP_STANDARD /usr/local/apache/cgi-bin/awstats/GeoLiteCity.dat&#8221;
保存退出之后，还在/usr/local/apache/cgi-bin/awstats/目录下
mkdir data
vi awstats.pl
修改里面的内容
$LIMITFLUSH =
50000;   # Nb of records in data arrays after how we need to flush [...]]]></description>
			<content:encoded><![CDATA[<p>awstats是一个Apache/Windows IIS的日志分析工具，每次安装的时候都参考<a title="车东" href="http://www.chedong.com" target="_blank">车东</a>的《<a title="AWStats简介：Apache/Windows IIS的日志分析工具的下载，安装，配置样例和使用" href="http://www.chedong.com/tech/awstats.html" target="_blank">AWStats简介</a>》，这次我把安装步骤记录下来，下次再安装时就比较方便了。</p>
<p>我的Apache安装在/usr/local/apache/，access_log日志文件用cronolog工具按天截断</p>
<p>wget http://nchc.dl.sourceforge.net/sourceforge/awstats/awstats-6.9.tar.gz<br />
tar zxvf awstats-6.9.tar.gz<br />
mv awstats-6.9/wwwroot/cgi-bin /usr/local/apache/cgi-bin/awstats<br />
(wwwroot下还有一些静态文件夹，最后Copy到相应Web目录下)</p>
<p>下面安装<a title="GeoIP" href="http://www.maxmind.com/app/ip-location" target="_blank">GeoIP</a>相关包，GeoIP是一个ip-location的工具，可以根据IP确定位置，包括国家、城市，具体参考其网站 <a href="http://www.maxmind.com/app/ip-location" target="_blank">http://www.maxmind.com/app/ip-location</a></p>
<p>wget http://geolite.maxmind.com/download/geoip/api/c/GeoIP.tar.gz<br />
wget http://geolite.maxmind.com/download/geoip/api/perl/Geo-IP-1.36.tar.gz<br />
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz<br />
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz</p>
<p>tar zxvf GeoIP.tar.gz<br />
cd GeoIP-1.4.5<br />
./configure<br />
make<br />
make install<br />
cd ..</p>
<p>tar zxvf Geo-IP-1.36.tar.gz<br />
cd Geo-IP-1.36<br />
perl Makefile.PL（注意，在这里可能出错，是因为找不到GeoIP的包，可以用perl Makefile.PL LIBS=&#8217;-L/usr/local/lib&#8217; INC=&#8217;-I/usr/local/include&#8217;）<br />
make<br />
make install<br />
cd ..</p>
<p>gunzip GeoIP.dat.gz<br />
mv GeoIP.dat /usr/local/apache/cgi-bin/awstats/</p>
<p>gunzip GeoLiteCity.dat.gz<br />
mv GeoLiteCity.dat /usr/local/apache/cgi-bin/awstats/</p>
<p>cd /usr/local/apache/cgi-bin/awstats/<br />
mv awstats.model.conf common.conf<br />
修改common.conf文件，加入<br />
LoadPlugin=&#8221;decodeutfkeys&#8221;<br />
LoadPlugin=&#8221;geoip GEOIP_STANDARD /usr/local/apache/cgi-bin/awstats/GeoIP.dat&#8221;<br />
LoadPlugin=&#8221;geoip_city_maxmind GEOIP_STANDARD /usr/local/apache/cgi-bin/awstats/GeoLiteCity.dat&#8221;</p>
<p>保存退出之后，还在/usr/local/apache/cgi-bin/awstats/目录下<br />
mkdir data</p>
<p>vi awstats.pl<br />
修改里面的内容<br />
$LIMITFLUSH =<br />
50000;   # Nb of records in data arrays after how we need to flush data on disk<br />
保存退出</p>
<p>新建你网站的配置文件<br />
vi awstats.domainname.conf<br />
加入内容<br />
Include &#8220;common.conf&#8221;<br />
LogFile=&#8221;/usr/local/apache/logs/domainname-access_log.%YYYY-24%MM-24%DD-24&#8243;<br />
SiteDomain=&#8221;domainname&#8221;<br />
DefaultFile=&#8221;index.html&#8221;<br />
DirData=&#8221;/usr/local/apache/cgi-bin/awstats/data/&#8221;<br />
保存退出</p>
<p>执行<br />
./awstats.pl -update -config=domainname -lang=cn<br />
就可以生成domainname的分析报表，通过http://domainname/cgi-bin/awstats/awstats.pl?config=domainname就要可以在web上查看了<br />
需要每日生成的话，写一个crontab的脚本在每天凌晨执行就可以了</p>
]]></content:encoded>
			<wfw:commentRss>http://i.laoer.com/linux-install-awstats.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux下删除文件的方法</title>
		<link>http://i.laoer.com/linux-rm-file.html</link>
		<comments>http://i.laoer.com/linux-rm-file.html#comments</comments>
		<pubDate>Wed, 11 Feb 2009 04:08:46 +0000</pubDate>
		<dc:creator>Laoer</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://i.laoer.com/?p=45</guid>
		<description><![CDATA[在Linux下如果某个文件夹下的文件非常多，用rm会报参数错误，不能删除，用下面的方法就可以删除了
find /your/full/path -type f -iname &#8220;*.*&#8221; -exec rm -rf {} \;
]]></description>
			<content:encoded><![CDATA[<p>在Linux下如果某个文件夹下的文件非常多，用rm会报参数错误，不能删除，用下面的方法就可以删除了</p>
<p>find /your/full/path -type f -iname &#8220;*.*&#8221; -exec rm -rf {} \;</p>
]]></content:encoded>
			<wfw:commentRss>http://i.laoer.com/linux-rm-file.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
