Configuring Software RAID1 on a Running Ubuntu System

Here is an example of migrating a running Ubuntu system to a software RAID1.
In the process, you will need to perform two reboots.

The first step is to switch to the root user if not yet:

sudo -i

Let’s see a list of disks and partitions:

fdisk -l
fdisk -l | grep '/dev/sd'
lsblk -o NAME,UUID

Suppose that the system uses one disk, for example /dev/sda and has one main partition, /dev/sda1.
For the test, I installed a clean Ubuntu Server 18.04, the disk was parted by default, swap was the file on the same partition.

To create a raid, we connect another disk of the same size, it will be called /dev/sdb.

Continue reading “Configuring Software RAID1 on a Running Ubuntu System”

Install Apache JMeter in Ubuntu

Apache JMeter — load testing tool.

For Apache JMeter you need to install Java, see my article – Installing Java on Linux.

For an example I’ll install Apache JMeter in Ubuntu Desktop 18.04.

After Java is installed, copy the link to the archive with the latest version of Apache JMeter from the official site http://jmeter.apache.org/download_jmeter.cgi and download it:

wget http://apache.volia.net//jmeter/binaries/apache-jmeter-4.0.tgz

Extract the archive:

tar -xf apache-jmeter-4.0.tgz

Run:

cd apache-jmeter-4.0/bin/
./jmeter

After the startup, a message was displayed that you can create tests in the Apache JMeter graphical mode, and you can execute them only from the terminal, for example:

jmeter -n -t [jmx file] -l [results file] -e -o [Path to web report folder]

By the way, Apache JMeter in Windows is run through the jmeter.bat file.

Loading and Unloading Modules in Linux

In this article I will give an example of manual and automatic loading/unloading models in Linux.

First, switch to root user if not under it, for example in Ubuntu it can be done like this:

sudo -i

Let’s see a list of the downloaded modules:

lsmod

To see if a particular module has been loaded so it can (where NAME is the module name):

lsmod | grep NAME

The following commands are used to load/unload a module:

modprobe NAME
modprobe -r NAME

When the module load command is executed, modprobe looks for it in the directory:

/lib/modules/$(uname -r)

You can see what it is like:

ls /lib/modules/$(uname -r)
ls /lib/modules/$(uname -r)/kernel/net/netfilter/

To load/unload a module from another directory, you can execute the following commands:

insmod /path/to/module/name.ko
rmmod /path/to/module/name.ko

View information about the module and the possible startup parameters as follows:

modinfo NAME

You can see specific information about the module, for example, where it is located:

modinfo --filename NAME

In order for the modules to start at the very beginning of the system startup, they must be written to the /etc/modules.conf file, and in order to start last when all services are started, the file is /etc/rc.local.
In addition to the file /etc/modules.conf there is also a directory /etc/modprobe.d/, where there are similar files with the extension .conf.

For example, in rc.local modules are written like this:

/sbin/modprobe NAME

The modules.conf file is written like this:

nf_nat_ftp

To prevent the module from loading, you can write the word blacklist before the module name:

blacklist NAME

Installing the Webuzo Control Panel

For an example I’ll install the Webuzo control panel in Ubuntu 16.04 LTS.

Switch to the root user:

sudo -i

Download the installation script:

wget -N http://files.webuzo.com/install.sh

Make the script file executable:

chmod 0755 install.sh

Run the installation script:

./install.sh

We will wait until the installation is complete.
When the installation was complete, I had the following:

——————————————————–
Welcome to Webuzo Installer
——————————————————–
Installation Logs : tail -f /root/webuzo-install.log
——————————————————–
1) Installing Libraries and Dependencies
2) Setting UP WEBUZO
3) Downloading and Installing Webuzo
4) Downloading System Apps
—————————————————————-
/$$ /$$ /$$$$$$$$ /$$$$$$$ /$$ /$$ /$$$$$$$$ /$$$$$$
| $$ /$ | $$| $$_____/| $$__ $$| $$ | $$|_____ $$ /$$__ $$
| $$ /$$$| $$| $$ | $$ \ $$| $$ | $$ /$$/ | $$ \ $$
| $$/$$ $$ $$| $$$$$ | $$$$$$$ | $$ | $$ /$$/ | $$ | $$
| $$$$_ $$$$| $$__/ | $$__ $$| $$ | $$ /$$/ | $$ | $$
| $$$/ \ $$$| $$ | $$ \ $$| $$ | $$ /$$/ | $$ | $$
| $$/ \ $$| $$$$$$$$| $$$$$$$/| $$$$$$/ /$$$$$$$$| $$$$$$/
|__/ \__/|________/|_______/ \______/ |________/ \______/
—————————————————————-
Congratulations, Webuzo has been successfully installed
You can now configure Softaculous Webuzo at the following URL :
http://192.168.1.9:2004/
—————————————————————-
Thank you for choosing Webuzo !
—————————————————————-

After that I opened in the browser http://192.168.1.9:2004/, indicated the invented username and password, email and domain/IP name on which Webuzo will work.
This completes the installation and displays the following information:

You can login to the Webuzo Admin Panel using your root details at the following URL :
http://192.168.1.9:2004/
To start installing Apps you can login with the following details :
URL : http://192.168.1.9:2002/
Username : admin
Password : (the one you entered)
We request you to please register for updates and notifications at :
http://www.softaculous.com/board/index.php?act=register It also inspires us when you register. Registration is free and just a one minute job.
If you need any support you can always count on us. Just drop in at our Support Board:
http://www.webuzo.com/forums
Alternatively, you can contact us via Email at support@webuzo.com
Thank you for choosing Webuzo!

Since a free version of Webuzo is installed, many utilities and modules will become available only after upgrading to the premium version of Webuzo.

Installing Docker CE on Ubuntu

Docker CE – a software platform for deploying applications, packaging applications into a container, adding libraries and all the necessary dependencies to run the application, which allows you to quickly launch the code in almost any environment. There is a free version of Docker Community Edition (CE) and Enterprise Edition (EE).

Continue reading “Installing Docker CE on Ubuntu”

Configuring Fail2Ban for Asterisk

On the test I will use Asterisk 13.1.0 and Fail2Ban 0.9.3-1 installed in Ubuntu Server 16.04.1 LTS.

Install Fail2Ban as I wrote in this article – Installing and Configuring Fail2ban

Open the configuration file Asterisk responsible for logging events in /var/log/asterisk/messages:

sudo nano /etc/asterisk/logger.conf

Add security to messages:

messages => notice,warning,error,security

Restart the asterisk logging system:

sudo asterisk -rvv
logger reload
quit

Add the Asterisk configuration file to the directory with the Fail2Ban configuration, thus activating the monitoring of its logs:

sudo nano /etc/fail2ban/jail.d/asterisk.conf

where 86400 in seconds = 24 hours, that is, the attacker will be blocked for a day.

[asterisk]
enabled = true
bantime = 86400

Or, change the file /etc/fail2ban/jail.conf where [asterisk-tcp] and [asterisk-udp] are false to true.

Restart fail2ban for the new configuration file to load:

sudo fail2ban-client reload

Let’s check the work:

sudo fail2ban-client status asterisk

Done, now Fail2Ban will block IP addresses from which the passwords to Asterisk accounts are not correctly entered.

Configuring Fail2Ban for ProFTPd

Suppose Fail2Ban is already installed, if not, then see my article – Installing and Configuring Fail2ban.

In Fail2Ban by default, there are already filters for ProFTPd and it knows that the log file is located at /var/log/proftpd/proftpd.log, so it’s enough to create the file:

sudo nano /etc/fail2ban/jail.d/proftpd.local

And enter the data below, thereby activating the check of the log file /var/log/proftpd/proftpd.log:

[proftpd]
enabled = true
bantime = 86400

Restart Fail2Ban to apply the changes:

sudo service fail2ban restart

You can check the status:

sudo fail2ban-client status proftpd