FFMPEG and PHPFFMPEG installlation on Centos 7

yum install epel-release

yum localinstall –nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm

yum install ffmpeg ffmpeg-devel

mkdir /root/source

cd /root/source/

git clone https://github.com/tony2001/ffmpeg-php.git

cd ffmpeg-php/

/opt/cpanel/ea-php56/root/usr/bin/phpize

./configure –with-php-config=/opt/cpanel/ea-php56/root/usr/bin/php-config

nake && make install

Add line extension=ffmpeg.so in php.ini and restarted httpd

error while loading shared libraries: libasound.so.2: cannot open shared object file: No such file or directory

I was gettnig error mentioned below

“error while loading shared libraries: libasound.so.2:” on Centos 7 OS

yum -y install alsa-lib-devel fixed the issue

yum -y install alsa-lib-devel
Loaded plugins: fastestmirror, universal-hooks
Loading mirror speeds from cached hostfile

  • EA4: 208.74.123.61
  • cpanel-addons-production-feed: 208.74.123.61
  • cpanel-plugins: 208.74.123.61
  • base: www.gtlib.gatech.edu
  • epel: mirror.oss.ou.edu
  • extras: mirror.dal10.us.leaseweb.net
  • nux-dextop: mirror.li.nux.ro
  • updates: mirror.dal10.us.leaseweb.net
    Resolving Dependencies
    –> Running transaction check
    —> Package alsa-lib-devel.x86_64 0:1.1.8-1.el7 will be installed
    –> Processing Dependency: alsa-lib = 1.1.8-1.el7 for package: alsa-lib-devel-1.1.8-1.el7.x86_64
    –> Processing Dependency: libasound.so.2()(64bit) for package: alsa-lib-devel-1.1.8-1.el7.x86_64
    –> Running transaction check
    —> Package alsa-lib.x86_64 0:1.1.8-1.el7 will be installed
    –> Finished Dependency Resolution

Dependencies Resolved

============================================================================================================================================================================================================

Package Arch Version Repository Size

Installing:
alsa-lib-devel x86_64 1.1.8-1.el7 base 963 k
Installing for dependencies:
alsa-lib x86_64 1.1.8-1.el7 base 425 k

Transaction Summary

Install 1 Package (+1 Dependent package)

Total download size: 1.4 M
Installed size: 15 M
Downloading packages:
(1/2): alsa-lib-1.1.8-1.el7.x86_64.rpm | 425 kB 00:00:00

(2/2): alsa-lib-devel-1.1.8-1.el7.x86_64.rpm | 963 kB 00:00:00

Total 3.5 MB/s | 1.4 MB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : alsa-lib-1.1.8-1.el7.x86_64 1/2
Installing : alsa-lib-devel-1.1.8-1.el7.x86_64 2/2
Verifying : alsa-lib-1.1.8-1.el7.x86_64 1/2
Verifying : alsa-lib-devel-1.1.8-1.el7.x86_64 2/2

Installed:
alsa-lib-devel.x86_64 0:1.1.8-1.el7

Dependency Installed:
alsa-lib.x86_64 0:1.1.8-1.el7

Complete!
[root@ok1061 yum.repos.d]#
[root@ok1061 yum.repos.d]#
[root@ok1061 yum.repos.d]# ffmpeg -version
ffmpeg version 2.8.15 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-36)
configuration: –prefix=/usr –bindir=/usr/bin –datadir=/usr/share/ffmpeg –incdir=/usr/include/ffmpeg –libdir=/usr/lib64 –mandir=/usr/share/man –arch=x86_64 –optflags=’-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong –param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic’ –extra-ldflags=’-Wl,-z,relro ‘ –enable-libopencore-amrnb –enable-libopencore-amrwb –enable-libvo-amrwbenc –enable-version3 –enable-bzlib –disable-crystalhd –enable-gnutls –enable-ladspa –enable-libass –enable-libcdio –enable-libdc1394 –enable-libfdk-aac –enable-nonfree –disable-indev=jack –enable-libfreetype –enable-libgsm –enable-libmp3lame –enable-openal –enable-libopenjpeg –enable-libopus –enable-libpulse –enable-libschroedinger –enable-libsoxr –enable-libspeex –enable-libtheora –enable-libvorbis –enable-libv4l2 –enable-libx264 –enable-libx265 –enable-libxvid –enable-x11grab –enable-avfilter –enable-avresample –enable-postproc –enable-pthreads –disable-static –enable-shared –enable-gpl –disable-debug –disable-stripping –shlibdir=/usr/lib64 –enable-runtime-cpudetect
libavutil 54. 31.100 / 54. 31.100
libavcodec 56. 60.100 / 56. 60.100
libavformat 56. 40.101 / 56. 40.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 40.101 / 5. 40.101
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.101 / 1. 2.101
libpostproc 53. 3.100 / 53. 3.100
[root@ok1061 yum.repos.d]#

Debian7 404 error

Was working on Debian 7 server and on trying to update using command apt-get update was getting 404 error

I could see 404 error on command apt-get update

root@debian:/home/nvc# vi /etc/resolv.conf
root@debian:/home/nvc# apt-get update
Ign cdrom://[Debian GNU/Linux 7.11.0 Wheezy – Official amd64 DVD Binary-1 20160605-17:36] wheezy Release.gpg
Ign cdrom://[Debian GNU/Linux 7.11.0 Wheezy – Official amd64 DVD Binary-1 20160605-17:36] wheezy Release
Ign cdrom://[Debian GNU/Linux 7.11.0 Wheezy – Official amd64 DVD Binary-1 20160605-17:36] wheezy/contrib amd64 Packages/DiffIndex
Ign cdrom://[Debian GNU/Linux 7.11.0 Wheezy – Official amd64 DVD Binary-1 20160605-17:36] wheezy/main amd64 Packages/DiffIndex
Ign cdrom://[Debian GNU/Linux 7.11.0 Wheezy – Official amd64 DVD Binary-1 20160605-17:36] wheezy/contrib Translation-en_US
Ign cdrom://[Debian GNU/Linux 7.11.0 Wheezy – Official amd64 DVD Binary-1 20160605-17:36] wheezy/main Translation-en_US
Ign http://security.debian.org wheezy/updates Release.gpg
Ign http://security.debian.org wheezy/updates Release
Err http://security.debian.org wheezy/updates/main Sources
404 Not Found [IP: 151.101.128.204 80]
Err http://security.debian.org wheezy/updates/contrib Sources
404 Not Found [IP: 151.101.128.204 80]
Err http://security.debian.org wheezy/updates/main amd64 Packages
404 Not Found [IP: 151.101.128.204 80]
Err http://security.debian.org wheezy/updates/contrib amd64 Packages
404 Not Found [IP: 151.101.128.204 80]
Ign http://security.debian.org wheezy/updates/contrib Translation-en_US
Ign http://security.debian.org wheezy/updates/contrib Translation-en
Ign http://security.debian.org wheezy/updates/main Translation-en_US
Ign http://security.debian.org wheezy/updates/main Translation-en
W: Failed to fetch http://security.debian.org/dists/wheezy/updates/main/source/Sources 404 Not Found [IP: 151.101.128.204 80]

W: Failed to fetch http://security.debian.org/dists/wheezy/updates/contrib/source/Sources 404 Not Found [IP: 151.101.128.204 80]

W: Failed to fetch http://security.debian.org/dists/wheezy/updates/main/binary-amd64/Packages 404 Not Found [IP: 151.101.128.204 80]

W: Failed to fetch http://security.debian.org/dists/wheezy/updates/contrib/binary-amd64/Packages 404 Not Found [IP: 151.101.128.204 80]

E: Some index files failed to download. They have been ignored, or old ones used instead.

The solution to this problem was to be clear

/etc/apt/sources.list and add below entries

cat /etc/apt/sources.list
deb http://archive.debian.org/debian wheezy main
deb http://archive.debian.org/debian-security wheezy/updates main

now apt-get working fine

apt-get install vim
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following extra packages will be installed:
vim-common vim-runtime vim-tiny
Suggested packages:
ctags vim-doc vim-scripts indent
The following NEW packages will be installed:
vim vim-runtime
The following packages will be upgraded:
vim-common vim-tiny
2 upgraded, 2 newly installed, 0 to remove and 122 not upgraded.
Need to get 5,945 kB of archives.
After this operation, 24.8 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://archive.debian.org/debian-security/ wheezy/updates/main vim-tiny amd64 2:7.3.547-7+deb7u4 [355 kB]
Get:2 http://archive.debian.org/debian-security/ wheezy/updates/main vim-common amd64 2:7.3.547-7+deb7u4 [163 kB]
Get:3 http://archive.debian.org/debian-security/ wheezy/updates/main vim-runtime all 2:7.3.547-7+deb7u4 [4,586 kB]
Get:4 http://archive.debian.org/debian-security/ wheezy/updates/main vim amd64 2:7.3.547-7+deb7u4 [842 kB]
Fetched 5,945 kB in 0s (9,099 kB/s)
Reading changelogs… Done
(Reading database … 31607 files and directories currently installed.)
Preparing to replace vim-tiny 2:7.3.547-7 (using …/vim-tiny_2%3a7.3.547-7+deb7u4_amd64.deb) …
Unpacking replacement vim-tiny …
Preparing to replace vim-common 2:7.3.547-7 (using …/vim-common_2%3a7.3.547-7+deb7u4_amd64.deb) …
Unpacking replacement vim-common …
Selecting previously unselected package vim-runtime.
Unpacking vim-runtime (from …/vim-runtime_2%3a7.3.547-7+deb7u4_all.deb) …
Adding ‘diversion of /usr/share/vim/vim73/doc/help.txt to /usr/share/vim/vim73/doc/help.txt.vim-tiny by vim-runtime’
Adding ‘diversion of /usr/share/vim/vim73/doc/tags to /usr/share/vim/vim73/doc/tags.vim-tiny by vim-runtime’
Selecting previously unselected package vim.
Unpacking vim (from …/vim_2%3a7.3.547-7+deb7u4_amd64.deb) …
Processing triggers for man-db …
Processing triggers for mime-support …
Setting up vim-common (2:7.3.547-7+deb7u4) …
Setting up vim-tiny (2:7.3.547-7+deb7u4) …
Setting up vim-runtime (2:7.3.547-7+deb7u4) …
Processing /usr/share/vim/addons/doc
Setting up vim (2:7.3.547-7+deb7u4) …
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vim (vim) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vimdiff (vimdiff) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rvim (rvim) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rview (rview) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vi (vi) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/view (view) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/ex (ex) in auto mode

CGI download issue

Enable CGI through .htaccess

To enable CGI through .htaccess, perform the following steps:

  1. Log in to your server as the root user via SSH.
  2. Change to the /usr/local/apache/conf/ directory.
  3. Create a backup of your httpd.conf file. For example:

Note: In this example, http-old.conf represents the backup file’s name.

4. Open your http.conf file with a text editor and locate the section of the file that resembles the following example:

1 2 3 4<Directory "/"> Options +ExecCGI +FollowSymLinks +Includes +IncludesNOEXEC +Indexes -MultiViews +SymLinksIfOwnerMatch AllowOverride None </Directory>

  1. Change the AllowOverride line’s value from None to All.

Your server now allows CGI scripts to run in all directories.

fix corrupted named.conf in cPanel

We had an issue where in cPanel server where we had our rDNS settings

were no working. On editing and saving the file from WHM , Rdns worked

Found the issue was due to corrupted named.conf

Below are the steps undertaken to rebuild named.conf

mv /etc/named.conf /etc/named.conf.bak

/usr/local/cpanel/scripts/rebuilddnsconfig

/scripts/restartsrv_named

Now rdns and other records are working fine:)

Exim Error: Failed to create directory “/var/spool/exim/db”: Permission denied

We came across an issue where emails were not coming to server

on checking logs we saw below error

failed to open DB file /var/spool/exim/db/ratelimit: Permission denied (euid=47 egid=12)

We executed below steps to fix the error


1003 2020-05-20 11:38:14 rm -fv /var/spool/exim/db/*
1004 2020-05-20 11:38:30 service exim restart
1005 2020-05-20 11:39:22 chown -R mailnull.mail /var/spool/exim
1006 2020-05-20 11:40:19 chmod 0750 /var/spool/exim
1007 2020-05-20 11:40:25 /scripts/upcp –force

Change SSH port on Centos 7

Open file using command

vi /etc/ssh/sshd_config

#Port 22

remove the # symbol and change the default port 22 and change it accordingly to your preference

save the file and exit

semanage port -a -t ssh_port_t -p tcp 2244 where 1234 is my ssh port

firewall-cmd --permanent --zone=public --add-port=1234/tcp

firewall-cmd --reload

systemctl restart sshd.service

Now telnet <server IP > port to make sure the ssh port is working before logging off from server

named.service failed. Centos Web Panel

Named on Centos webpanel was not starting on server

On checking logs only below information were displayed

named.service – Berkeley Internet Name Domain (DNS)
Loaded: loaded (/usr/lib/systemd/system/named.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Fri 2020-03-13 07:30:38 EDT; 5min ago
Process: 24466 ExecStartPre=/bin/bash -c if [ ! “$DISABLE_ZONE_CHECKING” == “yes” ]; then /usr/sbin/named-checkconf -z “$NAMEDCONF”; else echo “Checking of zone files is disabled”; fi (code=exited, status=1/FAILURE)


Mar 13 07:30:38 OK1129.test.com systemd[1]: named.service: control process exited, code=exited status=1
Mar 13 07:30:38 OK1129.test.com systemd[1]: Failed to start Berkeley Internet Name Domain (DNS).
Mar 13 07:30:38 OK1129.test.com systemd[1]: Unit named.service entered failed state.
Mar 13 07:30:38 OK1129.test.com systemd[1]: named.service failed.

To find errors you need to use below command and fix the displayed error to get DNS online

named-checkconf -z /etc/named.conf

Invalid command ‘SetEnv’, perhaps misspelled or defined by a module not included in the server configuration,

While working on server

We saw one website giving 500 error

On checking I see error was coming on .htaccess rules

/docs/subdomains/my/public_html/.htaccess: Invalid command ‘SetEnv’, perhaps misspelled or defined by a module not included in the server configuration

To resolve this problem, we need to install the module ‘mod_env’ manually.

For easyapache4 users,

#yum install ea-apache24-mod_env.x86_64