Category Archives: Mysql

Rebuild Exim configuration

Facing issues with exim starting due to wrong exim.conf?                                                          You can fix it using below command which will rebuild exim.conf

 

root@vps [/etc]# /scripts/buildeximconf

You get below entries when rebuilding the exim.conf
Configuration file passes test!  New configuration file was installed.

Enabled system filter options: attachments|spam_rewrite
Enabled ACL options in block ACL_MAIL_PRE_BLOCK: default_mail_pre
Enabled ACL options in block ACL_RECIPIENT_POST_BLOCK: default_recipient_post
Enabled ACL options in block ACL_SPAM_SCAN_CHECK_BLOCK: default_spam_scan_check
Enabled ACL options in block ACL_CHECK_MESSAGE_PRE_BLOCK: default_check_message_pre
Enabled ACL options in block ACL_CONNECT_POST_BLOCK: default_connect_post
Enabled ACL options in block ACL_OUTGOING_NOTSMTP_CHECKALL_BLOCK: resolve_vhost_owner|end_default_outgoing_notsmtp_checkall
Enabled ACL options in block ACL_CONNECT_BLOCK: ratelimit|slow_fail_block|spammerlist
Enabled ACL options in block ACL_POST_RECP_VERIFY_BLOCK: dictionary_attack
Enabled ACL options in block ACL_TRUSTEDLIST_BLOCK: trustedmailhosts
Enabled ACL options in block ACL_IDENTIFY_SENDER_BLOCK: default_identify_sender|default_message_submission
Enabled ACL options in block ACL_MAIL_BLOCK: requirehelo|requirehelonoforge|requirehelosyntax
Enabled ACL options in block ACL_PRE_RECIPIENT_BLOCK: dkim_disable
Enabled ACL options in block ACL_CHECK_MESSAGE_POST_BLOCK: default_check_message_post
Enabled ACL options in block ACL_POST_SPAM_SCAN_CHECK_BLOCK: mailproviders
Enabled ACL options in block ACL_SMTP_QUIT_BLOCK: slow_fail_block
Enabled ACL options in block ACL_SPAM_SCAN_BLOCK: default_spam_scan
Enabled ACL options in block ACL_NOTQUIT_BLOCK: ratelimit
Enabled ACL options in block ACL_RECP_VERIFY_BLOCK: default_recp_verify
Enabled ACL options in block ACL_PRE_SPAM_SCAN: mailproviders
Enabled ACL options in block ACL_RECIPIENT_MAILMAN_BLOCK: default_recipient_mailman
Enabled ACL options in block ACL_RECIPIENT_BLOCK: default_recipient
Enabled ACL options in block ACL_MAIL_POST_BLOCK: default_mail_post
Detected spam handling in acls, disabling spamassassin in routers & transports!.
SpamAssassin method remains unchanged
Configured options list is:
ACL: acl_not_smtp is active
ACL: acl_smtp_connect is active
ACL: acl_smtp_data is active
ACL: acl_smtp_mail is active
ACL: acl_smtp_quit is active
ACL: acl_smtp_notquit is active
ACL: acl_smtp_rcpt is active
Provided options list is: deliver_queue_load_max|queue_only_load|daemon_smtp_ports|tls_on_connect_ports|system_filter_user|system_filter_group|tls_require_ciphers|hostlist loopback|hostlist senderverifybypass_hosts|hostlist skipsmtpcheck_hosts|hostlist spammeripblocks|hostlist backupmx_hosts|hostlist trustedmailhosts|hostlist relay_hosts|domainlist user_domains|smtp_accept_queue_per_connection|remote_max_parallel|smtp_receive_timeout|ignore_bounce_errors_after|rfc1413_query_timeout|timeout_frozen_after|auto_thaw|callout_domain_negative_expire|callout_negative_expire|acl_not_smtp|acl_smtp_connect|acl_smtp_data|acl_smtp_mail|acl_smtp_quit|acl_smtp_notquit|acl_smtp_rcpt|message_body_newlines|check_rfc2047_length|perl_at_start|deliver_queue_load_max|queue_only_load|daemon_smtp_ports|tls_on_connect_ports|system_filter_user|system_filter_group|tls_require_ciphers|spamd_address
Exim Insert Regex is: virtual_userdelivery|virtual_aliases|democheck|check_mail_permissions|remote_smtp|address_pipe|virtual_user|localuser|virtual_sa_user
Exim Replace Regex is: virtual_sa_user|sa_localuser|virtual_sa_userdelivery|local_sa_delivery|cpanel_archiver|cpanel_archiver_transport|discover_sender_information|fixed_login|fixed_plain|lookuphost|remote_smtp|secure_login|secure_plain
Exim Match Insert Regex is:
Exim version 4.82 #2 built 06-Feb-2014 16:42:57
Copyright (c) University of Cambridge, 1995 – 2013
(c) The Exim Maintainers and contributors in ACKNOWLEDGMENTS file, 2007 – 2013
Berkeley DB: Berkeley DB 4.7.25: (September 12, 2013)
Support for: crypteq iconv() IPv6 PAM Perl OpenSSL Content_Scanning DKIM Old_Demime Experimental_SPF Experimental_SRS
Lookups (built-in): lsearch wildlsearch nwildlsearch iplsearch dbm dbmjz dbmnz passwd
Authenticators: cram_md5 dovecot plaintext spa
Routers: accept dnslookup ipliteral manualroute queryprogram redirect
Transports: appendfile/maildir autoreply pipe smtp
Size of off_t: 4

Exim Perl Load List is: spamkey|mail_permissions|get_relayhosts_domain|checkuserquota|boxtrapper|fast_checkvalias|email_archiver|fast_isdemo|fast_accountfunc|0_mail_permissions_variables|checkpass_cphulkd|spam_acl_support|encode_string_literal|safefile|cpwrap|checkspam|z_preload_modules|email_send_limits|identify_local_connection
/etc/exim.pl.local installed!
razor2 is installed, enabled in SpamAssassin!
pyzor is not installed, disabling it in SpamAssassin to save memory
SPF is disabled in exim or unavailable, enabling SPF for SpamAssassin
/bin/chown: changing ownership of `/var/spool/exim/msglog/1WxaaD-00018g-Nl’: No such file or directory
Refreshing SMTP Mail protection.
SMTP Mail protection has been disabled.  All users may make outbound smtp connections.

 

Now Restart exim to get it going

 

root@vps [/etc]# /etc/init.d/exim  restart
Shutting down exim:                                        [  OK  ]
Shutting down spamd:                                       [  OK  ]
Starting exim:                                             [  OK  ]
0 processes (antirelayd) sent signal 9
/usr/local/cpanel/scripts/update_sa_rules: running in background
root@vps [/etc]# /scripts/buildeximconf

 

Template Loading stuck , cannot go further to Step 2 , Step 3

If you got the Template Loading stuck from RVSitebuilder Step Home.

Please contact your host provider to run force update RVSitebuilder to fix the problem.

Below are the steps your host needs to do,

perl /usr/local/cpanel/whostmgr/docroot/cgi/rvsitebuilderinstaller/autoinstaller.cgi –force

And remove the following files:

 rm -f /var/cpanel/rvglobalsoft/rvsitebuilder/www/userdata/securervsite/templateinfo.ini

/home/{user}/.rvsitebuilder/cach

/home/{user}/.rvsitebuilder/tmp

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

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