Tag: Linux

class diagram

Class Diagram From PHP Code Using phUML

Today we are going to talk about UML Generator called phUML which is written in PHP. phUML is one of the best tools I have encountered to generate a class diagram from the existing PHP code. This is a common need when it comes to agile methodology. At some point we all have to write code 1st then do the documentation such as draw class diagrams for future references which is crucial for project success. There are tons of tools but most of them are paid or else not working properly but this tool is golden. Okay now if you ask me what’s phUML is, the answer is right below.

phUML is fully automatic UML class diagramm generator written PHP. It is capable of parsing any PHP5 object oriented source code and create an appropriate image representation of the oo structure based on the UML specification.

The image below here is the generated class diagram which phUML created when run on a particular codebase.

phuml generated class diagram

phUML generated class diagram

Okay let’s get down to business. – Read More –

How to setup HAProxy with Keepalived

Back once again it’s Linux time. This post also can be named as how to set up a floating IP between load balancers or how to set up a shared IP for between load balancers or how to configure a high available load-balancers. what happens here we are using keepalived, which allows us to setup HAProxy nodes to create active/passive cluster so that load can be divided amount node members. If the main HAProxy node goes down, the second one(slave node) will be elected as master node. We are getting it done using VRRP.

What & How VRRP Works

The VRRP protocol provides automatic assignment of available IP to participating hosts which ensures that one of participating nodes is master. The master and slave node acts as a group where the backup node listens for multicast packets from a node with a higher priority which could the master node. If the backup node fails to receive VRRP advertisements for a period of time longer than three times of the advertisement timer, the backup node takes the master state and assigns the configured shared/floating IP to itself. In case there are more than one backup nodes with the same priority, the one with the highest IP wins the election.

Keepalived is a routing software written in C. The main goal of this project is to provide simple and robust facilities for loadbalancing and high-availability to Linux system and Linux based infrastructures.

 

HAProxy is a free, very fast and reliable solution offering high availability, load balancing, and proxying for TCP and HTTP-based applications. It is particularly suited for very high traffic web sites and powers quite a number of the world’s most visited ones.

Today what we are trying to implement the load balancer cluster as follows. It’ll be an active/passive load balancer cluster

Keepalived & HAProxy Load Balancing

Keepalived & HAProxy Load Balancing

– Read More –

Apache with mod_proxy as a reverse proxy

So mod_proxy

This module implements a proxy/gateway for Apache. It implements proxying capability for AJP13 (Apache JServe Protocol version 1.3), FTP, CONNECT (for SSL), HTTP/0.9, HTTP/1.0, and HTTP/1.1. The module can be configured to connect to other proxy modules for these and other protocols.

This post also can be named as “How to setup a proxy passer(ProxyPass, ProxyPassReverse) in Apache2” because today we are going to look at is how to setup mod_proxy as a reserve proxy in your linux environment. You might be wondering what’s the difference between a forward proxy server and a reverse proxy server? the answer is here. There could be many situation where you want to set up a reserver proxy, couple of them are mentioned below.

  • Front an application server as tomcat or JBoss with Apache
  • Application running on a different port other than 80 or 443(we usually only expose 80 or 443 to the public)
  • Mask the underlying server/Stop direct access to the underlying server

If you are more info on why Apache should be used in front of JBoss/Glassfish/Tomcat? Check this link out. Below image depicts what we are going to do today.

Reserve proxy

Reserve proxy example, Image courtesy : stackoverflow.com

– Read More –

monit

What? How? Why? When? Monit

What Monit?

Let me explain about the utility. It has the ability to start a process if it is not running, restart a process if not responding and stop a process if uses high resources. In simple words it’s a helpful program that automatically monitors and manages server programs/resources to ensure that they stay online 24/7 while maintaining the correct file size, checksum and permissions. It’s important system monitoring tool anyone would like to have in their mission critical systems. With the web interface given you could see what’s going on with your system. In this article I’ll be covering end-to-end and providing you value links to be bookmarked in your browser(tongue-out-face).
– Read More –

rsync

rsync with Practical Examples

rsync(remote sync) commonly found on Unix-like systems which is a remote/local file synchronisation utility where It uses an algorithm that minimises the amount of data copied by only moving the portions of files that have changed. Without beating around the bush let’s get our hands dirty. I found this link really interesting. Also check out this link for the difference between scp and rsync.

Basic syntax and options of rsync

  • -v , –verbose : verbose
  • -r , –recursive : copies data recursively (but don’t preserve timestamps and permission while transferring data)
  • -a , –archive : archive mode( copy files recursively and preserve symbolic links, file permissions, user & group ownerships and timestamps)
  • -z , –compress : compress file data
  • -P , –progress : show progress during transfer

– Read More –

Older Posts
Newer Posts