OVH VPS Configure failover IP in Ubuntu

On Ubuntu

Default config look like

/etc/network/interfaces.d/50-cloud-init.cfg is used to auto configure network interface with dhcp.

First find the gateway used by the VPS.

We found the gateway IP 51.254.32.1

The VPS had main IP of the server is 51.254.35.58 and secondary IPS 94.23.153.137, 178.32.52.159, 178.32.49.157

Here is the modified /etc/network/interfaces

Here is a PHP script to create OVH failover IP config for Ubuntu/Debian.

https://gist.github.com/serverok/991f7ccd1be36cbc579e8d55caf39715

ufw

ufw is firewall in Ubuntu.

To enable

To list available apps, run

To see status, run

Stop ufw

Start ufw

Open Ports

Here are some commands to open ports.

Following command open tcp ports 8000 to 9000.

apt error after MariaDB to MySQL change

I have install MariaDB on a Ubuntu 16.04 server. Then installed Virtualmin, that require MySQL, so it removed MariaDB and installed MySQL, this caused apt stop working.

When i run “apt update”, it failed with

Next i run ‘apt-get -f install’ as it said in above error message.

That too failed. The error message is

Preparing to unpack …/mysql-server-5.7_5.7.20-0ubuntu0.16.04.1_amd64.deb …
Aborting downgrade from (at least) 10.0 to 5.7.

This is because MySQL detected MairaDB data files in /var/lib/mysql folder, it can’t use same data files as MariaDB is newer version.

To fix the problem, i renamed the folder

Now running “apt-get -f install” fixed the problem with apt.

apt show

apt show command shows information about a package.

See apt policy apt

apt policy

apt policy command show information about a package.

It shows the installed version “Installed: 2.4.18-2ubuntu3.5” and the repo from where it is installed.

See apt

automysqlbackup

Auto backup all your MySQL databases daily, weekly and monthly.

To install on Debian/Ubuntu, run

To manually backup, run

MySQL backups will be stored in folder

See backup

subprocess installed post-installation script returned error

When installing software on Ubuntu, i get following error.

To fix this, run

Replace PACKAGE_NAME_HERE with actual package that fail. In this cause spl-dkms.

See apt

update-alternatives

To change vi editor run

To display current vi config, run

apt doesn’t support architecture i386

After adding facebook hhvm repository on Ubuntu 16.04, i get following error when running “apt update” command.

This is fixed by editing

Find

Replace with

add-apt-repository

add-apt-repository command can be used to add repository in ubuntu.

To install, run

Example