Install Percona XtraDB Cluster for MySQL 5.7 on Debian 8

First of all, why we choose three nodes and not only two? In any cluster, the number of nodes should be odd, so in the case of disconnection of a node, we assume that the highest group of servers has the fresh data, and should be replicated to the down node to avoid data loss. This is related only to resolve conflicts in data replication, we won’t loose data written only to the disconnected node.

This is used to avoid a circumstance called split brain, in which we can’t automatically choose which node has correct data. Think for example of a 2 node cluster where both nodes are disconnected from each other, and the same record is written to both nodes: who wins when they come back online? We don’t know, so split brain happens, and we have to manually decide wich record is the right one.

The number of nodes that is needed to determine wich part of the cluster has the right data is called QUORUM, in our case, the quorum will be 2. So we need 2 servers always be connected to each other. In case all three nodes will go down, we have a split brain and we must decide wich server should go in bootstrap mode manually, this is the procedure to determine wich will be the main server to resume from the split brain.

Configuring Percona XtraDB Cluster on Debian 8

This tutorial describes how to install and configure three Percona XtraDB Cluster nodes on Debian 8 servers, we will be using the packages from the Percona repositories.

Node 1
Hostname: mysql1.local.vm
IP address: 192.168.152.100
Node 2
Hostname: mysql2.local.vm
IP address: 192.168.152.110
Node 3
Hostname: mysql3.local.vm
IP address: 192.168.152.120

On each host, modify file /etc/hosts as follows to ensure DNS will work correctly.

Read more

Share

Configure Apache With Self-Signed TLS/SSL Certificate on Ubuntu 16.04

Step 1: Generating the certificate

First, let’s create a place to store the file.

mkdir ~/certificates
cd ~/certificates

Generate CSR and private key.

openssl req -x509 -newkey rsa:4096 -keyout apache.key -out apache.crt -days 365 -nodes

It will ask for information for the certificate request. Complete with the appropriate information.

Country Name (2 letter code) [AU]: US
State or Province Name (full name) [Some-State]: FL
Locality Name (eg, city) []: Miami
Organization Name (eg, company) [My Company]: My Company
Organizational Unit Name (eg, section) []:

Common name should be your domain name or the server’s IP address. Also, fill in your email.

Read more

Share

Install and setup Plex Media Server Ubuntu 16.04

Plex is a free feature-rich media library platform that provides a way to store all your movies, shows, and other media in one place. You can access Plex from any device, whether you’re at home or on-the-go. There are many different media tools available in the world like, Kodi, Xmbc, OSMC and Mediatomb, but the Plex Media Server is perhaps one of the most popular solutions for managing media. Plex runs on Windows, macOS, Linux, FreeBSD and many more. Plex is a client-server media player system made up from two main components, 1) The Plex Media Server, which organizes music, photos and videos content from personal media libraries and streams it to their player, 2) The Players that can be the Plex web UI, Plex Apps or Plex home theater. Plex Media Server supports Chromecast, Amazon FireTV, Android, iOS, Xbox, PlayStation, Apple TV, Roku, Android TV and various types of smart TVs. If you are looking for a way to watch your movies from anywhere, then Plex is best choice for you.

In this tutorial, we will learn how to install and configure Plex Media Server on Ubuntu 16.04.

Requirements

  • A server running Ubuntu 16.04.
  • A not-root user with sudo privileges setup on your server.
  • A static IP address 192.168.0.227 setup on your server.

Getting Started
Before starting, make sure your system is fully up to date by running the following command:

sudo apt-get update -y
sudo apt-get upgrade -y

Once your system is updated, restart your system to apply all these changes with the following command:

sudo reboot

After restarting, log in with sudo user and proceed to the next step.

Read more

Share

Vesta- How to set up master-slave DNS cluster

If you are looking for the options to avoid any DNS-related downtime or the way to manage dns across all server you have, you might consider to set up dns cluster.

Create user dns-cluster on a server which will be used as dns slave

On the second server (slave) with vestacp you should create new user with name dns-cluster (via gui or cli)Code: 

v-add-user dns-cluster passowrd yourmail@example.tld

On the first server (master) you should run this command:

Read more

Share

Install Vesta Control Panel (vestacp) on Centos 7 with PHP-FPM and PHP 7.2

I had few issues on my container and KVM on installing vestacp. Issues were like quite weird, such as-

  1. Post installation on KVM- it moved into emergency maintenance mode
  2. Post installation on LXC container- DNS resolution halted

After hours and hours of search, found few root causes-

  1. I have to withdraw quota with vestacp installation package
  2. No firewall on LXCcontainer

So let’s start.

Download installation script

curl -O http://vestacp.com/pub/vst-install.sh

Run it

bash vst-install.sh --nginx yes --phpfpm yes --apache no --named yes --remi yes --vsftpd yes --proftpd no --iptables no --fail2ban no --quota no --exim yes --dovecot yes --spamassassin yes --clamav yes --softaculous yes --mysql yes --postgresql no --hostname yourdomain.com --email yourmail@yourdomain.com --password yourpassword

You can also generate your installation command from vesta website:

Read more

Share

SPF, DKIM, DMARC – Sample and perfect record values

Sharing some sample record value of the post subject for future reference:

SPF:

domain.gov.bd. IN TXT "v=spf1 a mx ip4:1.2.3.4 ?all"

DKIM:

MDaemon._domainkey.domain.gov.bd. IN TXT "v=DKIM1; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDIaJcNDjvJ6LJ/zyZCIOuaQiLMSC+FBfky8JMFE7LUGlP4LXwmpaKO3Z67x+PVXgYbbFU9nzLaFOfIXTbsCh6LYLBgQF+PNghbTAchQ59IEMrMRsTPCCg95+gKYRupN0B96Uz7rrXifZL8T+yl9MkpIlAsXXs7e8Vhzwa94NdVjQIDAQAB"

DMARC:

_dmarc.domain.gov.bd. 3600 IN TXT "v=DMARC1; p=quarantine; sp=quarantine; rua=mailto:postmaster@domain.gov.bd; ruf=mailto:postmaster@domain.gov.bd; rf=afrf; pct=100; ri=86400"

DMARC Generator: 

https://www.unlocktheinbox.com/dmarcwizard/

Share

Enable DNSBL or RBL on Zimbra

DNS-based Blackhole List (DNSBL) or Real-time Blackhole List (RBL) is an effort to fight spam emails. It is a blacklist of source IP addresses that have a reputation of sending spam emails. Most email systems can be configured to check these lists and block or flag emails that were sent from domains/IPs listed there. The ‘Blackhole List’ is sometimes called ‘blacklist’ by email admins.

In this tutorial, we’ll see how we can configure RBL with Zimbra using both GUI and CLI.

Method 1 – GUI:

Login to the Zimbra admin console – https://mail.example.com:7071, and then go to Configure.

Then, go to Global Settings.

Read more

Share

SSH Tunnel on PuTTY

Most of you have probably used a tunnel with an SSH connection. What you probably weren’t aware of is that you can use a dynamic tunnel to access all remote infrastructure. Furthermore, you can specify a port and a destination IP to have direct access. This process is achieved through your PuTTY configuration.

In this procedure, we will use Internet Explorer, Firefox and an RDP connection to demonstrate the use of a tunnel with an SSH connection, as well as configuring the tunnel with several other protocol types.

Local Port Forwarding

Step 1 – Load the Session
In your PuTTY configuration, configure the Host Name and Port of your remote SSH computer­. Enter your Saved Sessions name, and click Save. If your session already exists, Load it as shown below:

Read more

Share

ZImbra troubleshooting incoming mail problems

Problem

If you’re having trouble receiving mail from outside, you need to find out where the message is failing. When sending your test message, check the Log Files, especially /var/log/zimbra.log, on your MTA server. It’s often helpful to tail the logfile as you send the message:

tail -f /var/log/zimbra.log

If you see nothing logged (no connection, nothing) then the problem likely either DNS or your firewall.

Resolution

Firewall
To troubleshoot your firewall, it helps to have an account on a system outside of your network. For mail to flow inbound, servers on the internet need to connect to your MTA on port 25.

DNS issues
The mail domain that your user accounts are created under must have an MX record. To test this:

host -t mx domain

The IP address returned should be the IP (public or private) of your MTA. If it’s the public address, make sure that the Firewall is forwarding port 25 to the MTA.

Read more

Share

Reset Vesta CP (vestacp) admin password

Method 1

  1. Login to your server via SSH.
  2. Enter the below command to change the password.
  3. $ v-change-user-password admin newpassword
  4. Replace the newpassword field with the new password you want to set.

Method 2

  1. Login to your server via SSH.
  2. Enter command following command.
  3. $ passwd admin
  4. Enter new UNIX password:
  5. Retype new UNIX password:
  6. passwd: password updated successfully.
Share