For this issue reset cpanel user password through whm.
Category Archives: Mysql
ImportError: cannot import name to_unicode
Are you getting below error while updating working on yum
root@vps [/]# yum clean packages
Traceback (most recent call last):
File “/usr/bin/yum”, line 28, in ?
import yummain
File “/usr/share/yum-cli/yummain.py”, line 32, in ?
from yum.i18n import to_unicode, utf8_width
ImportError: cannot import name to_unicode
Below are the steps to fix this issue
Download yum rpm first
root@vps [/]# wget ftp://ftp.muug.mb.ca/mirror/centos/5.10/os/i386/CentOS/yum-3.2.22-40.el5.centos.noarch.rpm
Remove the old yum rpm from server using below command
root@vps [/]# rpm -e yum –nodeps
warning: /etc/yum.conf saved as /etc/yum.conf.rpmsave
Now installed the downloaded rpm
root@vps [/]# rpm -ivh yum-3.2.22-40.el5.centos.noarch.rpm
Preparing… ########################################### [100%]
1:yum ########################################### [100%]
Now yum should work like charm
root@vps [/]# yum update
Loaded plugins: fastestmirror
Determining fastest mirrors
* addons: httpupdate.cpanel.net
* base: httpupdate.cpanel.net
* extras: httpupdate.cpanel.net
* update: httpupdate.cpanel.net
addons | 1.9 kB 00:00
base | 1.1 kB 00:00
extras | 2.1 kB 00:00
update | 1.9 kB 00:00
update/primary_db | 483 kB 00:00
Setting up Update Process
Resolving Dependencies
RTNETLINK answers: File exists
Openvz architecture in Centos 6.5 has an issue
If you are facing issues where ifconfig shows no ip address or below error
root@server [/]# ifconfig
root@server [/]# /etc/init.d/network restart
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: RTNETLINK answers: Operation not supported
Failed to bring up lo.
[FAILED]
Bringing up interface venet0: RTNETLINK answers: Operation not supported
Failed to bring up venet0.
[FAILED]
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
Below is the solution for this issue
Its due to package iproute which is causing this issue
Use below method to fix it
Login to main node of the server
[root@hostonine ~]# wget http://repo.smartservermanagement.com/misc/iproute-2.6.32-23.el6.x86_64.rpm
–2014-06-03 08:21:42– http://repo.smartservermanagement.com/misc/iproute-2.6.32-23.el6.x86_64.rpm
Resolving repo.smartservermanagement.com… 95.154.203.53
Connecting to repo.smartservermanagement.com|95.154.203.53|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 351552 (343K) [application/x-rpm]
Saving to: `iproute-2.6.32-23.el6.x86_64.rpm’
100%[====================================================================================================================>] 351,552 421K/s in 0.8s
2014-06-03 08:21:44 (421 KB/s) – `iproute-2.6.32-23.el6.x86_64.rpm’ saved [351552/351552]
#Copy the package to vps using below command where 180 is VPS ID
[root@hostonline ~]# scp -r iproute-2.6.32-23.el6.x86_64.rpm /vz/private/180/var/
#Now login to VPS
[root@hostonline ~]# vzctl enter 180
entered into CT 180
root@server [/]# cd /var/
Check for the rpm iproute
root@server [/var]# rpm -q iproute
iproute-2.6.32-31.el6.x86_64
#Remove the old rpm
root@server [/var]# rpm -e iproute-2.6.32-31.el6.x86_64 –nodeps
#Install the new RPM
root@server [/var]# rpm -Uvh iproute-2.6.32-23.el6.x86_64.rpm
warning: iproute-2.6.32-23.el6.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 192a7d7d: NOKEY
Preparing… ########################################### [100%] 1:iproute ########################################### [100%]
#Now restart networking and check
root@server [/var]# service network restart
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface venet0: Determining if ip address 127.0.0.1 is already in use for device venet0…
[ OK ]
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
WordPress Asking For FTP details every time you want to add, delete or upgrade a plugin?
Facing issues on wordpress blog where its asking for ftp login when trying to install new plugin ?
Add the below lines in wp-config.php and save it
This should do the trick in solving this issue
//*added ftp login credentials to avoid WordPress asking for FTP details every time I wanted to upgrade a plugin*
define(
'FTP_HOST'
,
'ftp.yoursite.com'
);
define(
'FTP_USER'
,
'Your_FTP_Username'
);
define(
'FTP_PASS'
,
'Your_FTP_password'
);
//*If you can use a SSL connection set this to true*
define(
'FTP_SSL'
, true);
Removing a LVM Volume Group in Linux
[root@host1Z1 ~]# vgdisplay
— Volume group —
VG Name vol_grp1
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 165
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 10
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size 839.84 GiB
PE Size 4.00 MiB
Total PE 214999
Alloc PE / Size 212480 / 830.00 GiB
Free PE / Size 2519 / 9.84 GiB
VG UUID FOtjrl-D7bL-WH71-Ls55-fDEu-7es3-mjkhAu
# lvmdiskscan
/dev/ram0 [ 16.00 MiB]
/dev/sda [ 931.51 GiB]
/dev/ram1 [ 16.00 MiB]
/dev/vol_grp1/vs1003 [ 120.00 GiB]
/dev/ram2 [ 16.00 MiB]
/dev/ram3 [ 16.00 MiB]
/dev/vol_grp1/nteraabb9q [ 120.00 GiB]
/dev/ram4 [ 16.00 MiB]
/dev/vol_grp1/vs1013 [ 120.00 GiB]
/dev/ram5 [ 16.00 MiB]
/dev/ram6 [ 16.00 MiB]
/dev/vol_grp1/vs1014 [ 60.00 GiB]
/dev/ram7 [ 16.00 MiB]
/dev/ram8 [ 16.00 MiB]
/dev/vol_grp1/ntsrmdeedm [ 60.00 GiB]
/dev/ram9 [ 16.00 MiB]
/dev/vol_grp1/vs1015 [ 210.00 GiB]
/dev/ram10 [ 16.00 MiB]
/dev/ram11 [ 16.00 MiB]
/dev/vol_grp1/vs1016 [ 150.00 GiB]
/dev/ram12 [ 16.00 MiB]
/dev/ram13 [ 16.00 MiB]
/dev/ram14 [ 16.00 MiB]
/dev/ram15 [ 16.00 MiB]
/dev/vol_grp1/vs1017 [ 70.00 GiB]
/dev/sdb1 [ 78.12 GiB]
/dev/sdb2 [ 839.84 GiB] LVM physical volume
/dev/sdb3 [ 7.81 GiB]
3 disks
24 partitions
0 LVM physical volume whole disks
1 LVM physical volume
[root@host1AZ ~]# lvscan
ACTIVE Original ‘/dev/vol_grp1/vs1003’ [120.00 GiB] inherit
ACTIVE ‘/dev/vol_grp1/vs1013’ [120.00 GiB] inherit
ACTIVE Original ‘/dev/vol_grp1/vs1014’ [60.00 GiB] inherit
ACTIVE ‘/dev/vol_grp1/vs1015’ [210.00 GiB] inherit
inactive Original ‘/dev/vol_grp1/vs1016’ [150.00 GiB] inherit
ACTIVE Snapshot ‘/dev/vol_grp1/ntsrmdeedm’ [25.00 GiB] inherit
ACTIVE Snapshot ‘/dev/vol_grp1/nteraabb9q’ [25.00 GiB] inherit
ACTIVE ‘/dev/vol_grp1/vs1017’ [70.00 GiB] inherit
inactive Snapshot ‘/dev/vol_grp1/ntdraalemj’ [25.00 GiB] inherit
inactive Snapshot ‘/dev/vol_grp1/nt0ymc1zi2’ [25.00 GiB] inherit
vgchange -ay
10 logical volume(s) in volume group “vol_grp1” now active
[root@host11Z ~]# lvchange -an /dev/vol_grp1/vs1015
[root@host144 ~]# lvremove /dev/vol_grp1/vs1015
Logical volume “vs1015” successfully removed
[root@host12Z ~]# vgdisplay
— Volume group —
VG Name vol_grp1
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 166
VG Access read/write
VG Status resizable
MAX LV 0
MX Logic blocking my mails with “554 Denied CS [*.mxlogic.net]“?
Your mails are blocked with the error message “554 Denied [CS] [*.mxlogic.net] (Mode: normal) (in reply to end of DATA command)”
What does it mean?
The mail was rejected by Mxlogic / Mcafee because of the content of the message.
Try using different message
Fatal error: Cannot make static method SGL_FrontController::run() non static in class RVSWebInit in
If you are facing issues with rvsitebuilder on cpanel server with error
“Fatal error: Cannot make static method SGL_FrontController::run() non static in class RVSWebInit in”
Run the below commands to fix it
perl /usr/local/cpanel/whostmgr/docroot/cgi/rvsitebuilderinstaller/autoinstaller.cgi –force=rvseagullmod
Then run update RVSitebuilder again.
perl /usr/local/cpanel/whostmgr/docroot/cgi/rvsitebuilderinstaller/autoinstaller.cgi –force=rvsitebuilder
Now republish the website, the error will be fixed
How to remove a logical volume
SSH to server and use the below steps
Check active volume first using
[root@load ~]# lvscan
ACTIVE ‘/dev/vg_load/lv_root’ [50.00 GiB] inherit
ACTIVE ‘/dev/vg_load/lv_home’ [53.80 GiB] inherit
ACTIVE ‘/dev/vg_load/lv_swap’ [7.50 GiB] inherit
Say you want to remove the volume /dev/vg_load/lv_home
Type the below command
[root@load ~]# lvremove /dev/vg_load/lv_home
Do you really want to remove active logical volume lv_home? [y/n]: y
Logical volume “lv_home” successfully removed
Now the logical volume is deleted
which you can confirm using
[root@load ~]# lvscan
ACTIVE ‘/dev/vg_load/lv_root’ [50.00 GiB] inherit
ACTIVE ‘/dev/vg_load/lv_swap’ [7.50 GiB] inherit
[root@load ~]# lvdisplay
— Logical volume —
LV Path /dev/vg_load/lv_root
LV Name lv_root
VG Name vg_load
LV UUID jFKRVb-kzMk-bOkE-DZIR-T5PW-fkyf-Tb6txr
LV Write Access read/write
LV Creation host, time load.onlinesupport4u.in, 2014-04-07 00:28:58 -0400
LV Status available
# open 1
LV Size 50.00 GiB
Current LE 12800
Segments 1
Allocation inherit
Read ahead sectors auto
– currently set to 256
Block device 253:0
— Logical volume —
LV Path /dev/vg_load/lv_swap
LV Name lv_swap
VG Name vg_load
LV UUID zNsC2f-9vxE-9cgA-6eFv-0Yrk-JWqG-GFEsId
LV Write Access read/write
LV Creation host, time load.onlinesupport4u.in, 2014-04-07 00:29:30 -0400
LV Status available
# open 1
LV Size 7.50 GiB
Current LE 1920
Segments 1
Allocation inherit
Read ahead sectors auto
– currently set to 256
Block device 253:1
Domain name Transfer
To transfer the domain name from your old domain registrar to us Please apply using below URL
Once done please make sure the at your old domain registrar
1) You need to disable the privacy Protection 2) Disable Theft Protection 3) Get the EPP or Authorization code and email it to us at support@onlinesupport4u.in along with domain name
Domain name transfer take minimum 5 days to get transferred.
The mod_security plugin could not connect to the database: cPanel
If you have been getting the error “The mod_security plugin could not connect to the database”
Below are the steps to rectify it
SSH to server
Check the password set for modsec database using below command,
In my case below was the password
root@vps [~]# grep “dbpassword” /etc/cron.hourly/modsecparse.pl
my $dbpassword = ‘qS_lqkU5mXkA’;
my $dbh = DBI->connect( “DBI:mysql:$dbname:$dbhost”, $dbuser, $dbpassword )
The password set in my case as qS_lqkU5mXkA
Now login into mysql and use below steps
root@vps [~]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1569
Server version: 5.5.36-cll MySQL Community Server (GPL)
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.
mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> UPDATE user SET Password=PASSWORD(‘qS_lqkU5mXkA’) WHERE USER=’modsec’;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> quit
Login to WHM >> Plugin > Mod_security
You should be able to see working Mod_security