Sunday 19 October 2014

Data error in File Manager

When you click on the File Manager in cPanel you get the following error :
Data error!
This error is caused by a corrupt mime type cache file. Rename the file and cPanel will generate a new one.


mv -v /home/<user>/.cpanel/datastore/SYSTEMMIME{,.bak}

Saturday 18 October 2014

How to read the summary area fields describing CPU statistics from the top command log ?


When you run the "top" command in SSH , you get the results as following :

top - 19:46:04 up 18 days, 4 min, 1 user, load average: 0.16, 0.24, 0.27
Tasks: 138 total, 1 running, 137 sleeping, 0 stopped, 0 zombie
Cpu(s): 5.1%us, 2.4%sy, 0.2%ni, 89.5%id, 2.7%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 3887124k total, 3420008k used, 467116k free, 419972k buffers
Swap: 8392696k total, 269884k used, 8122812k free, 1395624k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1 **** 20 0 19356 1052 836 S 0.0 0.0 0:06.04 init
2 **** 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd
3 **** RT 0 0 0 0 S 0.0 0.0 0:10.97 migration/0
4 **** 20 0 0 0 0 S 0.0 0.0 0:50.46 ksoftirqd/0

In this cpu(s) line can be read as following :

{ Cpu(s): 5.1%us, 2.4%sy, 0.2%ni, 89.5%id, 2.7%wa, 0.0%hi, 0.0%si, 0.0%st }

us = user mode
sy = system mode
ni = low priority user mode (nice)
id = idle task
wa = I/O waiting
hi = servicing IRQs
si = servicing soft IRQs

st = steal (time given to other DomU instances)


Sunday 27 July 2014

You do not have permission to create subdomains of the server's hostname

Getting the following error while creating the subdomain in the cPanel:
You do not have permission to create subdomains of the server's hostname

Solution:
  • Login to the "WHM" >> Go to "Server Configuration" >> Then go to "Tweak Settings"
  • Enable the Following option in the "Tweak Settings": 
       Allow users to park subdomains of the server’s hostname.

Tuesday 11 March 2014

How to check the number of current MYSQL connections ?

Following are the different ways to check the MYSQL Connections to the database:
The below command will show the full stat about the mysql connections :
mysql> SHOW FULL PROCESSLIST\G

To get the number of connection attempts (successful or not) to the MySQL server :
mysql> show processlist;

Following command will show the number of open connections :
mysql> SHOW STATUS WHERE variable_name = 'Threads_connected';

To find current conection status you can use the following command :
#mysqladmin extended-status | grep -wi 'threads_connected\|threads_running' | awk '{ print $2,$4}' 
 
This will show you:
Threads_connected 12
Threads_running 1

Wednesday 5 March 2014

Strict Standards: Only variables should be assigned

Strict Standards: Only variables should be assigned ... error on the website

Update the php version to php 5.3


Replace old domain name or URL with new URL in WordPress

To replace the old domain name or the URL with the new URL in the wordpress blog site, refer the following steps :

Login to the cPanel >> go to phpMyAdmin >> Select the database you want to modify >> click on the SQL

Then type the following query to execute :
To update WordPress options with the new blog location, use the following SQL command:
UPDATE wp_options SET option_value = replace(option_value, 'http://www.old-domain.com', 'http://www.new-domain.com') WHERE option_name = 'home' OR option_name = 'siteurl';

After that to fix URLs of the WordPress posts and pages stored in database wp_posts table as guid field use the following SQL command:
UPDATE wp_posts SET guid = replace(guid, 'http://www.old-domain.com','http://www.new-domain.com');

Finally Use the following SQL commands to fix all internal links:

UPDATE wp_posts SET post_content = replace(post_content, 'http://www.old-domain.com', 'http://www.new-domain.com');

Tuesday 4 March 2014

Manually remove the cPanel account from the server

Inorder to manually remove the cPanel account from the server , please follow the below steps : 
(Note: For example consider the domain name as abc.com and username of the cPanel as abc)

  • rm /var/cpanel/users/abc
  • Remove the Virtual host entry for the domain abc.com from httpd.conf
    vi /etc/httpd/conf/httpd.conf remove the site VirtualHost entry
  • rm /var/named/[domain_name].db (If you used DNS Only cPanel, you may remove zone through WHM).
  • vi /etc/userdomains (remove only the abc.com: abc entry)
  • vi /etc/trueuserdomains (remove only the abc.com: abc entry)
  • vi /etc/trueuserowners ( remove only the abc: root entry)
  • vi /etc/named.conf ( remove the following entry:
                           zone "abc.c" {
                           type master;
                           file "/var/named/abc.com.db";
                             }; )
  • vi /etc/localdomains (remove only the abc.com: abc entry)
  • /etc/valiases (remove only the abc.com: abc entry)
Please login into the mysql and follow the steps
  • #mysql
  • mysql > use mysql;
  • mysql > drop user dbuser@localhost;
                     OR
          mysql> delete from mysql.user where user=dbuser;
  • vi /var/cpanel/databases/users.db ( remove only the entry of the domain )
  • rm /var/cpanel/databases/abc.cache
  • rm /var/cpanel/databases/abc.yaml
  • vi /etc/dbowners ( remove only the abc.com: abc entry)
This will manually remove the cPanel account from the server. 

ERR_CONTENT_DECODING_FAILED

If you are getting the error as ERR_CONTENT_DECODING_FAILED while accessing the domain then add the below extension in php.ini  ++++++++...