Author Archives: LinuxTech

Emails going to Spam folder issue

We do get complaints of emails going to spam folder most of the times while working.

The solution to such a issues depends on 3 things

  1. rdns for the IP address and matching A record for the domain name in question.
  2. Need to setup right SPF
  3. Need to setup right DKIM

a) To setup SPF for a domain name can use tool http://www.spfwizard.net/

b) For DKIm you can use tool  from Socketslab

Domain Key / DKIM Generation Wizard

for DKIm you can use key name as key1 or domain1 or any random words

c) Once done you can check whether its valid or not using a vaiidator

http://dkimvalidator.com/results

For validitor you need to send email to email ID shown on screen and check once done click on show results

Where it will show if set  DKIM and spf are valid or not

 

 

 

E-mail accounts not showing in cPanel

The issue when you open “Email accounts” in cPanel, it sometimes doesn’t show up the list of Email accounts the domain have but only just a blank page without any email account

No Email Accounts”!

This happens due to bulk of cache, temp files etc present in the .cpanel directory of domain. In order to rectify the problem we can remove the “.cpanel” directory inside the path /home/cpaneluser/.

Once removed restart the cpanel service and try access the cpanel page/email accounts.

The issue will be solved. No issues with the “.cpanel” directory, it will automatically recreate next time when you load the account’s cPanel.

Softacalous blank issue cPanel/WHM

While working one of the clients server

We saw an issue where going from WHM > plugin > Softacalous and opening it resulted in blank page.

The issue is due to corrupt files in softacalous.

To fix this issue softacalous need to be reinstalled

to reinstall to go

cd  /usr/local/cpanel/whostmgr/docroot/cgi/

rm -rf softaculous

cd /home

wget -N http://files.softaculous.com/install.sh
chmod 755 install.sh
./install.sh


Once done softacalous was working fine

Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again

While working on a server on installing php 5.6 on centos 6 OS

I was getting error “Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again”

After googleing around I found this issue is due to https mentioned in the .repo file in /etc/yum.repos.d

[root@host yum.repos.d]# ls -la
total 28
drwxr-xr-x. 2 root root 4096 Oct 28 05:15 .
drwxr-xr-x. 80 root root 4096 Oct 28 05:16 ..
-rw-r–r–. 1 root root 954 Oct 28 05:15 epel.repo
-rw-r–r–. 1 root root 1056 Nov 4 2012 epel-testing.repo
-rw-r–r–. 1 root root 966 Jul 4 2015 webtatic-archive.repo
-rw-r–r–. 1 root root 862 Oct 28 05:15 webtatic.repo
-rw-r–r–. 1 root root 966 Jul 4 2015 webtatic-testing.repo

I checked in all files with .repo extension and  an replaced all https with http and  all repository started working fine

 

 

 

cPanel – Can’t change hostname

While setting hostname from WHM  >>  Change Hostname
We were seeing below error
“The hostname was already set to server1k.online.net, syncing configuration only.
Error setting new hostname: Could not execute hostname binary
Could not set property: Connection timed out”
After googling found a alternate solution to this via cli
The command was   /usr/local/cpanel/bin/set_hostname  <hostname>

It would and could change hostname 🙂

 

Disable Mails from single cPanel account

We were having an issue where spams emails were sent from single cpanel account

We could not suspend the account and disable emails

So the solution to this was to keep website online and disable only emails

we use the below method to disable emails for a single cPanel account.

SSH to server and use below steps to disable cpanel for any account

The newwebho is the cpanel user name

root@online [~]# chmod 0 /home/newwebho/etc/
root@online[~]# chattr +ia /home/newwebho/etc/
root@eu [~]#

 

 

view external: query (cache) ‘.in-addr.arpa/PTR/IN’ denied

While working on some issue on clients server I could

see large number of DNS request in /var/log/messages which were flooding DNS server

Jul 27 12:48:55 oklahoma named[14354]: client 74.125.72.2#33485: view external: query (cache) ‘192.245.129.104.in-addr.arpa/PTR/IN’ denied
Jul 27 12:48:55 oklahoma named[14354]: client 173.194.103.8#53106: view external: query (cache) ‘31.249.129.104.in-addr.arpa/PTR/IN’ denied
Jul 27 12:48:55 oklahoma named[14354]: client 74.125.72.147#39348: view external: query (cache) ‘27.249.129.104.in-addr.arpa/PTR/IN’ denied
Jul 27 12:48:55 oklahoma named[14354]: client 173.194.103.7#40721: view external: query (cache) ‘34.249.129.104.in-addr.arpa/PTR/IN’ denied
Jul 27 12:48:55 oklahoma named[14354]: client 173.194.90.9#63592: view external: query (cache) ‘192.245.129.104.in-addr.arpa/PTR/IN’ denied

 

The solution for such issues is by adding few parameter in /etc/named.conf which is bind configuration file

Add the following under options:
recursion no;
additional-from-auth no;
additional-from-cache no;

and restart named

and now I see no such request coming to DNS which has fixed DNS flood issue

Disable Ipv6 on Centos-5

On up-to-date RHEL5 or CentOS5 (currently that means 5.10 aka 5U10)

Add the following line to /etc/sysctl.conf:

On a live system you can disable it with:

Disable Strict Mode mysql mariadb

While working on WHMCS I was not able to generate tickets

I found out issue was due to mysql being in strict mode

I tried disabling mysql strict mode  by adding entries in  /etc/my.cnf

sql_mode=””

However it didnt work out.

I have found that there is a /usr/my.cnf file that is enabling strict mode on  server.

This file contained the following:

====
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
====

I removed the STRICT_TRANS_TABLES option and saved the file. All that is left is to restart the MySQL server. You can do this at your convenience with the following command:

====
/scripts/restartsrv_mysql
====

Once it is restarted, strict mode should be disabled.