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

 


CVE-2014-7169 BASH Shell Shock Vulnerability for Linux

September 29th, 2014 No comments

What is CVE-2014-7169 / Shell Shock Vulnerability?

GNU Bash through 4.3 bash43-025 processes trailing strings after certain malformed function definitions in the values of environment variables, which allows remote attackers to write to files or possibly have unknown other impact via a crafted environment, as demonstrated by vectors involving the ForceCommand feature in OpenSSH sshd, the mod_cgi and mod_cgid modules in the Apache HTTP Server, scripts executed by unspecified DHCP clients, and other situations in which setting the environment occurs across a privilege boundary from Bash execution.
NOTE: this vulnerability exists because of an incomplete fix for CVE-2014-6271.
In short Shell Shock vulnerability allows remote attackers to execute arbitrary code given certain conditions, by passing strings of code following environment variable assignments.
The Shell Shock vulnerability is considered bigger than Heartbleed as it’s affecting all versions of bash and it’s still unclear from when and adding to that linux bash is not only running on linux webservers but other embedded devices as well such as Mac Laptops

Test your server bash version using below command

bash –version
or
/bin/bash –version

Output

GNU bash, version 3.2.25(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2005 Free Software Foundation, Inc.

Check if your server is affected

[email protected][#] env x='() { :;}; echo vulnerable’ bash -c “echo this is a test”
bash: warning: x: ignoring function definition attempt
bash: error importing function definition for`x’
this is a test

If you get the above output then you are safe. But,  if you get the below output then you are affected.

[email protected][#] env x='() { :;}; echo vulnerable’ bash -c “echo this is a test”
vulnerable
this is a test

To fix it follow below steps:

For RedHat/CentOS/Fedora/RPM based OS:

Note:: This is a temporary fix released by Red Hat Security Team. The team is still working on a full fix which is expected to release soon.

[email protected][#] yum upgrade bash

For Ubuntu / Debian

apt-get update && sudo apt-get install –only-upgrade bash

 

 


Categories: Installation, Security Tags:

How to install kloxo panel in centos

June 16th, 2014 No comments

How to install kloxo panel in centos

Go to below path.

cd /usr/local/src

Use the wget Command to download latest version of Kloxo Auto Installer Script

wget http://download.lxcenter.org/download/kloxo/production/kloxo-installer.sh

Give proper permission.

chmod 777 kloxo-installer.sh

Install Kloxo control panel as Master.

./kloxo-installer.sh –type=master

Next follow the instructions. Once done you will get below message.

Congratulations. Kloxo has been installed succesfully on your server as master

You can connect to the server at:
https:/IP/:7777 – secure ssl connection, or
http:/IP/:7778 – normal one.

The login and password are ‘admin’ ‘admin’. After Logging in, you will have to
change your password to something more secure

We hope you will find managing your hosting with Kloxo
refreshingly pleasurable, and also we wish you all the success
on your hosting venture

Thanks for choosing Kloxo to manage your hosting, and allowing us to be of
service

 

Once you will get the above message then try accessing above link in browser. If still you are unable to access it then try adding port in iptables.

You can use one of the below command to enable port in iptables:

iptables -A INPUT -p tcp -m tcp –dport 7777:7778 -j ACCEPT

or

iptables -A INPUT -p tcp -m tcp –dport 7777 -j ACCEPT
iptables -A INPUT -p tcp -m tcp –dport 7778 -j ACCEPT

Once done restart the iptables.

/etc/init.d/iptables restart

 

 

 


Categories: Installation Tags:

Idera backup agent configuration

June 4th, 2014 No comments

How to configure Idera backup agent

 

Installing Agent Using YUM

First, create a YUM .repo file with the R1Soft repository information.

Open the new file with a text editor such as vi or nano:

# cd /etc/yum.repos.d

vi r1soft.repo

Insert the following text into the file and save the file:

[r1soft]
name=R1Soft Repository Server
baseurl=http://repo.r1soft.com/yum/stable/$basearch/
enabled=1
gpgcheck=0

Once done run below command.

yum clean all

Now install cdp agent

yum install r1soft-cdp-enterprise-agent
yum install kernel-devel kernel-headers
yum upgrade kernel

install r1soft kernel binaries

r1soft-setup –no-binary

Restart r1soft agent after binaries are done.

Check connectivity

r1soft-setup –test-connection

Insert key using below command

serverbackup-setup –get-key http://IP

Restart the server. Once server is online check cdp-agent is running or not. If not then start that service.

Sometimes you will face connectivity issue at that check port is opened on server firewall. Default port is 1167

iptables -I INPUT -p tcp –dport 1167 -j ACCEPT

Save iptables and restart it and test it again.

Front end task done. Now backend  task

Login to backend admin panel of r1soft

Click on servers.

Add server It will ask for server name VM hostname, IP address things insert it and click on create button.

Then click on Users.

username: customer-name >> password >> email

then click on server tab add the new server you created for the customer. Give full control. No volumes.

Then click on disks safes.

name same as servers name :  on server drop down arrow search for the servers you added earlier, volume pick volume1. click on Limits. Put recovery points and archive to 3.

Quota on disk size : soft 48 hard quota 50. Click on create.

Policy make the policy to backup weekly, merge weekly, disk verification weekly, exclude files you don’t want to backup to avoid using all disk space.

then when finish give client his R1SOFT credentials.

 

 

 

 

 


Categories: Installation, Uncategorized Tags:

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:

How to install ioping in linux server

September 9th, 2013 No comments

How to install ioping in linux server

This tool lets you monitor I/O latency in real time. It shows disk latency in the same way as ping shows network latency.

Login to SSH.

Go to the folder where you want to download it.

cd /usr/local/src

Download the installation file.

https://ioping.googlecode.com/files/ioping-0.6.tar.gz

Extract that file using below command.

tar -xzvf ioping-0.6.tar.gz

Go inside that folder.

cd ioping-0.6

compile it using below command.

make ioping

 

Examples

Show disk I/O latency using the default values and the current directory, until interrupted

$ ioping .
4096 bytes from . (ext4 /dev/sda3): request=1 time=0.5 ms
4096 bytes from . (ext4 /dev/sda3): request=2 time=0.4 ms
4096 bytes from . (ext4 /dev/sda3): request=3 time=0.5 ms
4096 bytes from . (ext4 /dev/sda3): request=4 time=12.7 ms
4096 bytes from . (ext4 /dev/sda3): request=5 time=0.4 ms
^C
— . (ext4 /dev/sda3) ioping statistics —
5 requests completed in 4794.0 ms, 364 iops, 1.4 mb/s
min/avg/max/mdev = 0.2/2.8/12.7/5.0 ms

Measure disk seek rate (iops)

ioping -R /dev/sda

— /dev/sda (device 465.8 Gb) ioping statistics —
186 requests completed in 3004.6 ms, 62 iops, 0.2 mb/s
min/avg/max/mdev = 6.4/16.0/26.8/4.7 ms

Measure disk sequential speed (mb/s)

ioping -RL /dev/sda

— /dev/sda (device 465.8 Gb) ioping statistics —
837 requests completed in 3004.1 ms, 292 iops, 72.9 mb/s
min/avg/max/mdev = 2.0/3.4/28.9/2.0 ms

For VPS’s also it will work.

4096 bytes from / (simfs /dev/simfs): request=1 time=8.2 ms
4096 bytes from / (simfs /dev/simfs): request=2 time=0.2 ms
4096 bytes from / (simfs /dev/simfs): request=3 time=0.2 ms
4096 bytes from / (simfs /dev/simfs): request=4 time=0.2 ms
4096 bytes from / (simfs /dev/simfs): request=5 time=0.2 ms

 


Categories: Installation, Uncategorized Tags: