<?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>David Laube&#039;s Blog &#187; Cpanel</title>
	<atom:link href="http://www.dlaube.com/category/cpanel/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dlaube.com</link>
	<description>Every linux user has a /home directory.</description>
	<lastBuildDate>Wed, 28 Feb 2024 17:04:21 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.0</generator>
<meta xmlns="http://www.w3.org/1999/xhtml" name="robots" content="noindex,follow" />
	<item>
		<title>mysql Innodb &#8211; Table &#8216;user&#8217; is marked as crashed and should be repaired</title>
		<link>http://www.dlaube.com/2011/01/mysql-innodb-table-user-is-marked-as-crashed-and-should-be-repaired/</link>
		<comments>http://www.dlaube.com/2011/01/mysql-innodb-table-user-is-marked-as-crashed-and-should-be-repaired/#comments</comments>
		<pubDate>Sat, 08 Jan 2011 16:42:41 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[Cpanel]]></category>
		<category><![CDATA[Hosting]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.dlaube.com/?p=377</guid>
		<description><![CDATA[I recently came across a Cpanel server (CentOS 5) upon which mysqld refused to start after /var was at 100%. After tailing the mysql error log in the default /var/lib/mysql/HOSTNAME.err it was no surprise to find that the mysql user table had been marked as crashed. On RHEL/CentOS servers, you cannot simply add the &#8220;innodb_force_recovery [...]]]></description>
				<content:encoded><![CDATA[<p>I recently came across a Cpanel server (CentOS 5) upon which mysqld refused to start after /var was at 100%. After tailing the mysql error log in the default /var/lib/mysql/HOSTNAME.err it was no surprise to find that the mysql user table had been marked as crashed. On RHEL/CentOS servers, you cannot simply add the &#8220;<a href="http://dev.mysql.com/doc/refman/5.0/en/forcing-innodb-recovery.html">innodb_force_recovery</a> = 1&#8243; (or whatever recovery level&#8230;2,3,4,5,6) to the /etc/my.cnf and do the regular <em>service mysql start</em>. You&#8217;ll have to edit the my.cnf to enable recovery and start mysql from the command line and not by the init script/service command. Only once you have mysql started on the command line can you run your repair on the mysql user table. Here is quick run-down with commands and queries to run on your Cpanel server;</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family: monospace;">[root@HOSTNAME mysql]# tail -f /var/lib/mysql/HOSTNAME.err
110108 10:37:45  InnoDB: Starting log scan based on checkpoint at
InnoDB: log sequence number 1 3749263016.
InnoDB: Doing recovery: scanned up to log sequence number 1 3749263050
InnoDB: Last MySQL binlog file position 0 79, file name ./host89-bin.000005
110108 10:37:45  InnoDB: Flushing modified pages from the buffer pool...
110108 10:37:45  InnoDB: Started; log sequence number 1 3749263050
InnoDB: !!! innodb_force_recovery is set to 1 !!!
110108 10:37:45 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'user' is marked as crashed and should be repaired
110108 10:37:45  mysqld ended
</pre>
</div>
</div>
<p>Now, go ahead and enable innodb forced recovery by opening your /etc/my.cnf in your favorite text editor and make sure you have something like this:</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family: monospace;">[mysqld]
innodb_force_recovery = 1
</pre>
</div>
</div>
<p>Start mysql from the command line after enabling innodb forced recovery:</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family: monospace;">[root@HOSTNAME ~]#/usr/sbin/mysqld --skip-grant-tables --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/HOSTNAME.pid --skip-external-locking --port=3306 --socket=/var/lib/mysql/mysql.sock
</pre>
</div>
</div>
<p>Finally, it&#8217;s time to get back in to mysql and get your life back&#8230; or mysql user table at least!</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family: monospace;">[root@HOSTNAME ~]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 173 to server version: 4.1.22-standard-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql&gt; use mysql;
mysql&gt; check table user;
+------------+-------+----------+----------------------------------------------------------+
| Table      | Op    | Msg_type | Msg_text                                                 |
+------------+-------+----------+----------------------------------------------------------+
| mysql.user | check | warning  | Table is marked as crashed                               |
| mysql.user | check | warning  | 6 clients are using or haven't closed the table properly |
| mysql.user | check | error    | Record at pos: 24992 is not remove-marked                |
| mysql.user | check | error    | record delete-link-chain corrupted                       |
| mysql.user | check | error    | Corrupt                                                  |
+------------+-------+----------+----------------------------------------------------------+
5 rows in set (0.02 sec)

mysql&gt; repair table user;
+------------+--------+----------+------------------------------------------+
| Table      | Op     | Msg_type | Msg_text                                 |
+------------+--------+----------+------------------------------------------+
| mysql.user | repair | warning  | Number of rows changed from 1384 to 1385 |
| mysql.user | repair | status   | OK                                       |
+------------+--------+----------+------------------------------------------+
2 rows in set (0.48 sec)

mysql&gt; check table user;
+------------+-------+----------+----------+
| Table      | Op    | Msg_type | Msg_text |
+------------+-------+----------+----------+
| mysql.user | check | status   | OK       |
+------------+-------+----------+----------+
1 row in set (0.01 sec)

mysql&gt;exit
</pre>
</div>
</div>
<p>Now, don&#8217;t forget to <strong>REMOVE </strong>the innodb_force_recovery line from your my.cnf you added earlier! After that, just start mysql as you normally would. For more database information and management <strong><a href="https://developer.couchbase.com/comparing-document-vs-relational/">hop over to here</a></strong>.</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family: monospace;">[root@HOSTNAME mysql]# service mysql start
</pre>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.dlaube.com/2011/01/mysql-innodb-table-user-is-marked-as-crashed-and-should-be-repaired/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Cpanel &#8211; incorrect email disk space used</title>
		<link>http://www.dlaube.com/2010/08/cpanel-incorrect-email-disk-space-used/</link>
		<comments>http://www.dlaube.com/2010/08/cpanel-incorrect-email-disk-space-used/#comments</comments>
		<pubDate>Fri, 20 Aug 2010 15:28:02 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[Cpanel]]></category>
		<category><![CDATA[Email]]></category>
		<category><![CDATA[Hosting]]></category>

		<guid isPermaLink="false">http://www.dlaube.com/?p=351</guid>
		<description><![CDATA[Control Panel -&#62; Email -&#62; Add/Remove/Manage Accounts -&#62; Show Disk Space Used When there are inconsistencies with Cpanel&#8217;s email disk space usage, you should verify the actual disk space being utilized by: (1) du -sh /home/username/mail/userdomain.com/user/ tail -1 /home/username/mail/domain.com/user/maildirsize (2) Compare the utilized disk space reported by the first du command with the bytes shown [...]]]></description>
				<content:encoded><![CDATA[<p>Control Panel -&gt; Email -&gt; Add/Remove/Manage Accounts -&gt; Show Disk Space Used</p>
<p>When there are inconsistencies with Cpanel&#8217;s email disk space usage, you should verify the actual disk space being utilized by:</p>
<p>(1)</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family: monospace;">du -sh /home/username/mail/userdomain.com/user/
tail -1 /home/username/mail/domain.com/user/maildirsize</pre>
</div>
</div>
<p>(2) Compare the utilized disk space reported by the first du command with the bytes shown in the user&#8217;s maildirsize file. If the totals reported are different delete or rename the maildirsize file (/home/username/mail/domain.com/user/maildirsize). Next, logout and then back in again within the user&#8217;s control panel and go to Control Panel -&gt; Email -&gt; Add/Remove/Manage Accounts -&gt; Show Disk Space Used</p>
<p></br></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dlaube.com/2010/08/cpanel-incorrect-email-disk-space-used/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>pure-ftpd Can&#8217;t change directory to /var/ftp/</title>
		<link>http://www.dlaube.com/2010/03/pure-ftpd-cant-change-directory-to-varftp/</link>
		<comments>http://www.dlaube.com/2010/03/pure-ftpd-cant-change-directory-to-varftp/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 15:17:33 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[Cpanel]]></category>
		<category><![CDATA[Hosting]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.dlaube.com/?p=121</guid>
		<description><![CDATA[The problem arises when a user attempts to make an anonymous FTP connection to Cpanel user&#8217;s account who has already enabled anonymous FTP connections in their control panel. However, pure-ftpd drops you with the error &#8220;421 Can&#8217;t change directory to /var/ftp/&#8221;. workstation:~ user$ ftp testing.com Connected to testing.com. 220---------- Welcome to Pure-FTPd [privsep] [TLS] ---------- [...]]]></description>
				<content:encoded><![CDATA[<p>The problem arises when a user attempts to make an anonymous FTP connection to Cpanel user&#8217;s account who has already enabled anonymous FTP connections in their control panel. However, pure-ftpd drops you with the error &#8220;421 Can&#8217;t change directory to /var/ftp/&#8221;.</p>
<p><div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">
workstation:~ user$ ftp testing.com
Connected to testing.com.
220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 3 of 50 allowed.
220-Local time is now 11:02. Server port: 21.
220-IPv6 connections are also welcome on this server.
220 You will be disconnected after 15 minutes of inactivity.
Name (testing.com:user): anonymous
421 Can't change directory to /var/ftp/ [/]
ftp: Login failed.
</pre>
</div>
</div>
<p>The solution(s):<br />
1. Use anonymous@domain.com and any password instead of just anonymous<br />
&#8230;OR<br />
2. Assign the Cpanel user a dedicated IP address where FTP logins with just &#8220;anonymous&#8221; will work.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dlaube.com/2010/03/pure-ftpd-cant-change-directory-to-varftp/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>apache_conf_distiller User data set has no &#8216;main_domain&#8217; key.</title>
		<link>http://www.dlaube.com/2010/02/apache_conf_distiller-user-data-set-has-no-main_domain-key/</link>
		<comments>http://www.dlaube.com/2010/02/apache_conf_distiller-user-data-set-has-no-main_domain-key/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 01:55:41 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[Cpanel]]></category>
		<category><![CDATA[Hosting]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://dlaube.com/?p=84</guid>
		<description><![CDATA[After a server was hacked recently, the attackers replaced all files named index / default / main with their typical 0wned-by message and javascript. Of the &#8220;main&#8221; files that were affected, the /var/cpanel/userdata/USER/main files were also overwritten. These files contain important cpanel domain information which are required to build a new httpd.conf using the apache_conf_distiller. [...]]]></description>
				<content:encoded><![CDATA[<p>After a server was hacked recently, the attackers replaced all files named index / default / main with their typical 0wned-by message and javascript. Of the &#8220;main&#8221; files that were affected, the /var/cpanel/userdata/USER/main files were also overwritten. These files contain important cpanel domain information which are required to build a new httpd.conf using the apache_conf_distiller. The following steps should regenerate a working apache userdata in order to fix subdomains. Thanks to Josh for finding userdata_update!</p>
<p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">
/etc/init.d/httpd stop
mv /usr/local/apache/conf/httpd.conf /usr/local/apache/conf/httpd.conf-notworking
cp -a OLDHTTPD.CONF /usr/local/apache/conf/
mv /var/cpanel/userdata /var/cpanel/userdata-BAK
/usr/local/cpanel/bin/userdata_update
cp -a /var/cpanel/userdata /usr/local/apache/conf
/etc/init.d/httpd start
</pre>
</div>
</div>
<p>Run the /usr/local/cpanel/bin/apache_conf_distiller &#8211;update to ensure the main_domain key errors are gone.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dlaube.com/2010/02/apache_conf_distiller-user-data-set-has-no-main_domain-key/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
