Archive

Archive for the ‘CPanel / WHM’ Category

Can’t locate DateTime perl module

July 22nd, 2017 No comments

If you are getting below error while installing any application on linux then perl date time module is missing.

Can’t locate DateTime.
pm in @INC (@INC contains: /usr/local/lib/perl5 /usr/local/share/perl5 /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5 /usr/share/perl5 .) at gatherbot_en.pl line 13.
BEGIN failed–compilation aborted at gatherbot_en.pl line 13.

You can use below command to install Datetime on server.

yum install perl-DateTime-TimeZone

After that if you are getting below error.

Can’t locate Date/Parse.pm in @INC

Then please run below command. It will ask to install some modules then keep on typing yes or hit enter.

cpan install Date::Parse

 

Categories: CPanel / WHM, Installation Tags:

How to change the color of your BASH prompt

May 11th, 2017 No comments

How to change the color of your BASH prompt

You can change the color of your BASH prompt to green with this command:

export PS1=”\e[0;32m[\[email protected]\h \W]\$ \e[m”

It will change the colour of bash temporarily. To make it permanent then add code in bash_profile page.

vi ~/.bash_profile

and paste above code save the file and you are done.

For other colors please see the attached list:

Color Code
Black 0;30
Blue 0;34
Green 0;32
Cyan 0;36
Red 0;31
Purple 0;35
Brown 0;33
Blue 0;34
Green 0;32
Cyan 0;36
Red 0;31
Purple 0;35
Brown 0;33
Light Color Code
Light Black 1;30
Light Blue 1;34
Light Green 1;32
Light Cyan 1;36
Light Red 1;31
Light Purple 1;35
Light Brown 1;33
Light Blue 1;34
Light Green 1;32
Light Cyan 1;36
Light Red 1;31
Light Purple 1;35
Light Brown 1;33

Categories: Cloud Linux, CPanel / WHM, Tweaks Tags:

Kill restore process in new cpanel

October 14th, 2014 No comments

Kill restore process in new cpanel

 

In new cpanel/WHM when we try to kill restore process it is still showing in WHM >> restore full backup. Below are the steps to remove that process from WHM.

You can manually mark the transfer as completed using the following instructions:

Ensure the transfer is no longer running by clicking on the “View” option under “Sessions in Progress” for this transfer. In the new window, there will be a line that looks like this:

You may close this window and view the transfer on the command line: /usr/local/cpanel/bin/view_transfer 1071601843quick20141013154952IAZhRro

Access your server via SSH and run that command (the transfer name will be different on your server):

/usr/local/cpanel/bin/view_transfer 1071601843quick20141013154952IAZhRro

As an example, you might see output like this:

Transfer running with pid: paused
[795 ][MASTER ]: Start Session
[795 ][MASTER ]: Version: 1.9

You will note that the master PID for this transfer is xxx. If the process still exists, and the transfer has failed, then you can kill that process:

kill -9 xxx

The next step requires you to change the entry for this transfer in the whmxfer.sessions table in MySQL. Find the entry with the session ID for your migration. In the example we have been using, it’s ‘ 1071601843quick20141013154952IAZhRro .’ It will look like this:

mysql -e “select * from whmxfer.sessions where sessionid=’1071601843quick20141013152137YIVT7Ze'”
+————————————–+————–+——-+———+———————–+————-+——-+———————+———+
| sessionid | initiator | pid | version | target_host | source_host | state | starttime | endtime |
+————————————–+————–+——-+———+———————–+————-+——-+———————+———+
| 1071601843quick20141013152137YIVT7Ze | quickrestore | 21295 | 1.9 | vps1.insurancedxb.com | localhost | 50 | 2014-10-13 08:21:37 | NULL |
+————————————–+————–+——-+———+———————–+————-+——-+———————+———+

You will need to change the ‘state’ field to 100, and change the ‘endtime’ field from NULL to a time after the ‘starttime’ field:

mysql -e “update whmxfer.sessions set state=’100′, endtime=’2014-10-14 09:37:52′ where sessionid=’1071601843quick20141013152137YIVT7Ze'”

If you check it again then you will notice that process ended.

+————————————–+————–+——-+———+———————–+————-+——-+———————+———————+
| sessionid | initiator | pid | version | target_host | source_host | state | starttime | endtime |
+————————————–+————–+——-+———+———————–+————-+——-+———————+———————+
| 1071601843quick20141013152137YIVT7Ze | quickrestore | 21295 | 1.9 | vps1.insurancedxb.com | localhost | 100 | 2014-10-13 08:21:37 | 2014-10-14 09:37:52 |
+————————————–+————–+——-+———+———————–+————-+——-+———————+———————+

The transfer should then no longer appear under “Sessions in Progress.”

You can reconfirm the same by login into WHM.

Categories: CPanel / WHM, Uncategorized Tags:

How to replace MySQL with MariaDB in cpanel

September 30th, 2014 No comments

Backup existing MySQL data

Make sure to save all existing data just in case there are any issues.

cp -Rf /var/lib/mysql /var/lib/mysql-old
mv /etc/my.cnf /etc/my.cnf-old

Disable the targets so cPanel no longer handles MySQL updates

The following will mark the versions of MySQL we distribute as uninstalled so they are no longer maintained by cPanel/WHM

/scripts/update_local_rpm_versions –edit target_settings.MySQL50 uninstalled
/scripts/update_local_rpm_versions –edit target_settings.MySQL51 uninstalled
/scripts/update_local_rpm_versions –edit target_settings.MySQL55 uninstalled

Remove existing MySQL RPM’s so theres a clean slate for MariaDB

The below command will uninstall the MySQL RPM’s!

/scripts/check_cpanel_rpms –fix –targets=MySQL50,MySQL51,MySQL55

Create a yum repository for MariaDB

vi /etc/yum.repos.d/MariaDB.repo

place the following inside of it depending on the DISTRO (https://downloads.mariadb.org/mariadb/repositories/):

[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/5.5.29/centos6-amd64/
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

Remove php from the /etc/yum.conf file then run the following commands

yum install MariaDB-server MariaDB-client MariaDB-devel
/etc/init.d/mysql start
mysql_upgrade
/etc/init.d/mysql restart

Add php back to the /etc/yum.conf file to ensure future php updates don’t get clobbered

Rebuild easyapache/php to ensure modules are intact/working

/scripts/easyapache –build

 

Default Automatic index page when new account is created in cpanel/WHM

November 29th, 2013 No comments

Default Automatic index page when new account is created in cpanel/WHM

 

We all want to show default index page when new account is setup. Below are the steps:

First of all we have to create below  folder.

mkdir /root/cpanel3-skel

mkdir /root/cpanel3-skel/public_html

Create default index page.

vi /root/cpanel3-skel/public_html/index.html

save and quit the file.

 

If you want user have a customized .bashrc file for their SSH sessions then you can create it.

/root/cpanel3-skel/.bashrc

 

 

 

 

Categories: CPanel / WHM Tags:

How to Configure Multiple shared IP’s in WHM

November 29th, 2013 No comments

How to Configure Multiple shared IP’s in WHM

 

It is not possible to add multiple shared IP’s from WHM but it is possible to do it from SSH.

First of all we need to create a /var/cpanel/mainips/ directory if it is not present.

mkdir /var/cpanel/mainips/

Then we have to create a file.

vi /var/cpanel/mainips/root

Add all IP’s into it. save the file and quit.

121.127.250.152
121.127.250.153
121.127.250.154

Now login to WHM and check the IP’s

Home>>IP Functions>>Show/Edit Reserved IPs

 

Categories: CPanel / WHM Tags:

how to install whmsonic in cpanel

November 29th, 2013 No comments

How to install WHMSonic in cpanel

 

Login to your server root SSH and copy/paste the following command fully and run it.

cd /root/; rm -f installr.sh; wget http://www.whmsonic.com/setupr/installr.sh; chmod +x installr.sh; ./installr.sh

 

Sample installation output:

***********************************************************************
* WHMSonic Setup v2.1.11 *
***********************************************************************
WHMSonic installer is now installing the latest version. This may take a few minutes, please wait…
–2013-11-29 00:55:15– http://www.whmsonic.com/v2/setup/whmsonic.zip
Resolving www.whmsonic.com… 67.228.53.90
Connecting to www.whmsonic.com|67.228.53.90|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 10530510 (10M) [application/zip]
Saving to: `whmsonic.zip’

 

 

WHMSonic installer is now installing the latest version. This may take a few minutes, please wait…
Dear valued customer, WHMSonic v2.1.12 has been successfully installed, you can now access to WHMSonic at your WHM Root at the bottom of your left menu.
If you have the CSF firewall installed on your server, it is updated for the radio ports by WHMSonic.

Manuals – Tutorials: http://help.sonicpanel.com
Technical Support: http://www.whmsonic.com/support/

Best Regards
SonicPanel INC

 

Categories: CPanel / WHM Tags:

Uninstall Cloudlinux from cpanel

November 29th, 2013 No comments

You can always uninstall CloudLinux. In this case, we will ‘convert’ the system

back to CentOS. Even if the original system was RHEL — we will still convert to

‘CentOS’ state.

To uninstall CloudLinux follow below steps:

wget -O cldeploy http://repo.cloudlinux.com/cloudlinux/sources/cln/cldeploy

sh cldeploy -c

Please, note that some of the packages from CloudLinux repo will still be present. They are same as CentOS packages, and don’t have to be removed. They will be updated in the future from CentOS repositories, as new versions come out.

 

You can use below steps further:

Check if your server is Cloudlinux installed in it using below command.

/usr/local/cpanel/bin/cloudlinux_system_install -c

Update your CentOS-provided RPMs

yum upgrade -y

Rebuild Apache

/usr/local/cpanel/scripts/easyapache –build

or

/scripts/easyapache –build

Reinstall a non-CloudLinux kernel.

yum –disableexcludes=all install kernel

Remove CloudLinux Kernel

rpm -qa |awk ‘/^kernel.*lve/ {print $1|”xargs yum -y erase”}’

Reinstall any CloudLinux-provided RPMs that are also provided by CentOS

rpm -qa –qf “[%{VENDOR} %{NAME}\n]”|awk ‘/CloudLinux/ {print $2|”xargs yum reinstall -y”}’

Downgrade any CloudLinux provided RPMs to the CentOS version

rpm -qa –qf “[%{VENDOR} %{NAME}\n]”|awk ‘/CloudLinux/ {print $2|”xargs yum downgrade -y”}’

Remove any remaining CloudLinux specific RPMs

rpm -qa –qf “[%{VENDOR} %{NAME}\n]”|awk ‘/CloudLinux/ {print $2|”xargs yum erase -y”}’

Upgrade any downgraded CentOS provided RPMs

yum upgrade -y

Reboot the server to use the new non-CloudLinux kernel

reboot

 

Categories: Cloud Linux, CPanel / WHM Tags:

Command to check mod_pagespeed

December 21st, 2012 No comments

Command to check mod_pagespeed is installed in server.

curl -D http://127.0.0.1

You will get below output.

 

Date: Fri, 07 Sep 2012 21:51:06 GMT
Server: Apache/2.2.3 (CentOS)
X-Mod-Pagespeed: 0.10.22.4-1633

 

Categories: Apache, CPanel / WHM, Installation Tags:

How to: Install mod_pagespeed in cpanel

December 21st, 2012 No comments

How to: Install mod_pagespeed in cpanel

Login to the server via SSH

Go to below folder

cd /usr/local/src

create directory

mkdir mod_pagespeed

Download pagespeed rpm

wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-beta_current_i386.rpm

Extract the rpm

rpm2cpio mod-pagespeed-beta_current_i386.rpm | cpio -idmv

Copy the modules to apache modules folder

cp /usr/local/src/mod-pagespeed/usr/lib/httpd/modules/mod_pagespeed.so /usr/local/apache/modules/

cp /usr/local/src/mod-pagespeed/etc/httpd/conf.d/pagespeed.conf /usr/local/apache/conf/

Provide execute permission

chmod 755 /usr/local/apache/modules/mod_pagespeed.so

Create below folders

mkdir /var/mod_pagespeed/{cache,files} -p

Provide correct ownership

chown nobody:nobody /var/mod_pagespeed/*

mod_pagespeed has a dependency that you’ll want to enable: mod_deflate (the httpd source directory (2.2.16) may vary depending on your install):

/usr/local/apache/bin/apxs -c -i /home/cpeasyapache/src/httpd-2.2.16/modules/filters/mod_deflate.c

We have to edit mod_pagespeed configuration file located at /usr/local/apache/conf/pagespeed.conf to reflect the correct paths, the LoadModule directives should fetch the modules in “modules/module_name.so”

LoadModule pagespeed_module modules/mod_pagespeed.so
LoadModule deflate_module modules/mod_deflate.so
ModPagespeedFileCachePath "/var/mod_pagespeed/cache/"
ModPagespeedGeneratedFilePrefix "/var/mod_pagespeed/files/"

After that, we’ll need to include the mod_pagespeed configuration in Apache’s configuration file (/usr/local/apache/conf/httpd.conf):

Include conf/pagespeed.conf

In order to keep the changes permanant run the command below.

/usr/local/cpanel/bin/apache_conf_distiller –update

Now restart apache service.

 

 

Categories: Apache, CPanel / WHM, Installation Tags: