<?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>KP Solutions &#187; linux</title>
	<atom:link href="http://www.kpsolution.com/blog/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kpsolution.com/blog</link>
	<description>Solutions for Day to Day Technical Problems</description>
	<lastBuildDate>Tue, 24 Aug 2010 02:37:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>How to limit connections per User IP in Apache 2.2 CentOs</title>
		<link>http://www.kpsolution.com/blog/tips/how-to-limit-connections-per-user-ip-in-apache-2-2-centos/59/</link>
		<comments>http://www.kpsolution.com/blog/tips/how-to-limit-connections-per-user-ip-in-apache-2-2-centos/59/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 11:41:22 +0000</pubDate>
		<dc:creator>Ketan Patel</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.kpsolution.com/blog/?p=59</guid>
		<description><![CDATA[If you are a system admin or a webmaster, you will face this question at some point of time. How do I limit connections per user ip in Apache 2.2? Generally, you get good users visiting your site who use &#8230; <a href="http://www.kpsolution.com/blog/tips/how-to-limit-connections-per-user-ip-in-apache-2-2-centos/59/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you are a system admin or a webmaster, you will face this question at some point of time. How do I limit connections per user ip in Apache 2.2? Generally, you get good users visiting your site who use the site normally requesting one or two page at a time. But then there are a few malicious user who would want cause grief to you and your server by overloading the server with requests. To handle such malicious user, you need the mod_limitipconn module. This module keeps check on the number of connections a single ip can make simultaneously. There are configurable options that help you tune this module. So, now to the point.. How do I install this on my server?</p>
<p>I am outlining the steps for my server, ie. CentOs 5.2 with Apache 2.2</p>
<ul>
<li>wget http://dl.atrpms.net/all/mod_limitipconn-0.23-4.el5.x86_64.rpm</li>
<li>rpm -i mod_limitipconn-0.23-4.el5.x86_64.rpm</li>
<li>vi /etc/http/modules/ipconn.conf<br />
<blockquote><p>Add following to the content of ipconn.conf<br />
# LimitIPConn module limits the number of connection to apache<br />
# per IP address. This helps in limiting the simultaneous downloads and will help<br />
# prevent slow users from blocking your servers.<br />
#<br />
&lt;IfModule prefork.c&gt;<br />
LoadModule limitipconn_module modules/mod_limitipconn.so<br />
&lt;/IfModule&gt;</p></blockquote>
</li>
<li>Make sure &#8216;<strong>ExtendedStatus</strong>&#8216; is <strong>ON</strong> in /etc/httpd/conf/httpd.conf</li>
<li>You will have to configure the module for each of your virtual host that you need to implement the limitip for.<br />
<blockquote><p>&lt;IfModule mod_limitipconn.c&gt;<br />
&lt;Location /forums&gt;<br />
MaxConnPerIP 3<br />
# exempting images from the connection limit is often a good<br />
# idea if your web page has lots of inline images, since these<br />
# pages often generate a flurry of concurrent image requests<br />
NoIPLimit image/*<br />
&lt;/Location&gt;<br />
&lt;Location /video&gt;<br />
MaxConnPerIP 1<br />
# In this case, all MIME types other than audio/mpeg and video*<br />
# are exempt from the limit check<br />
OnlyIPLimit audio/mpeg video<br />
&lt;/Location&gt;<br />
&lt;/IfModule&gt;</p></blockquote>
</li>
<li>Save the config file and test the new configuration &#8220;/etc/init.d/httpd configtest&#8221;. If you get &#8220;Syntax OK&#8221;, then all you need to do is restart the server and you are good to go.</li>
</ul>
<p>This is a brief guide on how I got mod_limitipconn working on my server. If you have any questions, please feel free to post in comment and I will try to answer your questions.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kpsolution.com/blog/tips/how-to-limit-connections-per-user-ip-in-apache-2-2-centos/59/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to sync time in Linux, Unix</title>
		<link>http://www.kpsolution.com/blog/linux/how-to-sync-time-in-linux-unix/50/</link>
		<comments>http://www.kpsolution.com/blog/linux/how-to-sync-time-in-linux-unix/50/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 10:45:46 +0000</pubDate>
		<dc:creator>Ketan Patel</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.kpsolution.com/blog/?p=50</guid>
		<description><![CDATA[Very often, one would have seen that the server/desktop time goes off by some seconds/minutes than the standard time. It&#8217;s very easy to sync up the time in Linux/Unix. Issue the following command as &#8216;root&#8217; to update the time. ntpdate &#8230; <a href="http://www.kpsolution.com/blog/linux/how-to-sync-time-in-linux-unix/50/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Very often, one would have seen that the server/desktop time goes off by some seconds/minutes than the standard time.</p>
<p>It&#8217;s very easy to sync up the time in Linux/Unix. Issue the following command as &#8216;root&#8217; to update the time.</p>
<blockquote>
<pre><span>ntpdate</span> <span>pool</span><span>.</span><span>ntp</span><span>.</span><span>org</span></pre>
</blockquote>
<p>To automate this time update, you can set up a cron job to run once every week.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kpsolution.com/blog/linux/how-to-sync-time-in-linux-unix/50/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GoDaddy NameServer not registered</title>
		<link>http://www.kpsolution.com/blog/linux/godaddy-nameserver-not-registered/47/</link>
		<comments>http://www.kpsolution.com/blog/linux/godaddy-nameserver-not-registered/47/#comments</comments>
		<pubDate>Fri, 24 Jul 2009 02:46:49 +0000</pubDate>
		<dc:creator>Ketan Patel</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[domain]]></category>
		<category><![CDATA[godaddy]]></category>
		<category><![CDATA[nameserver]]></category>

		<guid isPermaLink="false">http://www.kpsolution.com/blog/?p=47</guid>
		<description><![CDATA[Recently, I moved over to a new host with a dedicated box and I had to setup the nameservers for my domain kpsolution.com. In Godaddy&#8217;s domain manager, I tried to change the nameservers to my domain like ns1.xxxx.com and ns2.xxxx.com, &#8230; <a href="http://www.kpsolution.com/blog/linux/godaddy-nameserver-not-registered/47/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Recently, I moved over to a new host with a dedicated box and I had to setup the nameservers for my domain kpsolution.com. In Godaddy&#8217;s domain manager, I tried to change the nameservers to my domain like ns1.xxxx.com and ns2.xxxx.com, but got an error that &#8220;<strong>Nameserver not registered</strong>&#8220;. This was puzzling as I had setup the slaves dns entries on my server correctly but Godaddy complained that &#8220;Nameserver not registered&#8221;.</p>
<p>Then I found that in the lower left corner, there&#8217;s a box with &#8220;Host Summary&#8221;. You have to add your nameservers entry in that box first. So click on &#8220;Add&#8221; besides &#8220;Host Summary&#8221; and it will present you another dialog where you can enter your subdomain and the ip address to point to your server. Once you have added your nameservers in Host Summary, then you can click on &#8220;Manage&#8221; besides &#8220;NameServers&#8221; and add your nameservers ns1.xxxx.com and ns2.xxxx.com there and Godaddy will happily accept it!!</p>
<p>Hope this saves you your time and help you avoid pulling your hair!!! <img src='http://www.kpsolution.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.kpsolution.com/blog/linux/godaddy-nameserver-not-registered/47/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use RSYNC to backup data on a second hard disk</title>
		<link>http://www.kpsolution.com/blog/linux/use-rsync-to-backup-data-on-a-second-hard-disk/42/</link>
		<comments>http://www.kpsolution.com/blog/linux/use-rsync-to-backup-data-on-a-second-hard-disk/42/#comments</comments>
		<pubDate>Thu, 22 Jan 2009 02:33:52 +0000</pubDate>
		<dc:creator>Ketan Patel</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[rsync]]></category>

		<guid isPermaLink="false">http://www.kpsolution.com/blog/?p=42</guid>
		<description><![CDATA[On a production server, if you have two hard disk and do not want to spend extra $50 each month, then you could use rsync to backup the data from your main disk to the second disk. It&#8217;s very easy &#8230; <a href="http://www.kpsolution.com/blog/linux/use-rsync-to-backup-data-on-a-second-hard-disk/42/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>On a production server, if you have two hard disk and do not want to spend extra $50 each month, then you could use rsync to backup the data from your main disk to the second disk. It&#8217;s very easy to setup. All you to do is use to the following scripts. Save the following script as /disk3/rsync_backup.sh</p>
<blockquote><p>#!/bin/bash<br />
unset PATH</p>
<p># USER VARIABLES<br />
BACKUPDIR=/disk3                            # Folder on the backup server where the backups shall be located<br />
#KEY=/root/.ssh/id_rsa                        # SSH key<br />
#MYSQL_BACKUPSCRIPT=/root/my_backup.sh        # Path to the remote mysql backup script<br />
#PRODUCTION_USER=root@production.server.com    # The user and the address of the production server<br />
EXCLUDES=/disk1/backup_exclude                # File containing the excluded directories<br />
DAYS=60                                        # The number of days after which old backups will be deleted</p>
<p># PATH VARIABLES<br />
SH=/bin/sh                                    # Location of the bash bin in the production server!!!!</p>
<p>CP=/bin/cp;                                    # Location of the cp bin<br />
FIND=/usr/bin/find;                            # Location of the find bin<br />
ECHO=/bin/echo;                                # Location of the echo bin<br />
MK=/bin/mkdir;                                # Location of the mk bin<br />
SSH=/usr/bin/ssh;                            # Location of the ssh bin<br />
DATE=/bin/date;                                # Location of the date bin<br />
RM=/bin/rm;                                    # Location of the rm bin<br />
GREP=/bin/grep;                                # Location of the grep bin<br />
MYSQL=/usr/bin/mysql;                        # Location of the mysql bin<br />
MYSQLDUMP=/usr/bin/mysqldump;                # Location of the mysql_dump bin<br />
RSYNC=/usr/bin/rsync;                        # Location of the rsync bin<br />
TOUCH=/bin/touch;                            # Location of the touch bin</p>
<p>##                                                      ##<br />
##      &#8211;       DO NOT EDIT BELOW THIS HERE     &#8211;     ##<br />
##                                                      ##</p>
<p># CREATING NECESSARY FOLDERS<br />
$MK $BACKUPDIR<br />
CURRENT=$BACKUPDIR/current<br />
OLD=$BACKUPDIR/old<br />
$MK $CURRENT<br />
$MK $OLD<br />
# CREATING CURRENT DATE / TIME<br />
NOW=`$DATE &#8216;+%Y-%m&#8217;-%d_%H:%M`<br />
NOW=$OLD/$NOW<br />
$MK $NOW</p>
<p># CREATE REMOTE MYSQL BACKUP BY RUNNING THE REMOTE BACKUP SCRIPT<br />
# $SSH -i $KEY $PRODUCTION_USER &#8220;$SH $MYSQL_BACKUPSCRIPT&#8221;</p>
<p># RUN RSYNC INTO CURRENT<br />
#$RSYNC                                                            \<br />
#    -apvz &#8211;delete &#8211;delete-excluded                        \<br />
#     &#8211;exclude-from=&#8221;$EXCLUDES&#8221;                                \<br />
#      -e &#8220;$SSH -i $KEY&#8221;                                        \<br />
#       $PRODUCTION_USER:/                                        \<br />
#        $CURRENT ;</p>
<p>// No Compression<br />
$RSYNC                                                            \<br />
-apv &#8211;delete &#8211;delete-excluded                        \<br />
&#8211;exclude-from=&#8221;$EXCLUDES&#8221;                                \<br />
/                                \<br />
$CURRENT ;</p>
<p># UPDATE THE MTIME TO REFELCT THE SNAPSHOT TIME<br />
$TOUCH $BACKUPDIR/current</p>
<p># MAKE HARDLINK COPY<br />
$CP -al $CURRENT/* $NOW</p>
<p># REMOVE OLD BACKUPS<br />
for FILE in &#8220;$( $FIND $OLD -maxdepth 1 -type d -mtime +$DAYS )&#8221;<br />
do<br />
#    $RM -Rf $FILE<br />
$ECHO $FILE<br />
done<br />
exit 0</p></blockquote>
<p>Save the following to /disk3/backup_exclude. Essentially, these are the files/folders you do not wish to backup using rsync.</p>
<blockquote><p>/disk3/<br />
/bin/<br />
/boot/<br />
/dev/<br />
/lib/<br />
/lost+found/<br />
/mnt/<br />
/opt/<br />
/proc/<br />
/sbin/<br />
/sys/<br />
/tmp/<br />
/usr/<br />
/var/log/<br />
/var/spool/<br />
/var/lib/php4/<br />
/var/lib/mysql/</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.kpsolution.com/blog/linux/use-rsync-to-backup-data-on-a-second-hard-disk/42/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enable dark background in Eclipse</title>
		<link>http://www.kpsolution.com/blog/linux/enable-dark-background-in-eclipse/33/</link>
		<comments>http://www.kpsolution.com/blog/linux/enable-dark-background-in-eclipse/33/#comments</comments>
		<pubDate>Wed, 05 Nov 2008 16:26:08 +0000</pubDate>
		<dc:creator>Ketan Patel</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[eclipse]]></category>

		<guid isPermaLink="false">http://www.kpsolution.com/blog/?p=33</guid>
		<description><![CDATA[I was looking around to find a good source which would allow me to control the background of the eclipse. I like black background with white text as foreground. Doing so in eclipse is not straightforward. My System setup is: &#8230; <a href="http://www.kpsolution.com/blog/linux/enable-dark-background-in-eclipse/33/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I was looking around to find a good source which would allow me to control the background of the eclipse. I like black background with white text as foreground. Doing so in eclipse is not straightforward.</p>
<p>My System setup is:</p>
<blockquote>
<ul>
<li>Ubuntu 8.10</li>
<li>Eclipse Ganymede (3.4) with CDT</li>
</ul>
</blockquote>
<p>Follow the steps to get black background with white foreground for source code editing part of eclipse.</p>
<ol>
<li>Select Window -&gt; Preferences -&gt; C/C++ (language editor you need to change for) -&gt; Editor. In the Appearance color options change the following
<ul>
<li>Matching brackets highlight (Color #FFA500)</li>
<li>Inactive code highlight (Color #302E2E)</li>
<li>Completion Proposal background (Color #000000)</li>
<li>Completion Proposal foreground (Color #FFFFFF)</li>
<li>Parameter Hint Background (Color #000000)</li>
<li>Parameter Hint Foreground (Color #FFFFFF)</li>
<li>Source Hover Background (Color #F5F5B5)</li>
</ul>
</li>
<li>Select Window -&gt; Preferences -&gt; C/C++ (language editor you need to change for) -&gt; Editor -&gt; Syntax Coloring
<ul>
<li>In the Code, change all the ones with black color to white and vice versa and leave the rest as they are.</li>
</ul>
</li>
</ol>
<p>This will give you the colors you want. I know its tedious but that&#8217;s the only way to do it at present.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kpsolution.com/blog/linux/enable-dark-background-in-eclipse/33/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to generate a patch?</title>
		<link>http://www.kpsolution.com/blog/linux/how-to-generate-a-patch/29/</link>
		<comments>http://www.kpsolution.com/blog/linux/how-to-generate-a-patch/29/#comments</comments>
		<pubDate>Mon, 03 Nov 2008 20:48:57 +0000</pubDate>
		<dc:creator>Ketan Patel</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[patch]]></category>
		<category><![CDATA[source]]></category>

		<guid isPermaLink="false">http://www.kpsolution.com/blog/?p=29</guid>
		<description><![CDATA[To generate a patch for your modified code. All you have to do is generate a diff between original and modified source files using the following command and save the output to the patch file. diff -rup /home/ketan/unmodified_source.c /home/ketan/modified_source.c &#62; &#8230; <a href="http://www.kpsolution.com/blog/linux/how-to-generate-a-patch/29/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>To generate a patch for your modified code. All you have to do is generate a diff between original and modified source files using the following command and save the output to the patch file.</p>
<blockquote><p>diff -rup /home/ketan/unmodified_source.c /home/ketan/modified_source.c &gt; patch.source.c</p></blockquote>
<p>Now to apply patch to the original unmodified source. Use the following command from the appropriate location (/home/ketan) in our example.</p>
<blockquote><p>patch -p0 &lt; patch.source.c</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.kpsolution.com/blog/linux/how-to-generate-a-patch/29/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Readelf &#8211; Very useful Command</title>
		<link>http://www.kpsolution.com/blog/linux/readelf-very-useful-command/25/</link>
		<comments>http://www.kpsolution.com/blog/linux/readelf-very-useful-command/25/#comments</comments>
		<pubDate>Thu, 23 Oct 2008 16:03:26 +0000</pubDate>
		<dc:creator>Ketan Patel</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[commands]]></category>

		<guid isPermaLink="false">http://www.kpsolution.com/blog/?p=25</guid>
		<description><![CDATA[Till now I have been using &#8216;ldd&#8217; for checking out the dependencies for a linux executable. But recently I discovered, &#8216;readelf&#8217;. It is really amazing utility and comes in very handy when you are analyzing a utility intended for a &#8230; <a href="http://www.kpsolution.com/blog/linux/readelf-very-useful-command/25/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Till now I have been using &#8216;ldd&#8217; for checking out the dependencies for a linux executable. But recently I discovered, &#8216;readelf&#8217;. It is really amazing utility and comes in very handy when you are analyzing a utility intended for a different target instead of your workstation. This will exactly tell what libraries it needs and what address it is mounting on.</p>
<p>Check it out today, &#8216;<em><strong>readelf -a &lt;binary_executable&gt;</strong></em>&#8216;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kpsolution.com/blog/linux/readelf-very-useful-command/25/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to add a user to a group?</title>
		<link>http://www.kpsolution.com/blog/linux/how-to-add-a-user-to-a-group/22/</link>
		<comments>http://www.kpsolution.com/blog/linux/how-to-add-a-user-to-a-group/22/#comments</comments>
		<pubDate>Tue, 30 Sep 2008 11:21:44 +0000</pubDate>
		<dc:creator>Ketan Patel</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[group]]></category>
		<category><![CDATA[user]]></category>

		<guid isPermaLink="false">http://www.kpsolution.com/blog/?p=22</guid>
		<description><![CDATA[I keep on forgetting this command, so I put it here to remember it forever. To add a user &#8216;ketan&#8217; to the group &#8216;admin&#8217;, do the following gpasswd -a ketan  admin Such a simple and each to use command!!!]]></description>
			<content:encoded><![CDATA[<p>I keep on forgetting this command, so I put it here to remember it forever. To add a user &#8216;ketan&#8217; to the group &#8216;admin&#8217;, do the following</p>
<blockquote><p>gpasswd -a ketan  admin</p></blockquote>
<p>Such a simple and each to use command!!!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kpsolution.com/blog/linux/how-to-add-a-user-to-a-group/22/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to create SVN repository?</title>
		<link>http://www.kpsolution.com/blog/linux/how-to-create-svn-repository/18/</link>
		<comments>http://www.kpsolution.com/blog/linux/how-to-create-svn-repository/18/#comments</comments>
		<pubDate>Tue, 30 Sep 2008 00:55:39 +0000</pubDate>
		<dc:creator>Ketan Patel</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://www.kpsolution.com/blog/company/18/18/</guid>
		<description><![CDATA[This post will help you create a new SVN repository and it assumes you have the SVN installed &#38; configured on your computer/server. To create the repository for first time, issue the following command svnadmin create &#8211;fs-type fsfs /var/www/subversion/kpsolution Then &#8230; <a href="http://www.kpsolution.com/blog/linux/how-to-create-svn-repository/18/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This post will help you create a new SVN repository and it assumes you have the SVN installed &amp; configured on your computer/server.</p>
<p>To create the repository for first time, issue the following command</p>
<blockquote><p>svnadmin create &#8211;fs-type fsfs /var/www/subversion/kpsolution</p></blockquote>
<p>Then to import your code for first time, go to your base directory of the source tree and then issue the following command</p>
<blockquote><p>svn import -m &#8220;Initial Import&#8221; . file:///var/www/subversion/kpsolution/</p></blockquote>
<p>Now, you have imported your source code into the repository and then use the SVN GUI to checkin/checkout the changes.</p>
<p>For more detailed instruction on setting up the svn, see &#8220;http://www.rockfloat.com/howto/gentoo-subversion.html&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kpsolution.com/blog/linux/how-to-create-svn-repository/18/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mysqld.log grows too big in size</title>
		<link>http://www.kpsolution.com/blog/linux/mysqldlog-grows-too-big-in-size/12/</link>
		<comments>http://www.kpsolution.com/blog/linux/mysqldlog-grows-too-big-in-size/12/#comments</comments>
		<pubDate>Mon, 29 Sep 2008 14:03:03 +0000</pubDate>
		<dc:creator>Ketan Patel</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[crash]]></category>
		<category><![CDATA[log]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.kpsolution.com/blog/?p=12</guid>
		<description><![CDATA[Recently on one of our new servers, we had an issue where the mysql daemon had halted on bus error. We couldn&#8217;t stop the mysql daemon using /etc/init.d/mysqld stop Then I looked at the error-log file for mysql in /var/log/mysql-error.log &#8230; <a href="http://www.kpsolution.com/blog/linux/mysqldlog-grows-too-big-in-size/12/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Recently on one of our new servers, we had an issue where the mysql daemon had halted on bus error. We couldn&#8217;t stop the mysql daemon using</p>
<blockquote><p>/etc/init.d/mysqld stop</p></blockquote>
<p>Then I looked at the error-log file for mysql in /var/log/mysql-error.log and found that the disk didn&#8217;t had any empty space left and correctly enough, when I did</p>
<blockquote><p>df -h</p></blockquote>
<p>I saw that the /var mounted partition didn&#8217;t had any diskspace remaining. To find the exact culprit I looked around in the /var directory and found that the &#8216;mysqld.log&#8217; file was 9GB large. I was puzzled as to how come this log grew so big. Thoughts came that the server would have been compromised but the actual culprit was the my.cnf file for the mysql. During the setup of the server, by mistake I had put a statement</p>
<blockquote><p>[mysqld]</p>
<p>log=/var/log/mysqld.log</p></blockquote>
<p>This configuration was causing to save all the queries that were performed on the mysql server since it booted. Naturally on a high traffic site, you will see this file grow huge quickly. I learned the lesson hard way, but always RTFM when you are configuring something on the production server. So for solution, all I had to was remove the mysqld.log file and comment out the above &#8220;log&#8221; configuration in the my.cnf.</p>
<p>I thought to post this out there to help other people in case they have the same issue.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kpsolution.com/blog/linux/mysqldlog-grows-too-big-in-size/12/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
