Parse html as PHP is easyapache 4

 

Normal rule in .htaccess to parse html files as php on easyapache 3 are not working on easyapache 4

#AddType application/x-httpd-php .php .htm .html

#<FilesMatch “\.(htm|html|php)$”>
#SetHandler application/x-httpd-php56
#</FilesMatch>

 

Below is the code which will need to be added In cpanel, multiphp manager will add the following for force a specific
version of php:

# php — BEGIN cPanel-generated handler, do not edit
# Set the “ea-php54” package as the default “PHP” programming language.

AddType application/x-httpd-ea-php54 .php .php5 .phtml

# php — END cPanel-generated handler, do not edit

Make sure the AddType and the selected php version matches! So there we go, simple when you know how.

 

 

DNS error bad owner name (check-names) /tmp/cpanel

While working with one client I was getting below error in DNS

DNS error bad owner name (check-names) /tmp/cpanel

So I went ahead and checked DNS zone file using below command

 

root@vps [/var/named]# named-checkzone onlinecsource.com /var/named/onlinesource.com.db
/var/named/onlinesource.com.db:56: _autodiscover._tcp.cheapsalesleads.onlinesource.com: bad owner name (check-names)
/var/named/onlinesource.com.db:57: _autodiscover._tcp.cheapsalesleads.onlinesource.com: bad owner name (check-names)
zone onlinesource.com/IN: loaded serial 2017030209
OK

So the error pointed to line 56 and 57 in zone file

Went ahead and deleted the line 56 and 57 and reload DNS zone file

All works good now

 

 

 

Sorry, the domain xx.xx.104.in-addr.arpa is owned by another user (nobody)

While adding rDNS file in cpanel server I was getting below mentioned error

Sorry, the domain xx.xx.104.in-addr.arpa is owned by another user (nobody)

I have found that at one point in the past this domain was present on this server.

I have removed remnants of the domain from /var/cpanel/users/system and removed references to it from /etc/userdomains and /etc/remotedomains.

I then rebuilt the various caches:

====
/scripts/updateuserdatacache
/scripts/updateuserdomains
====

I am now able to add zone file without any issues

 

Ignore table and dump mysql database

-bash-4.1# mysqldump satmn13_drup189 > satmn13_drup1891.sql
mysqldump: Got error: 1146: Table ‘satmn13_drup189.dr_cache_admin_menu’ doesn’t exist when using LOCK TABLES

-bash-4.1# mysqldump satmn13_drup189 –ignore-table=satmn13_drup189.dr_cache_admin_menu > satmn13_drup1891.sql

Incorrect DiskSpace and Information in cPanel

While working on one clients vps for incorrect disk usage  stats for mails

While the default cpanel has no emails the usage stats showed 750MB.

After going through I found a issue which was causing this

The file causing this issue was maildirsize

maildirsize is the file which shows stats information for each account

root@vps [/home/designse]# find . -iname maildirsize
./mail/designserver.net/gordon/maildirsize
./mail/designserver/gordy/maildirsize
./mail/designserver/auctions/maildirsize
./mail/designserver/homemedia/maildirsize
./mail/maildirsize

I went ahead and deleted the file to fix this issue.
root@vps [/home/designse]# cd mail/
root@vps [/home/designse/mail]# rm -rf maildirsize
root@vps [/home/designse/mail]#

Now all stats shows right details

 

 

 

 

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