Mickgenie.com's Linux Blog

Mick Genie Linux Blog
  • Home
  • About

Archive for the ‘cPanel’ Category

You are currently browsing the archives for the cPanel category.

19 Jul 2010

How to delete email older than 3 months from cPanel

Some email user never remove their email message and they have never though that the older email actually wasting the hosting account space.

With this article, Mick Genie will guide you some shell script to remove email older than 3 months(90 days).

To run the shell script, you may make the shell script with .sh file as sample below.

Save the following coding name removed_mails_for_90days.sh
#!/bin/bash
IFS=”$”
cpanel_username=mickgenie //your cPanel username
domain=domain.com //your domain name
username=mickgenie //your email username (without domain)
cd /home/${cpanel_username}/mail/${domain}/${username}
find -P /home/${cpanel_username}/mail/${domain}/${username}/* -mindepth 1 -maxdepth 1 -mtime ‘+90′ | while read old; do
echo “Deleting ${old}…”
rm -rf “${old}”
done

Remember to change your cpanel_username, domain and username from the script.

Set the cronjob from your cPanel or shell access(SSH) which running daily.
0 0 * * * /bin/sh /home/mickgenie/scripts/removed_mails_for_90days.sh

  • Twitter
  • Facebook
  • Blogger Post
  • Delicious
  • WordPress
  • Share/Bookmark
19 July, 2010 at 8:00 by mickgenie

Tags: Account Space, automatically remove mail, cron, cronjob, Delete Email, Domain Name, Email Domain, Find Mail, Mail Domain, Mtime, remove old mail, Rf, scheduled remove mail, Scripts, Shell Access, Shell Script, SSH
Posted in cPanel | No Comments »

5 Jul 2010

cPanel License Checklist

If you using cPanel as your server control panel and you might found out the license expired error message for sometimes.

First of all, you should check if your server hostname is Fully Qualified Domain Name (FQDN). To do this, log into your SSH, type hostname.
$ hostname

Your hostname should appear like server.mickgenie.com instead of mickgenie only.

Next, you may check from cPanel verify site as URL below if your license have expired.
http://verify.cpanel.net/

Then you should check if your primary IP of the server match to the registered license IP. Log into your SSH again and type,
$ curl http://www1.cpanel.net/showip.cgi

If the IP not match, contact cPanel on that.

Lastly, verify or update your license as script below from SSH.

  • Twitter
  • Facebook
  • Blogger Post
  • Delicious
  • WordPress
  • Share/Bookmark
5 July, 2010 at 8:00 by mickgenie

Tags: cPanel License, Domain Name, Error Message, Hostname, IP, Match, Server Control Panel, Server Hostname
Posted in cPanel | No Comments »

3 Jul 2010

Remote MySQL Access for cPanel

By right, MySQL is one of the engine that used up lots of I/O and Memory resource from a server. Somehow you may use this scenario to setup so-called Clustering Web and MySQL server to reduce the I/O usage.

To setup remote MySQL server, you need 3 main steps as below.
1. Grant remote access to cPanel root user.
2. Add remote host information to /root/.my.cnf file.
3. Configure PHPMyAdmin configuration.

1. Grant remote access to cPanel root user,
To grant remote access to cPanel root user, you will need to amend the MySQL privilege as line below.
mysql> GRANT ALL PRIVILEGES ON *.* TO root@`192.168.1.1` IDENTIFIED BY ‘password’ WITH GRANT OPTION;
mysql> GRANT ALL PRIVILEGES ON *.* TO root@`mysql.mickgenie.com` IDENTIFIED BY ‘password’ WITH GRANT OPTION;

2. Add remote host information to /root/.my.cnf file,
Next, you will need to change the host of the MySQL location to the slave server.
[client]
user=”root”
pass=”password”
host=”mysql.mickgenie.com”

3. Configure PHPMyAdmin information,
Open file /usr/local/cpanel/base/3rdparty/phpMyAdmin/config.inc.php, configure the setting as below.
$i++;
$cfg['Servers'][$i]['host'] = ‘mysql.mickgenie.com’;
$cfg['Servers'][$i]['port'] = ’3306′;
$cfg['Servers'][$i]['socket'] = ”;
$cfg['Servers'][$i]['connect_type'] = ‘tcp’;
$cfg['Servers'][$i]['extension'] = ‘mysql’;
$cfg['Servers'][$i]['compress'] = FALSE;
…

You have done the setting.

  • Twitter
  • Facebook
  • Blogger Post
  • Delicious
  • WordPress
  • Share/Bookmark
3 July, 2010 at 12:54 by mickgenie

Tags: Cnf, Config, cPanel, Memory Resource, Mysql Access, Mysql Grant, Mysql Server, phpmyadmin, Port 3306, Privilege, Privileges, Remote Access, Remote Host, Root User, Server Client, Servers, Slave Server, Web Server
Posted in Database, cPanel | No Comments »

19 Jun 2010

cPanel email quotas are incorrect

Sometimes, you may get the email quotas exceeded but your mailbox is actually not using so much spaces.

The mailbox user@mickgenie.com is full or very close to full.

You should remove some emails from the box as soon as possible to prevent
losing any future mail.

This mailbox is currently 100.00% (251.76/250.00 Megs) full.

There do have 2 methods to fix this issue.
1. You may go to the mail directories of your virtual account, look for the mailbox account and remove the maildirsize file.

2. If the above method not able to fix your problem, run the following command.
/scripts/generate_maildirsize –force username

Where the username is your cPanel username.

  • Twitter
  • Facebook
  • Blogger Post
  • Delicious
  • WordPress
  • Share/Bookmark
19 June, 2010 at 12:39 by mickgenie

Tags: command scripts, email, mail, mail directories, Mailbox, mailbox account, quotas, virtual account.
Posted in cPanel | No Comments »

16 Jun 2010

Install SSL through Shell

Today, I’m about to guide you how to install the SSL key and it will a bit tricky compare to generate the SSL CSR key.

To install the SSL key through Shell, refer to the step as below.
1. Go to path /usr/share/ssl/certs.
$ mickgenie@mickgenie.com[/]# cd /usr/share/ssl/certs
2. Check if the domain.com.csr and domain.com.cabundle existed, else create them and enter the code.
3. Go to path /usr/share/ssl/private.
$ mickgenie@mickgenie.com[/]# cd /usr/share/ssl/private
4. Use the CA key and create the domain.com.key and enter the code.
5. Backup your httpd.conf file and enter the following code before your virtualhost tag.

SSLEnable
SSLCertificateFile /usr/share/ssl/certs/domain.com.crt
SSLCertificateKeyFile /usr/share/ssl/private/domain.com.key
SSLCACertificateFile /usr/share/ssl/certs/domain.com.cabundle
SSLLogFile /usr/local/apache/domlogs/domain.com-ssl_data_log
SetEnvIf User-Agent “.*MSIE.*” nokeepalive ssl-unclean-shutdown

Note: If cabundle not exist then remove the whole line of cabundle(line4).

6. Restart the httpd services.

  • Twitter
  • Facebook
  • Blogger Post
  • Delicious
  • WordPress
  • Share/Bookmark
16 June, 2010 at 7:30 by mickgenie

Tags: Address, Apache, Cd Check, Cert, Certificate Password, Certificate Request, Certificate Server, Certs, Country Code, Digital Encryption, Domain Name, Domainname, E Mail, httpd, Important Information, Path, Private Domain, rsa, Secure Sockets Layer, Server Ssl, Shell, Shell Install SSL, Shell Scripts, Ssl Certificate, SSL CSR, Ssl Data, SSL Key, SSL RSA, Webmaster
Posted in Apache, cPanel | No Comments »

« Older Entries
  • RSS RSS

    • Linux Portable Apps
    • Update Centos Linux 5.4 to Centos Linux 5.5
    • How to delete email older than 3 months from cPanel
    • Ten Linux Command that you should know
    • How to install Firefox 3.6.6. in Ubuntu
    • SQL: Select
    • Add Adblock Extension to your Browser
    • Improve your Writing Skill with After the Deadline
    • Firefox Master Password Timeout Manager
    • cPanel License Checklist
  • [Google]
  • Categories

    • Apache
    • Application
    • Blogging
    • cPanel
    • Database
    • DNS
    • FTP
    • Google
    • Linux
    • New Hand
    • Perl
    • Php
    • RoR
    • SSH
    • Time Zone
    • ubuntu
    • Wordpress
  • Archives

  • Calendar

    August 2010
    M T W T F S S
    « Jul    
     1
    2345678
    9101112131415
    16171819202122
    23242526272829
    3031  
  • Blogroll

    • Mick Genie Blog
  • Meta

    • Register
    • Log in
    • Entries RSS
    • Comments RSS
    • WordPress.org
  • Sponsored Links

    Easy AdSense by Unreal
Get Adobe Flash playerPlugin by wpburn.com wordpress themes
Mickgenie.com's Linux Blog is powered by WordPress
Theme Design by Generic Designer

Entries (RSS) and Comments (RSS)