<?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/tag/linux/feed" rel="self" type="application/rss+xml" />
	<link>http://i.laoer.com</link>
	<description>技术、生活、感悟 -- Laoer的博客</description>
	<lastBuildDate>Mon, 30 Jan 2012 10:03:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>在hostmonster主机上安装MediaWiki出现的500问题</title>
		<link>http://i.laoer.com/mediawiki-on-hostmonster-500.html</link>
		<comments>http://i.laoer.com/mediawiki-on-hostmonster-500.html#comments</comments>
		<pubDate>Tue, 03 Nov 2009 02:34:53 +0000</pubDate>
		<dc:creator>Laoer</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MediaWiki]]></category>

		<guid isPermaLink="false">http://i.laoer.com/?p=381</guid>
		<description><![CDATA[今天在hostmonster主机上安装MediaWiki，按照文档要求把config目录更改权限 chmod a+w config 但做初始化配置时出现了500服务器内部错误，非常奇怪，我搜了一下相关信息，发现是config目录权限有问题，还是改回755，之后安装，就没有问题了。]]></description>
			<content:encoded><![CDATA[<p>今天在hostmonster主机上安装MediaWiki，按照文档要求把config目录更改权限</p>
<p>chmod a+w config</p>
<p>但做初始化配置时出现了500服务器内部错误，非常奇怪，我搜了一下相关信息，发现是config目录权限有问题，还是改回755，之后安装，就没有问题了。</p>
]]></content:encoded>
			<wfw:commentRss>http://i.laoer.com/mediawiki-on-hostmonster-500.html/feed</wfw:commentRss>
		<slash:comments>1</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 [...]]]></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 / [...]]]></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>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; if &#91; ! -z &#34;$CATALINA_PID&#34; &#93;; then echo $! [...]]]></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 “$@” start  \<br />
&gt;&gt; “$CATALINA_BASE”/logs/catalina.out 2&gt;&amp;1 &amp;<br />
为<br />
org.apache.catalina.startup.Bootstrap “$@” start 2&gt;&amp;1 \<br />
| /usr/local/sbin/cronolog “$CATALINA_BASE”/logs/catalina.%Y-%m-%d.out &gt;&gt; /dev/null &amp;<br />
同时，上面有一行<br />
touch “$CATALINA_BASE”/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 [...]]]></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=”decodeutfkeys”<br />
LoadPlugin=”geoip GEOIP_STANDARD /usr/local/apache/cgi-bin/awstats/GeoIP.dat”<br />
LoadPlugin=”geoip_city_maxmind GEOIP_STANDARD /usr/local/apache/cgi-bin/awstats/GeoLiteCity.dat”</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 “common.conf”<br />
LogFile=”/usr/local/apache/logs/domainname-access_log.%YYYY-24%MM-24%DD-24&#8243;<br />
SiteDomain=”domainname”<br />
DefaultFile=”index.html”<br />
DirData=”/usr/local/apache/cgi-bin/awstats/data/”<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 “*.*” -exec rm -rf {} \;]]></description>
			<content:encoded><![CDATA[<p>在Linux下如果某个文件夹下的文件非常多，用rm会报参数错误，不能删除，用下面的方法就可以删除了</p>
<p>find /your/full/path -type f -iname “*.*” -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>

