Install Monit monitoring system on CentOS 8 - How to do it

This article covers how to #install Monit on #Centos 8 system. Also, we dealt with how to configure Monit on Centos, adjusting the configuration and setting up alerts to notify the users.

#Monit is a free, open-source process supervision tool for Unix and Linux. With Monit, system status can be viewed directly from the command line, or via the native HTTP(S) web server. Monit is able to do automatic maintenance, repair, and run meaningful causal actions in error situations.


To enable web interface you need to make changes in monit configuration file. 

The main configuration file of monit located at /etc/monit. conf under (RedHat/CentOS/Fedora) and /etc/monit/monitrc file for (Ubuntu/Debian/Linux Mint). 

Monit is very easy to use nearly out of the box. By default, it is set up to check that services are running every 2 minutes and stores its log file in “/var/log/monit.


To Install Monit to monitor your server running CentOS:

1. Install EPEL repository: yum install epel-release yum update.

2. Install Monit: yum install monit.

3. Activate Monit to start automatically during the system boot and start it: systemctl enable monit systemctl start monit.


To #Install #Monit Package on #Ubuntu:

Run the commands given below;

sudo apt update

sudo apt install monit


After installing Monit, the commands below can be used to stop, start and enable Monit service;

sudo systemctl stop monit.service

sudo systemctl start monit.service

sudo systemctl enable monit.service

Read More




Enable and Configure MPIO on Windows Server 2016 2012 R2

This article covers how to enable Multi-Path Input-Output or MPIO on a Windows server either from a graphical interface using the Server Manager console or from the PowerShell command line. 

Multipathing is the technique of creating more than one physical path between the server and its storage devices. It results in better fault tolerance and performance enhancement. Oracle VM Servers are installed with multipathing enabled because it is a requirement for SAN disks to be discovered by Oracle VM Manager.


To Install MPIO in Windows Server 2008 R2:

Note You must restart the server after you follow these steps.

1. Open Server Manager. To do this, click Start, click Administrative Tools, and then click Server Manager.

2. In Server Manager, click Features, and then click Add Features.

3. Select the Multipath I/O feature for installation, and then click Next.

4. Finish the installation by confirming the selections, and then restart the server.


To Configure MPIO for StorSimple volumes:

MPIO must be configured to identify StorSimple volumes. 

To configure MPIO to recognize StorSimple volumes, follow these steps:

1. Open the MPIO configuration. To do this, click Start, click Administrative Tools, and then click MPIO.

2. In the MPIO window, click Add on the MPIO Devices tab.

3. Type SSIMPLE Model in the Add MPIO Support window under Device Hardware ID.

4. Restart the server when you are prompted.


To Mount a StorSimple volume in Windows Server 2008 R2:

After MPIO is configured on the server, volumes that are created on the StorSimple appliance can be mounted and can take advantage of MPIO for redundancy. 

To mount a volume, follow these steps:

1. Open the iSCSI Initiator Properties dialog box on the server. To do this, click Start, click Administrative Tools, and then click iSCSI Initiator.

2. In the iSCSI Initiator Properties dialog box, click the Discovery tab, and then click Discover Portal.

3. Type the IP address of the "DATA" port on the StorSimple appliance.

Note If you use a private network for iSCSI connections, type the IP address of the DATA port that is connected to the private network.

4. Click the Targets tab in the iSCSI Initiator Properties dialog box. This displays the StorSimple appliance iSCSI qualified name (IQN) in the Discovered Targets section.

5. Click Connect to establish the iSCSI session with the StorSimple appliance. In the Connect To Target dialog box, click to select the Enable multi-path check box.

6. Open Server Manager. To do this, click Start, click Administrative Tools, and then click Server Manager.

7. In Server Manager, click Storage, and then click Disk Management. Volumes that are created on the StorSimple appliance and that are visible to this server appear under Disk Management as new disks.

8. Initialize the disk and create a new volume. During the format process, select a block size of 64 kilobytes (KB).

9. Under Disk Management, right-click the disk, and then click Properties.

10. In the SSIMPLE Model #### Multi-Path Disk Device Properties dialog box, click the MPIO tab, click Details in the DSM Name section, and then verify that the parameters are set to the default parameters.

Read More




Date Time in Laravel and PHP with Carbon

This article covers how to manage date/time easily in Laravel and PHP with Carbon. Basically, Carbon is a package that helps us to deal with date/time in Laravel and PHP in a much easier and systematic manner.

Working with date and time in PHP is not the easiest or most clear of tasks. We have to deal with strtotime, formatting issues, lots of calculations, and more.


Carbon provides some nice functionality to deal with dates in PHP such as:

1. Dealing with timezones

2. Getting current time easily

3. Converting a datetime into something readable

4. Parse an English phrase into datetime (first day of January 2016)

5. Add and Subtract dates (+ 2 weeks, -6 months)

6. Semantic way of dealing with dates


Carbon is already included in Laravel so there's no need to go and add it with Composer.

Whenever we need to use Carbon, we can import it like so:

<?php

use Carbon\Carbon;

After importing you can do a lot with this great package.

Read More




Jenkins setup with Docker and JCasC - Automate it now

This article covers how to perform Jenkins Configuration as Code (JCasC) method which can help us to automate the setup of Jenkins using Docker. 

This will automate the installation and configuration of Jenkins using Docker and the Jenkins Configuration as Code (JCasC) method.

Jenkins uses a pluggable architecture to provide most of its functionality. 

JCasC makes use of the Configuration as Code plugin, which allows you to define the desired state of your Jenkins configuration as one or more YAML file(s), eliminating the need for the setup wizard. 

On initialization, the Configuration as Code plugin would configure Jenkins according to the configuration file(s), greatly reducing the configuration time and eliminating human errors.


Just as the Pipeline plugin enables developers to define their jobs inside a Jenkinsfile, the Configuration as Code plugin enables administrators to define the Jenkins configuration inside a YAML file. 

Both of these plugins bring Jenkins closer aligned with the Everything as Code (EaC) paradigm.

Read More




Install and Configure Mahara on Ubuntu

This article covers how to install Mahara. Basically, Mahara is a popular ePortfolio and social networking system that helps educators to develop a digital classroom in a remote learning environment and track student's progress. 

Mahara also has many non-student applications. You can use it to build a blog, a resume-builder, a file-repository, or a competency framework.

Mahara is a fully featured web application to build your electronic portfolio. 

You can upload files, create journals, embed social media resources from the web and collaborate with other users in groups. 


To install Mahara on Ubuntu:

1. 1. Login to your VPS via SSH

ssh user@vps

2. Update the system

[user]$ sudo apt-get update && sudo apt-get -y upgrade

3. Install MariaDB

To install MariaDB, run the following command:

[user]$ sudo apt-get install -y mariadb-server

4. Create MariaDB database for Mahara

Next, we need to create a database for our Mahara installation.

[user]$ mysql -u root -p
MariaDB [(none)]> CREATE DATABASE mahara character set UTF8;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON mahara.* TO 'maharauser'@'localhost' IDENTIFIED BY 'your-password';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> \q

Do not forget to replace 'your-password' with a strong password.

5. Install Apache2 Web Server

Install Apache2 web server

[user]$ sudo apt-get install apache2

6. Install PHP

Install PHP and required PHP modules

To install the latest stable version of PHP version 5 and all necessary modules, run:

[user]$ sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt php5-mysql php5-gd

7. Download and extract Mahara

Download and extract the latest version of Mahara on your server:

[user]$ sudo cd /opt && wget https://launchpad.net/mahara/16.04/16.04.1/+download/mahara-16.04.1.zip
[user]$ sudo unzip mahara-16.04.1.zip
[user]$ sudo mv mahara-16.04.1 /var/www/html/mahara
Create Mahara’s upload directory
[user]$ sudo mkdir /var/www/html/mahara/upload/

8. Configure Mahara

Create Mahara’s config.php

In the Mahara ‘htdocs’ directory there is config-dist.php file. Make a copy of this called config.php.

[user]$ cd /var/www/html/mahara/htdocs/
[user]$ sudo cp config-dist.php config.php

Open the config.php and make the necessary changes where appropriate.

[user]$ sudo nano config.php
$cfg->dbtype   = 'mysql';
$cfg->dbhost   = 'localhost';
$cfg->dbport   = null;
$cfg->dbname   = 'mahara';
$cfg->dbuser   = 'maharauser';
$cfg->dbpass   = 'your-password';
$cfg->dataroot = '/var/www/html/mahara/upload/';

All files have to be readable by the web server, so we need to set a proper ownership

[user]$ sudo chown www-data:www-data -R /var/www/html/mahara/

9. Configure Apache Web Server

Create a new virtual host directive in Apache. For example, create a new Apache configuration file named ‘mahara.conf’ on your virtual server:

[user]$ sudo touch /etc/apache2/sites-available/mahara.conf
[user]$ sudo ln -s /etc/apache2/sites-available/mahara.conf /etc/apache2/sites-enabled/mahara.conf
[user]$ sudo nano /etc/apache2/sites-available/mahara.conf
Then, add the following lines:
<VirtualHost *:80>
ServerAdmin admin@yourdomain.com
DocumentRoot /var/www/html/mahara/htdocs/
ServerName your-domain.com
ServerAlias www.your-domain.com
<Directory /var/www/html/mahara/htdocs/>
Options FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/apache2/your-domain.com-error_log
CustomLog /var/log/apache2/your-domain.com-access_log common
</VirtualHost>

10. Restart and Verify

Restart the Apache web server for the changes to take effect:

[user]$ sudo service apache2 restart

Open your favorite web browser, navigate to http://your-domain.com/ and if you configured everything correctly the Mahara installer should be starting.

Read More




SELinux on CentOS 7 - Set it up now

This article covers how to set up SELinux on #CentOS 7. #SELinux is a security mechanism built into the Linux kernel. Linux distributions such as CentOS, RHEL, and Fedora are equipped with SELinux by default.

SELinux improves server security by restricting and defining how a server processes requests and users interact with sockets, network ports, and essential directories.


To check SELinux mode:

The easiest way on how to check SELinux ( Security Enhanced Linux ) operation mode is to use getenforce command. 

This command without any options or arguments will simply print a current status SELinux operational mode. 

Furthermore, the current status of SELinux operational mode can be set permanently or temporarily.


To check whether SELinux is enabled or not:

1. Use the getenforce command. [vagrant@vagrantdev ~]$ getenforce Permissive.

2. Use the sestatus command.

3. Use the SELinux Configuration File i.e. cat /etc/selinux/config to view the status.


To configure SELinux to enforcing mode:

1. Open the /etc/selinux/config file in a text editor of your choice, for example: # vi /etc/selinux/config.

2. Configure the SELINUX=enforcing option: # This file controls the state of SELinux on the system.

3. Save the change, and restart the system: # reboot.


To enable SELinux without rebooting:

1. Changing the SELinux mode at run time. If SELinux is disabled it cannot be enabled without rebooting.

2. To detemine the current Mode of SELinux.

3. Changing the SELinux mode Permanently. In the /boot/grub/grub.conf file add a line: selinux=0.

4. Or in /etc/sysconfig/selinux change.


To permanently change mode to permissive:

1. Edit the /etc/selinux/config file as follows: # This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced.

2. Restart the system: $ reboot.

Read More





Focus on your business, not your servers.

Click Here to Learn More




Recent Post