UDP Load Balancing using PEN

First setup PEN load balancer using this document.

After that, keep digging below 🙂

And that’s it, so now if we run pen we see it now has UDP support.

root@penudp:~/pen-0.18.0# pen
usage:
pen [-C addr:port] [-X] [-b sec] [-S N] [-c N] [-e host[:port]]
[-t sec] [-x N] [-w dir] [-HPWadfhrs]
[-o option]
[-E certfile] [-K keyfile]
[-G cacertfile] [-A cacertdir]
[-Z] [-R] [-L protocol]
[host:]port h1[:p1[:maxc1[:hard1[:weight1[:prio1]]]]] [h2[:p2[:maxc2[:hard2[:weight2[:prio2]]]]]] ...
-B host:port abuse server for naughty clients
-C port control port
-T sec tracking time in seconds (0 = forever) [0]
-H add X-Forwarded-For header in http requests
-U use udp protocol support

Now to test this I have just brought up a couple of DNS servers running bind.

Read more

Share

Linux Remove All Partitions or Data And Create Empty Disk

Use the following dd command to remove data from /dev/hdX:

dd if=/dev/zero of=/dev/hdX bs=512 count=1

OR for sata disk, use the following syntax:

dd if=/dev/zero of=/dev/sdX bs=512 count=1

In this example, empty sata disk /dev/sdb, enter (you must be login as the root user):

fdisk /dev/sdb
dd if=/dev/zero of=/dev/sdb bs=512 count=1
fdisk -l /dev/sdb
Share

The safest way to clean up /boot partition in Debian or Ubuntu

First check your kernel version, so you won’t delete the in-use kernel image, running:

uname -r

Now run this command for a list of installed kernels:

dpkg --list 'linux-image*'

and delete the kernels you don’t want/need anymore by running this:

sudo apt-get remove linux-image-VERSION

Replace VERSION with the version of the kernel you want to remove.

Read more

Share

LEMP on Debian 7

Installing MySQL 5

In order to install MySQL, we run

apt-get install mysql-server mysql-client

You will be asked to provide a password for the MySQL root user – this password is valid for the user root@localhost as well as root@server1.example.com, so we don’t have to specify a MySQL root password manually later on:

New password for the MySQL “root” user: <– yourrootsqlpassword
Repeat password for the MySQL “root” user: <– yourrootsqlpassword

PHP-FPM & PHP modules installation

Use the below command to install PHP-FPM & PHP modules. PHP initially called Personal Home Page, now it is called asHypertext Preprocessor. PHP is a opensource software which is designed for web development purpose. It is used for server-side scripting language as well as general-purpose programming language.

$ sudo apt-get install php5 php5-fpm php5-mysql php5-cli php5-curl php5-gd php5-mcrypt

Read more

Share

Identify WWN in linux

Here are some useful commands for the most popular Linux/Unix operating systems to find your HBA WWN. There are several methods to identify HBA WWN for the fiber storage units in your server network.

Method 1: (The hard way)

Verified on Suse Linux Enterprise Server and CentOS/Redhat

The info is in

/sys/class/scsi_host/hostN/device/fc_host/hostN/port_name

Where “N” is the number of device for your fiber HBAs.

Unfortunately, you may have a large number of listings depending on the different cards (besides fiber HBA) that you have on your system. In my example, I have six listings:

Read more

Share

Install Varnish Cache On Debian 7

Normally Varnish Cache is available on Debian default repositories. But i suggest you to use Varnish Cache repositories to get latest version of Varnish Cache.

Run the following commands as root user to install Varnish Cache.

# curl http://repo.varnish-cache.org/debian/GPG-key.txt | apt-key add -
# echo "deb http://repo.varnish-cache.org/debian/ wheezy varnish-3.0" >> /etc/apt/sources.list
# apt-get update 
# apt-get install varnish

Configure Varnish

Open up the file ‘/etc/default/varnish’ in any editor.

Read more

Share

OpenDKIM Postfix SMTP Relay Server on Debian -7

Install OpenDKIM

Before starting the installation, a system update is recommended:

sudo apt-get update
sudo apt-get dist-upgrade

Install OpenDKIM and it’s dependencies:

sudo apt-get install opendkim opendkim-tools

Additional packages will be listed as dependencies, type yes and press Enter to continue.

Configure OpenDKIM

A couple of files must be created and edited in order to configure OpenDKIM.

Nano will be used as an editor because it’s installed by default on DigitalOcean droplets and it’s simple to operate:

navigate with the arrow keys
exit without saving changes: press CTRL + X and then N
exit and save changes: press CTRL + X and then Y, and finally press Enter
Important: replace every instance of example.com with your own domain in all commands and configuration files. Don’t forget to save your files after editing.

Let’s start with the main configuration file:

Read more

Share

Reset a MySQL root password for Debian

Use the following steps to reset a MySQL root password by using the command line interface.

Stop the MySQL service
(Ubuntu and Debian) Run the following command:

sudo /etc/init.d/mysql stop

(CentOS, Fedora, and Red Hat Enterprise Linux) Run the following command:

sudo /etc/init.d/mysqld stop

Start MySQL without a password
Run the following command. The ampersand (&) at the end of the command is required.

Read more

Share

Install ioncube on Linux server

  1. Begin by downloading the latest loaders to your computer from http://www.ioncube.com/loaders.php
  2. Extract the contents of the archived file on your local PC to a folder of your choice.
  3. Upload the folder IONCUBE via FTP to your domain webspace
  4. Now establish an SSH connection with server using a suitable client (e.g. Putty for PC’s or Terminal on Mac). This is usually done using the command: SSH rootusername@yourserver.com (you will then be asked for your password).
  5. You will need to browse to the public folder where you uploaded the IONCUBE directory (search internet for change and view directory commands in Unix).
  6. Move the ioncube folder to a permanent location by entering: mv ioncube /usr/local
  7. Next, you need to locate the php.ini file, to do this enter: locate php.ini – You should find it is in /usr/local/lib/php.ini. Now that you know the location of php.ini you need to edit it. pico /usr/local/lib/php.ini
  8. Now find where other zend extentions are in the file: ctrl + w: zend_extension
  9. Paste in your new line for ioncube loader: zend_extension = /usr/local/ioncube/ioncube_loader_lin_x.so (Replace x with your version of PHP eg. 4.4)
  10. Save the changes: ctrl + X then Y and enter
  11. Restart the web server to take effect: /etc/init.d/httpd restart

That’s it! Ioncube should now be installed & working on your server. To verify the installation was successful, check the PHP Info output for your server and you should see a new section which reads:

Additional Modules
Module Name ionCube Loader
Share