cd /usr/local/src
wget https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz
tar xvf ffmpeg-release-amd64-static.tar.xz
cd ffmpeg-*-amd64-static/
cp ffmpeg ffprobe qt-faststart /usr/bin/
cp -r model /usr/local/share/
This will change varnish listening port to 80. If you need to change to another port, change “-a :80” to whatever port you want to use. Save and exit the editot.
On a KVM Virtual machine using LVM storage, the LVM disk is partitioned as follows.
root@mail:~# parted /dev/vg1/iredmail print
Model: Linux device-mapper (linear) (dm)
Disk /dev/dm-1: 64.4GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 2097kB 1049kB bios_grub
2 2097kB 1076MB 1074MB ext4
3 1076MB 64.4GB 63.3GB
root@mail:~#
I want to mount partition number 2 on the host machine.
2 2097kB 1076MB 1074MB ext4
To make the partition available to mount, you need to use kpartx utility. Install kpartx with
apt install kpartx
To make the partitions inside the Logical volume available to mount, use the command
kpartx -a LVM_DEIVE_NAME
In this case, I used
kpartx -a /dev/vg1/iredmail
Now lvscan command will display the new device
root@mail:~# lvscan
ACTIVE '/dev/vg1/win10' [100.00 GiB] inherit
ACTIVE '/dev/vg1/iredmail' [60.00 GiB] inherit
ACTIVE '/dev/ubuntu-vg/ubuntu-lv' [29.50 GiB] inherit
root@mail:~#
To mount the device, you can use the command
mount /dev/ubuntu-vg/ubuntu-lv /mnt
IMPORTANT: do not mount the device on the host if it is used in the guest VM as it will result in data corruption. I mounted the disk on the host machine and created some files, but it did not show in the guest. After I reboot the guest VM, it did not boot back, I had to do fsck to get the VM to work again.
Nuster is a high performance HTTP proxy cache server. It is based on haproxy.
To configure multiple SSL certificates in nuster, create SSL in PEM format.
Edit nuster.cfg, you will see something like the following.
global
nuster cache on dir /cache
nuster manager on uri /internal/nuster purge-method PURGEX
frontend fe
bind *:443 ssl crt /etc/ssl/ssl1.pem alpn h2,http/1.1
mode http
default_backend ssl_443
backend ssl_443
mode http
nuster cache off
nuster rule all disk on ttl 7d
http-request set-header X-Client-IP %[src]
server s1 128.1.2.9:443 ssl verify none
To remove a logical volume, you can use the command
lvremove /dev/vg-name/lv-name
Example
lvremove /dev/vg1/win10
This will remove logical volume with the name “win10” from volume group “vg1”.
[root@Alma-85-amd64-base ~]# lvremove vg1/data1
Do you really want to remove active logical volume vg1/data1? [y/n]: y
Logical volume "data1" successfully removed.
[root@Alma-85-amd64-base ~]#
To disable a rule in ModSecurity, edit Apache configuration, add
SecRuleRemoveById RULE_ID_SEPERATED_BY_SPACE
This needed to be added after all rules were loaded.
On Ubuntu, I edited the file
/etc/apache2/mods-enabled/security2.conf
Here is what I have in a server which disables rules 941180 949110 980130
<IfModule security2_module>
# Default Debian dir for modsecurity's persistent data
SecDataDir /var/cache/modsecurity
# Include all the *.conf files in /etc/modsecurity.
# Keeping your local configuration in that directory
# will allow for an easy upgrade of THIS file and
# make your life easier
IncludeOptional /etc/modsecurity/*.conf
# Include OWASP ModSecurity CRS rules if installed
IncludeOptional /usr/share/modsecurity-crs/*.load
SecRuleRemoveById 941180 949110 980130
</IfModule>
On a CentOS 7 server, when login as user root on the console, login fails. If I log in as a normal user, then I am able to switch to user root with the command “su – root”.
On checking /var/log/secure, I found the following error.
Nov 10 03:44:42 localhost login: pam_securetty(login:auth): access denied: tty 'tty1' is not secure !
Nov 10 03:44:45 localhost login: pam_succeed_if(login:auth): requirement "uid >= 1000" not met by user "root"
Nov 10 03:44:47 localhost login: FAILED LOGIN 1 FROM tty1 FOR root, Authentication failure
cwebp is a command line program used to convert images into webp format.
To install cwebp on CentOS 7, run
sudo yum -y install libwebp-tools
WebP is an image format that does lossy compression of digital photographic images. WebP consists of a codec based on VP8, and a container based on RIFF. Webmasters, web developers and browser developers can use WebP to compress, archive and distribute digital images more efficiently.
To see files in this package, run the command “rpm -q –filesbypkg libwebp-tools”
If you have lost the root password of your CentOS 7 system and have access to the console directly or using KVM, you can reset the password following the instructions below.
1) Reboot the server, you will see the grub menu.
2) Press “e” to edit. You will see the edit screen as shown below.