March 2023

March 2023

Photo Of People Doing Handshakes

Implementing High Availability for Apache Web Server with Pacemaker and Corosync

In today’s digital age, having a highly available web server is crucial for any organization. With the help of Pacemaker and Corosync, system administrators can set up a high availability (HA) cluster for their web server to ensure maximum uptime and minimal downtime. In this article, we will walk through the process of configuring an Apache web server to work with a Pacemaker and Corosync HA cluster, using advanced level command line examples. Prerequisites: Before we begin, we need to make sure that the following packages are installed on our Linux-based system: If any of these packages are not installed, we can use the following command to install them: Configuring Pacemaker and Corosync:First, we need to configure Pacemaker and Corosync to work together. We can do this by creating a Corosync configuration file: In this file, we will define the Pacemaker cluster name, the IP address of each node in the cluster, and other configuration options. Once we have saved the file, we can start the Corosync service: Next, we need to create a Pacemaker resource agent for Apache: In this file, we will define the start, stop, and monitor functions for the Apache resource agent. Once we have saved the file, we can start the Pacemaker service: Configuring the Apache Web Server:Now that Pacemaker and Corosync are set up, we need to configure Apache to work with them. We can do this by creating a configuration file for Apache: An example configuration file for Apache that can be used with Pacemaker and Corosync: In this file, we will define the virtual IP address that will be used by the HA cluster. We can also define any other configuration options for Apache that we need. Once we have saved the file, we can restart the Apache service: Testing the HA Cluster:Now that everything is set up, we can test the HA cluster to make sure it is working properly. We can do this by stopping the Apache service on one node and verifying that the other node takes over: We can then check the status of the Pacemaker cluster to make sure that the other node has taken over: Conclusion:In this article, we have seen how to configure an Apache web server with Pacemaker and Corosync HA cluster. By following these steps, system administrators can ensure maximum uptime and minimal downtime for their web server. YouTube channel: https://www.youtube.com/@trainbrain007

Implementing High Availability for Apache Web Server with Pacemaker and Corosync Read More »

Silver Imac Displaying Line Graph Placed on Desk

Step-by-Step Guide to Configure Laravel Supervisor on Linux with Redis Server

This tutorial shows you how do you Configure Laravel Supervisor on Linux with Redis Server. You can use any control panel Ex: WHM/cPanel, DirectAdmin, Plesk, etc. Laravel Supervisor is a process control system that allows you to monitor and control processes on your Linux server. It is especially useful for managing long-running processes, such as queue workers or socket servers. By using Supervisor, you can ensure that your processes are always running, even if they crash or the server is restarted. It’s easy to install Laravel Supervisor on Linux. To install Supervisor in Linux with Redis server, you can follow these steps: Install Supervisor by running the following command: CentOS: Ubuntu: Install Redis server by running the following command: CentOS: Ubuntu: Start Redis server by running the following command: Create a Supervisor configuration file for your worker by running the following command: In this file, you can define your worker process and its configuration. The configuratin file should be ini file. You can create multiple worker ini file and define them in different name. Ex: worker1.ini, worker2.ini. Here’s an example configuration for a Laravel queue worker: path: /path/to/ replace this part by your actual project path. Where you keep your artisan and worker.log file. Ex. for cPanel: go to your domain public html foler where you keep artisan file. Your left side you can see the path. such as if your domain name is abc.com and hosting username is abccom in that case the link could be /home/abccom/public_html/DirectAdmin and others control panel also similar and for linux project it could be /var/www/htmlAnother easy way to find your path is, just go to your artisan file folder and use PWD command to get path. user: You have to use your hosting account username here. Ex: If Domain name abc.com and the hosting account username is abccom. You have to use abccom username in user section. This configuration will start 8 worker processes that will run the Laravel queue:work command with Redis as the queue driver. Each worker will sleep for 3 seconds between jobs and will retry failed jobs up to 3 times. The worker logs will be saved to /path/to/worker.log. Reload the Supervisor configuration by running the following command: This will read the updated configuration file and add the new worker process to Supervisor. Update Supervisor to start the new worker process by running the following command: This will update Supervisor to start the new worker process defined in your configuration file. Start the worker process by running the following command: This will start all the processes defined in the worker1.ini configuration file. Check the status of the worker processes by running the following command: This will show you the status of all the Supervisor-managed processes, including your worker processes. In summary, Laravel Supervisor is a powerful tool for managing long-running processes on your server. By configuring it correctly, you can ensure that your processes are always running and performing optimally. YouTube channel: https://www.youtube.com/@trainbrain007

Step-by-Step Guide to Configure Laravel Supervisor on Linux with Redis Server Read More »

Scroll to Top