<?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>PRESOON.COM &#187; Cpanel</title>
	<atom:link href="http://presoon.com/blog/category/cpanel/feed/" rel="self" type="application/rss+xml" />
	<link>http://presoon.com/blog</link>
	<description></description>
	<lastBuildDate>Sat, 20 Mar 2010 03:59:50 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to install CSF Firewall on virtuozzo &#8211; Cannot enter into server after CSF installation VPS</title>
		<link>http://presoon.com/blog/2010/03/14/how-to-install-csf-firewall-on-virtuozzo-cannot-enter-into-server-after-csf-installation-vps/</link>
		<comments>http://presoon.com/blog/2010/03/14/how-to-install-csf-firewall-on-virtuozzo-cannot-enter-into-server-after-csf-installation-vps/#comments</comments>
		<pubDate>Sat, 13 Mar 2010 23:03:04 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Cpanel]]></category>
		<category><![CDATA[Installation]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[cannot access vps after csf installation]]></category>
		<category><![CDATA[csf in vps]]></category>
		<category><![CDATA[iptables modules]]></category>
		<category><![CDATA[virtuzzo]]></category>

		<guid isPermaLink="false">http://presoon.com/blog/?p=186</guid>
		<description><![CDATA[CSF is a powerful Firewall for Linux and cPanel servers are here are the steps to get it working with Virtuozzo VPS
Installation
rm -fv csf.tgz
wget http://www.configserver.com/free/csf.tgz
tar -xzf csf.tgz
cd csf
sh install.sh
After the installation you will need to customize CSF to run on VPS:
edit /etc/sysconfig/iptables and add
-A FORWARD -j ACCEPT -p all -s 0/0 -i venet0
-A FORWARD -j [...]]]></description>
			<content:encoded><![CDATA[<p>CSF is a powerful Firewall for Linux and cPanel servers are here are the steps to get it working with Virtuozzo VPS</p>
<p><strong>Installation</strong></p>
<pre><code>rm -fv csf.tgz
wget http://www.configserver.com/free/csf.tgz
tar -xzf csf.tgz
cd csf
sh install.sh</code></pre>
<p><strong>After the installation you will need to customize CSF to run on VPS:</strong></p>
<p>edit /etc/sysconfig/iptables and add</p>
<pre><code>-A FORWARD -j ACCEPT -p all -s 0/0 -i venet0
-A FORWARD -j ACCEPT -p all -s 0/0 -o venet0
-A INPUT -i venet0 -j ACCEPT
-A OUTPUT -o venet0 -j ACCEPT</code></pre>
<p>create file /etc/csf/csfpre.sh and enter all the extra rules directly into it prefixed with &#8220;iptables&#8221; so the contents of that file should look something like:</p>
<pre><code>iptables -A INPUT -i venet0 -j ACCEPT
iptables -A OUTPUT -o venet0 -j ACCEPT
iptables -A FORWARD -j ACCEPT -p all -s 0/0 -i venet0
iptables -A FORWARD -j ACCEPT -p all -s 0/0 -o venet0</code></pre>
<p>edit /etc/csf/csf.conf file and add<br />
and search for</p>
<pre><code>ETH_DEVICE = ""

change to

ETH_DEVICE = "venet+"</code></pre>
<p>Restart</p>
<pre><code>/usr/sbin/csf -r</code></pre>
<p><strong>LOCKOUT ISSUES FOR CSF WHEN INSTALLED IN VPS. or  Cannot enter into server after CSF installation on VPS</strong></p>
<p>If the required IP table modules are not properly loaded to the container node, you may lockout yourself after the installation. If you have access to the main Hardware node, you can perform the following to get it up or ask your VPS provider to perform this on the Hardware (main) node.</p>
<p>Before enabling iptables on VPS, it needs to make sure that the iptables modules are enabled on the Hardware Node. In order to enable iptables modules on Hardware Node, edit /etc/sysconfig/iptables-config file on a Virtuozzo hardware node and look for the following parameter value: IPTABLES_MODULES=.  Edit it as the following.</p>
<pre><code>IPTABLES_MODULES=”ipt_REJECT ipt_tos ipt_TOS ipt_LOG ip_conntrack ipt_limit ipt_multiport iptable_filter iptable_mangle ipt_TCPMSS ipt_tcpmss ipt_ttl ipt_length ipt_state iptable_nat ip_nat_ftp”</code></pre>
<p>Also edit /etc/sysconfig/vz file on a hardware node and look for the following parameter value: IPTABLES= , change it to the following.</p>
<pre><code>IPTABLES=”ipt_REJECT ipt_tos ipt_TOS ipt_LOG ip_conntrack ipt_limit ipt_multiport iptable_filter iptable_mangle ipt_TCPMSS ipt_tcpmss ipt_ttl ipt_length ipt_state iptable_nat ip_nat_ftp” </code></pre>
<p>Now your Hardware node is fine. You need to enable the iptable modules to the VPS nodes.<br />
(CID &#8212; container ID. You can find the value for each node by using the command vzlist -a)</p>
<pre><code>vzctl stop CID

vzctl set CID --iptables ipt_REJECT --iptables ipt_tos --iptables ipt_TOS --iptables ipt_LOG --iptables ip_conntrack --iptables ipt_limit --iptables ipt_multiport --iptables iptable_filter --iptables iptable_mangle --iptables ipt_TCPMSS --iptables ipt_tcpmss --iptables ipt_ttl --iptables ipt_length  --iptables ipt_state --iptables iptable_nat --iptables ip_nat_ftp --save

vzctl set CID --numiptent 2000 --save

vzctl start CID</code></pre>
<p>Now try entering into your node and restart CSF. It should start working fine.</p>
<p><strong>Descriptions and Functions</strong></p>
<p>======================</p>
<p><strong>csf+lfd  works on all Linux servers on the Operating Systems listed above, with or without cPanel</strong></p>
<p>This suite of scripts provides:</p>
<ul>
<li>Straight-forward SPI iptables firewall script</li>
<li>Daemon process that checks for login authentication failures for:
<ul>
<li>Courier imap, Dovecot, uw-imap, Kerio</li>
<li>openSSH</li>
<li>cPanel, WHM, Webmail (cPanel servers only)</li>
<li>Pure-pftd, vsftpd, Proftpd</li>
<li>Password protected web pages (htpasswd)</li>
<li>Mod_security failures (v1 and v2)</li>
<li>Suhosin failures</li>
<li>Exim SMTP AUTH</li>
<li>Custom login failures with separate log file and regular expression matching</li>
</ul>
</li>
<li>POP3/IMAP login tracking to enforce logins per hour</li>
<li>SSH login notification</li>
<li>SU login notification</li>
<li>Excessive connection blocking</li>
<li>WHM  configuration interface  (cPanel servers only) or through Webmin</li>
<li>WHM iptables report log  (cPanel servers only)</li>
<li>Easy upgrade between versions from within WHM  (cPanel servers only) or through Webmin</li>
<li>Easy upgrade between versions from shell</li>
<li>A  standard Webmin Module to configure csf is included in the distribution ready to install into Webmin &#8211; csfwebmin.tgz</li>
<li>Pre-configured to work on a cPanel server with all the standard cPanel ports open (cPanel servers only)</li>
<li>Auto-configures the SSH port if it&#8217;s non-standard on installation</li>
<li>Block traffic on unused server IP addresses &#8211; helps reduce the risk to your server</li>
<li>Alert when end-user scripts sending excessive emails per hour &#8211; for identifying spamming scripts</li>
<li>Suspicious process reporting &#8211; reports potential exploits running on the server</li>
<li>Excessive  user processes reporting</li>
<li>Excessive  user process usage reporting and optional termination</li>
<li>Suspicious file reporting &#8211; reports potential exploit files in /tmp and similar directories</li>
<li>Directory and file watching &#8211; reports if a watched directory or a file changes</li>
<li>Block traffic on the <a href="http://www.dshield.org/block_list_info.php" target="_blank">DShield Block List</a> and the <a href="http://www.spamhaus.org/drop/index.lasso" target="_blank">Spamhaus DROP List</a></li>
<li>BOGON packet protection</li>
<li>Pre-configured settings for Low, Medium or High firewall security (cPanel servers only)</li>
<li>Works with multiple ethernet devices</li>
<li>Server Security Check &#8211; Performs a basic security and settings check on the server (cPanel servers only)</li>
<li>Allow Dynamic	DNS IP addresses &#8211; always allow  your IP address even if it changes whenever you connect to the internet</li>
<li>Alert sent if server load average remains high for a specified length of time</li>
<li>mod_security log reporting (if installed)</li>
<li>Email relay tracking &#8211; tracks all email sent through the server  and issues alerts for excessive usage (cPanel servers only)</li>
<li>IDS (Intrusion Detection System) &#8211; the last line of detection alerts you to changes to system and application binaries</li>
<li>SYN Flood protection</li>
<li>Ping of death protection</li>
<li>Port Scan tracking and blocking</li>
<li>Permanent <em>and</em> Temporary (with TTL) IP blocking</li>
<li>Exploit checks</li>
<li>Account modification tracking &#8211; sends alerts if an account entry is modified, e.g. if the password is changed or the login shell</li>
<li>Shared syslog aware</li>
<li><span class="style1">New in v4: </span> Messenger Service &#8211; Allows you to redirect connection requests from blocked IP addresses to preconfigured text and html pages to inform the visitor that they have been blocked in the firewall. This can be particularly useful for those with a large user base and help process support requests more efficiently</li>
<li><span class="style1">New in v4: </span> Country Code blocking &#8211; Allows you to deny or allow access by country &#8211; <a href="http://www.ipdeny.com/" target="_blank">Powered by IPDENY.COM IP database</a></li>
<li><span class="style1">New in v4: </span> Port Flooding Detection &#8211; Per IP, per Port connection flooding detection and mitigation to help block DOS attacks</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://presoon.com/blog/2010/03/14/how-to-install-csf-firewall-on-virtuozzo-cannot-enter-into-server-after-csf-installation-vps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>phpMyAdmin &#8211; Error &#8220;cannot start session without errors&#8221;</title>
		<link>http://presoon.com/blog/2010/03/14/phpmyadmin-error-cannot-start-session-without-errors/</link>
		<comments>http://presoon.com/blog/2010/03/14/phpmyadmin-error-cannot-start-session-without-errors/#comments</comments>
		<pubDate>Sat, 13 Mar 2010 22:23:38 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Cpanel]]></category>
		<category><![CDATA[phpmyadmin]]></category>
		<category><![CDATA[session errors]]></category>

		<guid isPermaLink="false">http://presoon.com/blog/?p=182</guid>
		<description><![CDATA[cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly.
The usual error which comes up with phpmyadmin. The issue can either be due to the cPanel&#8217;s PHP or its session settings. Try the following fix
Open up the file /usr/local/cpanel/3rdparty/etc/phpmyadmin/php.ini
Change the session path to [...]]]></description>
			<content:encoded><![CDATA[<pre><code>cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly.</code></pre>
<p>The usual error which comes up with phpmyadmin. The issue can either be due to the cPanel&#8217;s PHP or its session settings. Try the following fix</p>
<p>Open up the file /usr/local/cpanel/3rdparty/etc/phpmyadmin/php.ini</p>
<p>Change the session path to /tmp</p>
<p>From</p>
<pre><code>session.save_handler = sqlite
session.save_path =/var/cpanel/userhomes/cpanelphpmyadmin/sessions</code></pre>
<p>To</p>
<pre><code>session.save_handler = files
session.save_path = /tmp </code></pre>
]]></content:encoded>
			<wfw:commentRss>http://presoon.com/blog/2010/03/14/phpmyadmin-error-cannot-start-session-without-errors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Awstats &#8220;update now&#8221; button shows blank page and cpanel error log shows &#8220;Out of Memory&#8221;</title>
		<link>http://presoon.com/blog/2010/02/27/awstats-update-now-button-shows-blank-page-and-cpanel-error-log-shows-out-of-memory/</link>
		<comments>http://presoon.com/blog/2010/02/27/awstats-update-now-button-shows-blank-page-and-cpanel-error-log-shows-out-of-memory/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 23:54:47 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Cpanel]]></category>
		<category><![CDATA[Out of Memory!]]></category>
		<category><![CDATA[shows blank page]]></category>
		<category><![CDATA[white page Awstats]]></category>

		<guid isPermaLink="false">http://presoon.com/blog/?p=178</guid>
		<description><![CDATA[The cPanel error logs shows Out of Memory! when you click the &#8220;update now&#8221; button in Awstats. This usually happens when cPanel&#8217;s php is set with low memory. But in most of the cases this is not the issue.
Go to WHM &#62; Tweak Settings &#62; &#8220;The maximum memory a cPanel process can use before it [...]]]></description>
			<content:encoded><![CDATA[<p>The cPanel error logs shows Out of Memory! when you click the &#8220;update now&#8221; button in Awstats. This usually happens when cPanel&#8217;s php is set with low memory. But in most of the cases this is not the issue.</p>
<p>Go to WHM &gt; Tweak Settings &gt; &#8220;The maximum memory a cPanel process can use before it is killed off (in megabytes). Values less than 128 megabytes can not be specified. A value of &#8220;0&#8243; will disable the memory limits.&#8221;</p>
<p>Set this to 0 or a higher value..</p>
<p>In the Awstats case, the cPanel processes memory is getting exhausted.</p>
<p>This can be done also by editing the file /var/cpanel/cpanel.config</p>
<pre><code>maxmem=0
/usr/local/cpanel/whostmgr/bin/whostmgr2 --updatetweaksettings</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://presoon.com/blog/2010/02/27/awstats-update-now-button-shows-blank-page-and-cpanel-error-log-shows-out-of-memory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Custom php.ini for PHP CGI in cPanel.</title>
		<link>http://presoon.com/blog/2010/02/26/custom-php-ini-for-php-cgi-in-cpanel/</link>
		<comments>http://presoon.com/blog/2010/02/26/custom-php-ini-for-php-cgi-in-cpanel/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 22:06:50 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Cpanel]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[custom php.ini]]></category>
		<category><![CDATA[php-cgi]]></category>
		<category><![CDATA[php.ini not working]]></category>
		<category><![CDATA[php_cgi]]></category>

		<guid isPermaLink="false">http://presoon.com/blog/?p=171</guid>
		<description><![CDATA[Hi guys,
When PHP is compiled as CGI, you won&#8217;t be able to provide custom php flags in .htaccess or just simply add a php.ini if your home directory.
To enable a custom php.ini for your domain running PHP as cgi, perform the following steps.
Please note that I am considering that the server has PHP4 and PHP5 [...]]]></description>
			<content:encoded><![CDATA[<p>Hi guys,</p>
<p>When PHP is compiled as CGI, you won&#8217;t be able to provide custom php flags in .htaccess or just simply add a php.ini if your home directory.</p>
<p>To enable a custom php.ini for your domain running PHP as cgi, perform the following steps.</p>
<p>Please note that I am considering that the server has PHP4 and PHP5 where PHP4 is default (dso)-not relevant and PHP5 (cgi)</p>
<p><strong>My username is &#8220;presoon&#8221; so my home directory will be &#8220;/home/presoon&#8221; (replace with yours)</strong></p>
<p>create a custom cgi script in your cgi-bin directory.</p>
<pre><code>vi /home/presoon/public_html/cgi-bin/php.cgi</code></pre>
<p>add the following contents.</p>
<pre><code>#!/bin/sh
exec /usr/local/cpanel/cgi-sys/php5 -c /home/presoon/public_html/</code></pre>
<p>You should have the custom php.ini at &#8220;/home/presoon/public_html/&#8221;</p>
<pre><code>chown presoon.presoon /home/presoon/public_html/cgi-bin/php.cgi
chmod 755 /home/presoon/public_html/cgi-bin/php.cgi</code></pre>
<p>Now to the .htaccess file at &#8220;/home/presoon/public_html/&#8221;<br />
Add the following</p>
<pre><code>AddHandler application/x-httpd-php5 .php
Action application/x-httpd-php5 /cgi-bin/php.cgi</code></pre>
<p>Please note that AddHandler given above is to change default php to PHP5. If you have only PHP5 which is compiled as CGI, you can remove the directive AddHandler from .htaccess.</p>
<p>Now the values given in your php.ini at /home/presoon/public_html/ should reflect you info page. <img src='http://presoon.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://presoon.com/blog/2010/02/26/custom-php-ini-for-php-cgi-in-cpanel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing ImageMagick on a cPanel Server</title>
		<link>http://presoon.com/blog/2010/01/28/installing-imagemagick-on-a-cpanel-server/</link>
		<comments>http://presoon.com/blog/2010/01/28/installing-imagemagick-on-a-cpanel-server/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 15:50:55 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Cpanel]]></category>
		<category><![CDATA[Image magic php]]></category>
		<category><![CDATA[ImageMagick]]></category>
		<category><![CDATA[Imagemagick php]]></category>
		<category><![CDATA[imagemagik]]></category>

		<guid isPermaLink="false">http://presoon.com/blog/?p=161</guid>
		<description><![CDATA[Make sure that Imagemagick is not installed via Easyapache3. If you already have ImageMagick installed via rpm, you need to remove it. Find the rpms using the following command.
rpm -qa &#124;grep -i imagemagick
Remove the rpms in the following order
rpm -e ImageMagick-c++-devel-6.2.8.0-4.el5_1.1
rpm -e ImageMagick-c++-6.2.8.0-4.el5_1.1
rpm -e ImageMagick-perl-6.2.8.0-4.el5_1.1
rpm -e ImageMagick-devel-6.2.8.0-4.el5_1.1
rpm -e ImageMagick-6.2.8.0-4.el5_1.1
Download the ImageMagick using the following
cd /usr/local/src
wget [...]]]></description>
			<content:encoded><![CDATA[<p>Make sure that Imagemagick is not installed via Easyapache3. If you already have ImageMagick installed via rpm, you need to remove it. Find the rpms using the following command.</p>
<pre><code>rpm -qa |grep -i imagemagick</code></pre>
<p>Remove the rpms in the following order</p>
<pre><code>rpm -e ImageMagick-c++-devel-6.2.8.0-4.el5_1.1
rpm -e ImageMagick-c++-6.2.8.0-4.el5_1.1
rpm -e ImageMagick-perl-6.2.8.0-4.el5_1.1
rpm -e ImageMagick-devel-6.2.8.0-4.el5_1.1
rpm -e ImageMagick-6.2.8.0-4.el5_1.1</code></pre>
<p>Download the ImageMagick using the following</p>
<pre><code>cd /usr/local/src
wget http://ftp.nluug.nl/ImageMagick/ImageMagick-6.4.3-6.zip
unzip ImageMagick-6.4.3-6.zip
cd ImageMagick-6.4.3</code></pre>
<p>Installation</p>
<pre><code>./configure
make install</code></pre>
<p>This may take a while to complete. Finally,</p>
<pre><code>cd PerlMagick/
perl Makefile.PL
make
make install</code></pre>
<p><strong>Add PHP Pecl extension to access ImageMagick via PHP<br />
</strong></p>
<p>Login to WHM,</p>
<p>WHM &gt; Software &gt; Module Installers &gt; PHP Pecl</p>
<p>install imagick</p>
<p>ImageMagick should be installed now.</p>
<p>If WHM can&#8217;t find the ImageMagic installation</p>
<p>Firstly install  ImageMagick-devel</p>
<pre><code>yum -y install ImageMagick-devel</code></pre>
<p>Once that is done, you need to download the Imagick PHP extensions from:</p>
<p>http://pecl.php.net/package/imagick</p>
<pre><code>cd /usr/local/src/
wget http://pecl.php.net/get/imagick-2.2.0.tgz
tar -zxvf imagick-2.2.0 .tgz
cd imagick-2.2.0
phpize
./configure

make
make install</code></pre>
<p>find the php.ini using the command</p>
<pre><code>php -i |grep php.ini</code></pre>
<p>add the following line to php.ini</p>
<pre><code>extension="imagick.so"</code></pre>
<p>restart Apache and you are done.</p>
]]></content:encoded>
			<wfw:commentRss>http://presoon.com/blog/2010/01/28/installing-imagemagick-on-a-cpanel-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to change Mysql database directory to another partition in cPanel. /var patition full</title>
		<link>http://presoon.com/blog/2010/01/07/how-to-change-mysql-database-directory-to-another-partition-in-cpanel-var-patition-full/</link>
		<comments>http://presoon.com/blog/2010/01/07/how-to-change-mysql-database-directory-to-another-partition-in-cpanel-var-patition-full/#comments</comments>
		<pubDate>Thu, 07 Jan 2010 07:39:59 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Centos]]></category>
		<category><![CDATA[Cpanel]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mysql]]></category>
		<category><![CDATA[/var partition full]]></category>
		<category><![CDATA[/var/lib/mysql]]></category>
		<category><![CDATA[change mysql data directory in mysql]]></category>
		<category><![CDATA[move /var/lib/mysql to another partition]]></category>
		<category><![CDATA[separate mysql data directory]]></category>

		<guid isPermaLink="false">http://presoon.com/blog/?p=154</guid>
		<description><![CDATA[Hi guys,
you might have faced the issue of /var partition gettting full regularly due to database directory. If you have a larger partition with free space, then it is possible to move the database directory to the larger partition.
Here are the steps
Switch off the database server while we are moving the databases.

/etc/rc.d/init.d/mysql stop

I am considering [...]]]></description>
			<content:encoded><![CDATA[<p>Hi guys,</p>
<p>you might have faced the issue of /var partition gettting full regularly due to database directory. If you have a larger partition with free space, then it is possible to move the database directory to the larger partition.</p>
<p>Here are the steps</p>
<p>Switch off the database server while we are moving the databases.</p>
<pre>
<code>/etc/rc.d/init.d/mysql stop</code>
</pre>
<p>I am considering that I have enough space in /home partition. Here goes my new database data directory as /home/mysql</p>
<p>Now it is better to copy the database first, rather than move.</p>
<pre>
<code>cp -pr /var/lib/mysql /home
mv /var/lib/mysql /var/lib/mysql-bk</code>
</pre>
<p>We are copying the database to the new location since it is better to revert back the settings with minimum downtime, if anything goes wrong.</p>
<p>move to /tmp</p>
<pre>
<code>cd /tmp
unlink mysql.sock
ln -s /home/mysql/mysql.sock /tmp/mysql.sock</code>
</pre>
<p>Take a backup of /etc/my.cnf</p>
<p>Now edit /etc/my.cnf</p>
<pre>
<code>vi /etc/my.cnf

add the line
datadir=/home/mysql</code>
</pre>
<p>If the socket file is specified, comment it out.</p>
<p>Now move to /var/lib/mysql and create a symblink</p>
<pre>
<code>ln -s /home/mysql /var/lib/mysql</code>
</pre>
<p>(Please note that you don&#8217;t specify the socket file location in my.cnf since it causes issues with phpMyadmin)</p>
<p>For, cPanel server, edit the phpMyadmin configuration<br />
take a backup of &#8220;/usr/local/cpanel/base/3rdparty/phpMyAdmin/config.inc.php&#8221;</p>
<pre>
<code>edit this file /usr/local/cpanel/base/3rdparty/phpMyAdmin/config.inc.php
vi /usr/local/cpanel/base/3rdparty/phpMyAdmin/config.inc.php</code>
</pre>
<p>add the following lines. If they already exist, edit as below.<br />
(the connect_type usually exist at &#8220;tcp&#8221; change it to &#8220;socket&#8221;)</p>
<pre>
<code>$cfg['Servers'][$i]['socket'] = ‘/home/mysql/mysql.sock’;
$cfg['Servers'][$i]['connect_type'] = ’socket’;</code>
</pre>
<p>Now start the database server.</p>
<pre>
<code>/etc/rc.d/ini.d/mysql start</code>
</pre>
<p>If it starts fine, you are done. Check the database connections of your site.<br />
You can now remove the directory /var/lib/mysql-bk</p>
<p>Suggestions, questions are welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://presoon.com/blog/2010/01/07/how-to-change-mysql-database-directory-to-another-partition-in-cpanel-var-patition-full/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Excessive mail sent by an user alert for cPanel</title>
		<link>http://presoon.com/blog/2009/11/11/excessive-mail-sent-by-an-user-alert-for-cpanel/</link>
		<comments>http://presoon.com/blog/2009/11/11/excessive-mail-sent-by-an-user-alert-for-cpanel/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 06:37:56 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Cpanel]]></category>
		<category><![CDATA[cpanel mail alert]]></category>
		<category><![CDATA[mail alert]]></category>
		<category><![CDATA[warning for spam]]></category>

		<guid isPermaLink="false">http://presoon.com/blog/?p=142</guid>
		<description><![CDATA[If you need a simple script to alert you by mail when a user exceeds a predefined mail rate limit, then check this out.

mailflag=0
limit=5
mailid=mailaddresshere
chkdate=`date -d "60 minute ago" +%Y-%m-%d\ %k`
#chkdate=2009-11-10
mailfile=$(mktemp)
for i in `mysql --batch --skip-column-names -e " use eximstats; select user,email,msgid from sends where \
 mailtime like '$chkdate%';" &#124; awk '{print $1}' &#124; sort &#124; [...]]]></description>
			<content:encoded><![CDATA[<p>If you need a simple script to alert you by mail when a user exceeds a predefined mail rate limit, then check this out.</p>
<pre>
<code>mailflag=0
limit=5
mailid=mailaddresshere
chkdate=`date -d "60 minute ago" +%Y-%m-%d\ %k`
#chkdate=2009-11-10
mailfile=$(mktemp)
for i in `mysql --batch --skip-column-names -e " use eximstats; select user,email,msgid from sends where \
 mailtime like '$chkdate%';" | awk '{print $1}' | sort | uniq -c | sort -n | sed 's/^ *//'| sed 's/ /:/'`
do
k=`echo $i | cut -d ':' -f1`
username=`echo $i | cut -d ':' -f2`
if [ "$k" -gt "$limit" ]
then
mailflag=1
echo -e "\n\n\n Excessive mail sent by user : $username \n\n" &gt;&gt; $mailfile
echo -e "============================================================================" &gt;&gt; $mailfile
echo "     mailtime           msgid   email   processed       user    size    ip      auth" &gt;&gt; $mailfile
mysql --batch --skip-column-names -e " use eximstats; select * from sends where mailtime like '$chkdate%' and \
user like '$username';" &gt;&gt; $mailfile
echo -e "============================================================================" &gt;&gt; $mailfile
fi
done
if [ "$mailflag" == 1 ]
then
cat $mailfile | mail -s "Excessive mail sent by user" $mailid
fi
rm -rf $mailfile</code>
</pre>
<p>You need to edit the limit and mailid variables according to your requirement.<br />
eg:<br />
limit=300<br />
mailid=test@live.com</p>
]]></content:encoded>
			<wfw:commentRss>http://presoon.com/blog/2009/11/11/excessive-mail-sent-by-an-user-alert-for-cpanel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LWP perl module (libwww-perl) cPanel csf issue.</title>
		<link>http://presoon.com/blog/2009/09/24/lwp-perl-module-libwww-perl-cpanel-csf-issue/</link>
		<comments>http://presoon.com/blog/2009/09/24/lwp-perl-module-libwww-perl-cpanel-csf-issue/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 09:46:59 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[APF]]></category>
		<category><![CDATA[Cpanel]]></category>
		<category><![CDATA[libwww-perl]]></category>
		<category><![CDATA[LWP]]></category>
		<category><![CDATA[perl module]]></category>

		<guid isPermaLink="false">http://presoon.com/blog/?p=125</guid>
		<description><![CDATA[You may face issue with the perl module LWP libwww-perl .
Just do the following
check whether the following file exist

ls -alh /root/.gnupg


cd /usr/local/src/
wget 

http://perlmirror.indialinks.com/authors/id/G/GA/GAAS/libwww-perl-5.806.tar.gz

or download the available version from http://perlmirror.indialinks.com/authors/id/G/GA/GAAS/
tar zxvf libwww-perl-5.806.tar.gz
cd libwww-perl-5.806
perl Makefile.PL
make
make install
cd ../

Also do the following

wget  http://perlmirror.indialinks.com/authors/id/A/AN/ANDK/CPAN-1.93.tar.gz
tar zxvf CPAN-1.93.tar.gz
Or download the latest from http://perlmirror.indialinks.com/authors/id/A/AN/ANDK/
cd CPAN-1.93
perl Makefile.PL
make
make install

/usr/local/cpanel/bin/checkperlmodules
/scripts/rrdtoolinstall

Now try installing csf.
It should work [...]]]></description>
			<content:encoded><![CDATA[<p>You may face issue with the perl module LWP libwww-perl .<br />
Just do the following</p>
<p>check whether the following file exist</p>
<pre>
<code>ls -alh /root/.gnupg</code>
</pre>
<pre>
<code>cd /usr/local/src/
wget 

http://perlmirror.indialinks.com/authors/id/G/GA/GAAS/libwww-perl-5.806.tar.gz

or download the available version from http://perlmirror.indialinks.com/authors/id/G/GA/GAAS/
tar zxvf libwww-perl-5.806.tar.gz
cd libwww-perl-5.806
perl Makefile.PL
make
make install
cd ../</code>
</pre>
<p>Also do the following</p>
<pre>
<code>wget  http://perlmirror.indialinks.com/authors/id/A/AN/ANDK/CPAN-1.93.tar.gz
tar zxvf CPAN-1.93.tar.gz
Or download the latest from http://perlmirror.indialinks.com/authors/id/A/AN/ANDK/
cd CPAN-1.93
perl Makefile.PL
make
make install

/usr/local/cpanel/bin/checkperlmodules
/scripts/rrdtoolinstall</code>
</pre>
<p>Now try installing csf.<br />
It should work fine.</p>
]]></content:encoded>
			<wfw:commentRss>http://presoon.com/blog/2009/09/24/lwp-perl-module-libwww-perl-cpanel-csf-issue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Show IP addresss usage in cPanel shows incorrect entries for FTP</title>
		<link>http://presoon.com/blog/2009/08/15/show-ip-addresss-usage-in-cpanel-shows-incorrect-entries-for-ftp/</link>
		<comments>http://presoon.com/blog/2009/08/15/show-ip-addresss-usage-in-cpanel-shows-incorrect-entries-for-ftp/#comments</comments>
		<pubDate>Sat, 15 Aug 2009 05:43:57 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Cpanel]]></category>
		<category><![CDATA[incorrect ipaddress in cpanel]]></category>
		<category><![CDATA[ip address usage]]></category>
		<category><![CDATA[not corrrect IP]]></category>

		<guid isPermaLink="false">http://presoon.com/blog/?p=116</guid>
		<description><![CDATA[Hi guys,
You might have come across the issue in WHM showing incorrect IP address usage for FTP. This is generated by the script /scripts/ipusage
The is is the issue with any of these files.

/usr/local/apache/conf/httpd.conf
/etc/proftpd.conf
/etc/pure-ftpd/ folder.

If there are incorrect entries in you apacha conf. Backup the file and rebuild the conf using /scripts/rebuildhttpdconf
If there are no entries [...]]]></description>
			<content:encoded><![CDATA[<p>Hi guys,</p>
<p>You might have come across the issue in WHM showing incorrect IP address usage for FTP. This is generated by the script /scripts/ipusage</p>
<p>The is is the issue with any of these files.</p>
<pre>
<code>/usr/local/apache/conf/httpd.conf
/etc/proftpd.conf
/etc/pure-ftpd/ folder.</code>
</pre>
<p>If there are incorrect entries in you apacha conf. Backup the file and rebuild the conf using /scripts/rebuildhttpdconf<br />
If there are no entries for the usage line in Apache conf check whether you are using pure-ftpd.</p>
<p>check the directory /etc/pure-ftpd<br />
It will have folder names of IPaddress. These are actually symblinks to ftp user folder /home//public_ftp.<br />
just execute unlink ipaddress</p>
<pre>
<code>cd /etc/pure-ftpd
unlink ipaddress</code>
</pre>
<p>Hope that works.</p>
]]></content:encoded>
			<wfw:commentRss>http://presoon.com/blog/2009/08/15/show-ip-addresss-usage-in-cpanel-shows-incorrect-entries-for-ftp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to install ASP.NET with Mysql in Linux server (cPanel)</title>
		<link>http://presoon.com/blog/2009/07/02/aspnet-with-mysql-in-linux-server-cpanel/</link>
		<comments>http://presoon.com/blog/2009/07/02/aspnet-with-mysql-in-linux-server-cpanel/#comments</comments>
		<pubDate>Thu, 02 Jul 2009 03:27:24 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Cpanel]]></category>

		<guid isPermaLink="false">http://presoon.com/blog/?p=98</guid>
		<description><![CDATA[Use ASP.NET with Mysql]]></description>
			<content:encoded><![CDATA[<p>You should enable mod_mono in easyapache to enable ASP.NET. However, for using Mysql database with ASP.NET, you need to download and install a connector from Mysql site.<br />
The one you need is <a href="http://dev.mysql.com/get/Downloads/Connector-Net/mysql-connector-net-5.2.3-noinstall.zip/from/http://www.mirrorservice.org/sites/ftp.mysql.com/">Windows Binaries, no installer (ZIP)</a>.</p>
<p>Installation</p>
<pre><code>cd /usr/local/src/
mkdir asp-connector
cd asp-connector
wget <a href="http://dev.mysql.com/get/Downloads/Connector-Net/mysql-connector-net-5.2.3-noinstall.zip/from/http://www.mirrorservice.org/sites/ftp.mysql.com/">Windows Binaries, no installer (ZIP)</a>
/opt/mono/bin/gacutil -i  /usr/local/src/asp-connector/bin/MySql.Data.dll</code></pre>
<p><strong>Most of you forget the next step and the Mysql connector won&#8217;t work.</strong></p>
<pre><code>cd /opt/mono/lib/mono/gac/MySql.Data
cd 5.2.3.0__xxxxxxxxxx/
chmod 755 MySql.Data.dll</code></pre>
<p>Restart Apache</p>
<pre><code>/etc/rc.d/init.d/httpd restart</code></pre>
<p>Now you should be able to connect to mysql using .aspx scripts</p>
<p>Here is a custom script to check the working.<br />
First Create a mysql database first (using command line)</p>
<pre><code>$ mysql -u root -p

mysql&gt; CREATE DATABASE asptest;
Query OK, 1 row affected (0.10 sec)

mysql&gt; USE asptest;
Database changed

mysql&gt; CREATE TABLE testtable ( id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(255) );
Query OK, 0 rows affected (0.09 sec)

mysql&gt; INSERT INTO testtable VALUES(null,'Fame');
Query OK, 1 row affected (0.00 sec)

mysql&gt; INSERT INTO testtable VALUES(null,'Clean');
Query OK, 1 row affected (0.00 sec)

mysql&gt; SELECT * FROM testtable;
+----+----------+
| id | name |
+----+----------+
| 1 | Fame |
| 2 | Clean |
+----+----------+
2 rows in set (0.00 sec)

mysql&gt; GRANT SELECT, INSERT, UPDATE, DELETE ON asptest.* TO asptest@localhost IDENTIFIED BY 'nogesspassword';
Query OK, 0 rows affected (0.12 sec)

mysql&gt; FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.13 sec)</code></pre>
<p>Lets go to the script<br />
Here is it. It will display the contents of the database.</p>
<p>First, create a file called test.aspx in your web directory<br />
Add this code and save it.</p>
<pre><code>&lt;%@ Page Language="C#" %&gt;
&lt;%@ Import Namespace="System.Data" %&gt;
&lt;%@ Import Namespace="MySql.Data.MySqlClient" %&gt;
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&gt;
  &lt;head&gt;
    &lt;title&gt;ASP test&lt;/title&gt;
    &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;

    &lt;script runat="server"&gt;
    private void Page_Load(Object sender, EventArgs e)
    {
       string connectionString = "Server=localhost;Database=asptest;User ID=asptest;Password=nogesspassword;Pooling=false;";
       MySqlConnection dbcon = new MySqlConnection(connectionString);
       dbcon.Open();

       MySqlDataAdapter adapter = new MySqlDataAdapter("SELECT * FROM testtable", dbcon);
       DataSet ds = new DataSet();
       adapter.Fill(ds, "result");

       dbcon.Close();
       dbcon = null;

       ArtistsControl.DataSource = ds.Tables["result"];
       ArtistsControl.DataBind();
    }
    &lt;/script&gt;

  &lt;/head&gt;

  &lt;body&gt;
    &lt;h1&gt;Artists&lt;/h1&gt;
    &lt;asp:DataGrid runat="server" id="ArtistsControl" /&gt;
  &lt;/body&gt;

&lt;/html&gt;</code>
</pre>
<p>Finally, you need a web.config file, in the same web directory where test.aspx . It should contain the following to enable the MySQL libraries to be loaded:</p>
<p>Add the following to web.config</p>
<pre><code>&lt;configuration&gt;
&lt;system.web&gt;
&lt;compilation&gt;
&lt;assemblies&gt;
&lt;add assembly="MySql.Data"/&gt;
&lt;/assemblies&gt;
&lt;/compilation&gt;
&lt;customErrors mode="Off"/&gt;
&lt;/system.web&gt;
&lt;/configuration&gt;</code></pre>
<p>Now try accessing the file test.aspx using http://domainname.com/test.aspx</p>
<p>If you need any help, please let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://presoon.com/blog/2009/07/02/aspnet-with-mysql-in-linux-server-cpanel/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
