Recover disk usage after deleting large file in Linux

Disks getting full on Linux is a common scenario any administrator have probably experienced. There are usually some large files in /var/log directory that can be compressed or deleted to save disk space. Have you ever experienced deleting a large log file and noticed that the disk usage remained the same ? It’s as if the file size usage is not released even though you’ve deleted it?

This scenario can happen if you deleted/renamed/moved an existing file that is currently in use by a running program. This usually happens on log files that are not rotated regularly and then when the file size becomes large, you deleted (or compressed) the file without even checking if it is in-use. Don’t worry, you can still recover your disk space as shown from the example below.

Continue reading “Recover disk usage after deleting large file in Linux”

Configuring Elastic Load Balancer on Amazon EC2

Load balancers are used to distribute the requests/queries to multiple server instances. Most web infrastructures have multiple front-end servers that share the load of the application. Although there are multiple server instances, the end-user only see them a single node. In this tutorial, I’ll walk you on how to configure an Elastic Load Balancer on Amazon, add your web server nodes and point your domain name to the EC2 load balancer.

Continue reading “Configuring Elastic Load Balancer on Amazon EC2”

Cloning your Instances on Amazon EC2

Multiple front-end web server setups are almost always in use these days. Instead of just one server serving web traffic, you create two or more servers which will share the load evenly to serve requests from users. These servers usually connect to a backend database server. On this tutorial, we’ll walk through the steps on adding another web-front end server by cloning you current web server node.

Continue reading “Cloning your Instances on Amazon EC2”

Adding new disk on Amazon EC2 instance Centos/RHEL 6

Amazon VPS instances, by default only have a single disk for the whole filesystem of the server. Unless you chose to add an additional disk when you provision the server, adding disk space to your VPS can be tricky. Here’s a run down on how to add more storage to your server on amazon by mounting a new drive.

In this tutorial, I’ve mounted the new drive to /var/lib/mysql since I need to increase the disk space used by the database. This tutorial is still applicable even if you want to increase a different folder. The process will be the same.

Continue reading “Adding new disk on Amazon EC2 instance Centos/RHEL 6”

Unison – file/folder sync for Centos/RHEL 6

Unison is a file-synchronization tool similar to rsync. The main difference is that unison tracks changes on both directions so you don’t to have two separate rsync to pull and push data on both folders. This means files changed on server1 will be replicated to server2 and vice versa. It’s also easier to setup since no scripting necessary.

Continue reading “Unison – file/folder sync for Centos/RHEL 6”

Install Gitblit Go on CentOS/RHEL 6/7

If you are a programmer or work with programmers, managing code repositories is one the task you’ll likely to encounter. Git has become widely popular for storing/managing code repositories.
Gitblit GO is an open-source, pure Java stack for managing, viewing, and serving Git repositories. It’s designed primarily as a tool for workgroups who want to host centralized repositories. Gitblit GO is an integrated, single-stack solution based on Jetty.
In this fast tutorial, you’ll be able to install GitBlit Go and create you own git repositories.
Continue reading “Install Gitblit Go on CentOS/RHEL 6/7”

Setup Samba file sharing for CentOS 6

The SAMBA protocol allow Linux hosts to create/mount windows compatible network shared folders. Samba shares are preferred when the LAN comprises of both Widnows and Linux computers. In this tutorial, we’ll create a samba shared folder with username/password authentication. The shared folder will be accessible to all Linux and Windows computer on the local network.
Continue reading “Setup Samba file sharing for CentOS 6”

Linux iptables Configuration Tutorial

Iptables is an extremely flexible command-line firewall utility built for Linux operating systems. It uses policy chains to allow or block traffic. When a connection tries to establish itself on your system, iptables looks for a rule in its list to match it to. If it doesn’t find one, it resorts to the default action. Securing any server will surely require a firewall configuration and iptables should be on every system admins toolbox.
Continue reading “Linux iptables Configuration Tutorial”