Posts

Showing posts with the label webserver

ANSIBLE: Haproxy Configuration over AWS using Ansible

Image
  CONFIGURATION OF HAPROXY  USING ANSIBLE OVER AWS Lets configure Reverse Proxy that is  Haproxy  using ansible Playbook. Check this blog to know more about Haproxy :  ANSIBLE : Configuration of Haproxy As every server has a hard coded limit . At one point in time, only limited clients can connect to the web server. If more clients try to connect, the will get some error. That's why we are using  Load Balancer.  Here we want to achieve  high availability  and  extra security  for our web server using haproxy. But the problem is that, if we need to add more servers, we can add them by adding their IP in inventory file and run the playbook. But  how Load balancer will come to know that more servers have been added???? For this we will have to manually update the configuration file of Haproxy. And manually updating is not good as we are using ansible. So the solution is, we can use  JINJA  language to write code in ...

WordPress on the top of EC2 instance and AWS RDS

Image
There are few steps you need to follow to Launch WordPress on the top of AWS EC2 instance and AWS RDS for databases :  1. Create an AWS EC2 instance   2.  Configure the instance with Apache Webserver.   3. Install php  4.  Download php application name "WordPress".  5.  Setup a MySQL server using AWS RDS service.  6.  Provide the endpoint/connection string to the WordPress application. 1.  Launch EC2 instance : So first we need to launch EC2 instance and in that instance we will configure our webserver. For this, to check how to launch instance in AWS step by step, go through my this blog: AWS - Create EBS, Launch instance and attach 2.  Configure the instance with Apache Webserver : Install apache web server using this command :  yum install httpd 3. Install php :   Because WordPress is a website written in php, we need to install php. And for this we need to install php version 7.4 that is compatible ...

ANSIBLE : Handlers

Image
 PROBLEM :   We all know that ansible is famous for it's  idempotency .  But if we configure some service and if we change anything in it's configuration file, then we need to restart that service.  The problem is : if configuration file is unchanged, then? Then also our ansible task will run and restart service unnecessarily. In this case, ansible is not working as idempotent. Our service will restart every time we run the playbook, even if configuration file is not updated. SOLUTION : HANDLERS We can use Handlers in Ansible to tackle this problem.  Handlers are just like a normal task. Handlers will perform an action when listens for a notify event. If nothing notifies a handler, it will not run. Regardless of how many tasks notify a handler, it will run only once, after all of the tasks completed in a particular play. To know more about ansible and it's playbook, check my this blog :  ANSIBLE : How Industries are solving Challenges using Ans...

ANSIBLE : Configuration of Haproxy

Image
  ANSIBLE Ansible  automates and simplifies repetitive, complex, and tedious operations . Everybody likes it because it brings  huge time savings  when we install packages or configure large numbers of servers. Its architecture is simple and effective. It works by connecting to your nodes and pushing small programs to them. These programs make the system comply with a desired state, and, when they have finished their tasks, they are deleted. To know more about ansible, check my this blog :    ANSIBLE : How Industries are solving Challenges using Ansible HAPROXY HAProxy is an open source, free, very fast and reliable solution offering high availability, load balancing and proxying for TCP and HTTP-based applications.  It is particularly suited for web sites crawling under very high loads while needing persistence or Layer7 processing. It distributes a workload across a set of servers to maximize performance and optimize resource usage. HAProxy can be us...

ANSIBLE : Apache Web Server on DOCKER Container using Ansible

Image
ANSIBLE Ansible  automates and simplifies repetitive, complex, and tedious operations . Everybody likes it because it brings  huge time savings  when we install packages or configure large numbers of servers. Its architecture is simple and effective. It works by connecting to your nodes and pushing small programs to them. These programs make the system comply with a desired state, and, when they have finished their tasks, they are deleted. Ansible  works over SSH  and doesn't require any daemons, special servers, or libraries to work. A text editor and a command line tool are usually enough to get your work done. You simply describe your infrastructure in a text file (INI) and then all the information about the desired state of these machines are organized in playbooks . It is able to gather node information (such as IP addresses or Operating System details) into so-called " facts ", which help with the selective and automated provisioning of different configura...