Author Archives: LinuxTech

FAILED to open PAM security session (Module is unknown)

Cron Jobs in server were not getting executed automatically

On investigating I could see error like

Jun 16 14:05:01 ok1110 crond[5913]: (root) FAILED to open PAM security session (Module is unknown)
Jun 16 14:05:01 ok1110 crond[5912]: (root) FAILED to open PAM security session (Module is unknown)
Jun 16 14:06:01 ok1110 crond[6021]: (root) FAILED to open PAM security session (Module is unknown)

On deeper investigating I found the issue was in file

 /etc/pam.d/crond

I went ahead and copied file from working server and fixed this issue.

  • PAM configuration is the default:
$ cat /etc/pam.d/crond
#
# The PAM configuration file for the cron daemon
#
#
auth       sufficient pam_env.so
auth       required   pam_rootok.so
auth       include    system-auth
account    required   pam_access.so
account    include    system-auth
session    required   pam_loginuid.so
session    include    system-auth


If this file is modified the crond does not work for any users.

 

 

 

E: Unable to locate package Ubuntu

While trying to install some new software in Ubuntu I was getting error

E: Unable to locate package Ubuntu

I tried updating using command sudo apt-get update

However it didnt work

sudo apt-get install anydesk_2.9.1-1_amd64.deb
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package anydesk_2.9.1-1_amd64.deb
E: Couldn’t find any package by glob ‘anydesk_2.9.1-1_amd64.deb’
E: Couldn’t find any package by regex ‘anydesk_2.9.1-1_amd64.deb’
home@home:~/Desktop/shraddha$ cd ..

 

You need to use command  sudo dpkg –install    filename.deb to get this installed

 

sudo dpkg –install anydesk_2.9.1-1_amd64.deb
Selecting previously unselected package anydesk.
(Reading database … 247265 files and directories currently installed.)
Preparing to unpack anydesk_2.9.1-1_amd64.deb …
Unpacking anydesk (2.9.1-1) …
Setting up anydesk (2.9.1-1) …
Processing triggers for gnome-menus (3.13.3-6ubuntu3) …
Processing triggers for desktop-file-utils (0.22-1ubuntu5) …
Processing triggers for bamfdaemon (0.5.3~bzr0+16.04.20160415-0ubuntu1) …
Rebuilding /usr/share/applications/bamf-2.index…
Processing triggers for mime-support (3.59ubuntu1) …
Processing triggers for hicolor-icon-theme (0.15-0ubuntu1) …
Processing triggers for man-db (2.7.5-1) …

 

 

 

 

IDN Addon Domain Issue

We had been working on adding an IDN addon domain in cPanel and received invalid domain name.

Internationalized domain name – Wikipedia
An internationalized domain name (IDN) is an Internet domain name that contains at least one label that is displayed in software applications, in whole or in part, in a language-specific script or alphabet

Domain cannot be added directly in cPanel because domain contains at least one label

Domain Name : lamé.com

We need to use below converter to convert the IDN to ASCII

http://idna-converter.com/?decoded=lam%C3%A9.com&encoded=&doencode=Encode+%3E%3E

Unicode url/domain: lamé.com

ASCII/Punycode (ACE) : xn--lam-dma.com

Once domain is converted in ASC can be added in cPanel.

 

Adding International Character domain in cpanel

To add international  characters as domain name in cpanel

First it need to be converted to unicode to punycode  using http://idna-converter.com/

Once done the domain name can be added accordingly

 

 

Windows VPS KVM virtualizor issue

We had been working on installing windows vps on virtualizor

Intermittently its Internet would go off

The issue was due to NIC setting in VPS

We has to set the NIC type in VPS to e1000  to fix this issue

It can be done in Edit  VPS > Advanced Option > Virtual Network Interface Type

Now we see vps working fine

 

 

 

***** FATAL: Failed to download updatenow.static from server: The system cannot update the /var/cpanel/sysinfo.config file. at /usr/local/cpanel/Cpanel/GenSysInfo.pm line 115.

While trying to upgrade cpanel  to new version was getting error

FATAL: Failed to download updatenow.static from server:

The issue was due to corrupt RPM

I used the below fix to resolve this issue


mkdir /root/old_rpm_dbs/

Now move the original RPMs to the new folder

mv /var/lib/rpm/__db* /root/old_rpm_dbs/

Finally rebuild the RPM database

rpm --rebuilddb

Now you can force an update of the cPanel server and it should work again.

/scripts/upcp -force

Failed to connect 1006 VNC virtualizor

While working on one of the nodes which has Virtualizor Software was facing issues accessing VNC . giving error failed to connected 1006

The issue was due to Virtualizor upgrade

Below is the command you need to execute to kill all process using below command for VNC to work

[root@os1126 ~]# kill $(pgrep -f “/usr/local/virtualizor/enduser/themes/default/novnc/utils/websockify”)
[root@os1126 ~]# kill $(pgrep -f “/usr/local/virtualizor/enduser/themes/default/novnc/utils/websockify”)
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec … or kill -l [sigspec]

Now after retrying accessing virtualizor I can see it working fine

“chown: Invalid username: root:Disk”

The server was not allowing login to server even when ssh keys were saved

On rebooting server I could see it and error on screen “chown: Invalid username: root:Disk”

On troubleshooting found error to be due to corruption of /etc/passwd  as this is where all users are saved and due to corruption the user  root was missing in  /etc/passwd

So I got the serve in single user mode and fastboot as only single user mode wont server and would restart

Once I got access to single user I just moved the /etc/passwd to /etc/passwd.bkp and  copied  /etc/paswd.OLD which was in  /etc to /etc/passwd

Now on rebooting server i can see it working fine. 🙂

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.

 

 

[RVSiteBuilder] Cannot connect using curl_init

While working on one of the issues came across the error  cannot connect using curl_init in rvsitebuilder

The issue was a simple fix by skipping DNS checking by creating below file using command

touch /var/cpanel/rvglobalsoft/rvsitebuilder/var/skip_validate_domain

The issue got resolved with this fix