Showing posts with label cPanel. Show all posts
Showing posts with label cPanel. Show all posts

Tuesday, February 13, 2007

cPanel and XWindows

XWindows dont work once cPanel is installed. Reasons are many why they disabled XWindows on the easy one script installation of cPanel, primary reason being security.

However I needed Xwindows to be running on a cPanel installed machine. Here is what I did.

  1. Edited /etc/rc.local and commented the line /scripts/securetmp
  2. /etc/init.d/xfs start
  3. chkconfig --add xfs
  4. chkconfig --level 2345 xfs on
Rebooted the machine and when came up, mysql service didn't start. Easy guess was /tmp permissions. I checked the permissions and it was 755, changed to 2777 permissions
5. chmod 2777 /tmp
6. Login screen came in and I logged in :-)

lol. That was easy isn't it ? May not be. Sometimes you need to edit the file /etc/X11/xorg.conf as well and search & comment the lines "FontPath "unix/:7100" . Rare cases. But that is a chance.

If you are reading this blog and even after trying these you are not able to get the XWindows working after these work arounds, please comment. I also played around a few more settings before I could get it work. May be I can remember on seeing the error.

Tuesday, January 09, 2007

DBI connect('mysql:localhost','root',...) failed: Access denied for user 'root'@'localhost' (using password: NO) at /usr/local/cpanel/Cpanel/Mysql.pm

Another cPanel issue. A customer was moved the servers, but he was not able to create any databases from cPanel in the new server, but works from phpmyadmin. So issue is isolated with cPanel, when checking the cPanel error logs at /usr/local/cpanel/logs/error_log , saw the follow error

DBI connect('mysql:localhost','root',...) failed: Access denied for user 'root'@'localhost' (using password: NO) at /usr/local/cpanel/Cpanel/Mysql.pm line 42

which kept on repeating each time we take the cPanel page. I tried re-installing DBD::mysql, DBI..but it didn't work. Finally forced the DBI installation with the below command and it fixed :-)

/scripts/perlinstaller --force Bundle::DBI

Tuesday, December 05, 2006

cPanel mail quota mismatch

cPanel decided that they want to use maildir format for it's mailboxes and started converting all mboxes to maildir. There are 100's of issues (I love these issues and work arounds :)) involved with the conversion, like failing to convert some large mboxes of more than 1GB+, quotas mismatch and so on and on.. But I must agree, that they did a pretty good job with the /scripts/convert2maildir script which uses /usr/local/cpanel/3rdparty/mb2md/mb2md . Actual project page is at http://batleth.sapienti-sat.org/projects/mb2md/.

When customers use the Show Disk Space used cPanel actually reads the quota from a filename inside the mail directory usually located at /home/username/mail/domainname.com/emailaccount/maildirsize and prints out in a -h format (human readable format). After the conversion, around 50% of the accounts will show the wrong quota usage. The following command fixes the issue for you and let cPanel recalculate the disk usage.

find /home -name "maildirsize" -exec rm -f {} \;

For those of who like xargs use,

find /home -name "maildirsize" | xargs rm -f

or even

find /home -name "maildirsize" -delete

Replace /home with /home/username/mail for dealing with one particular cPanel account.