How To Install Fping on CentOS 6

Install Fping on CentOS 6

Fping is a program like ping which uses the Internet Control Message Protocol ( ICMP ) echo request to determine if a target host is responding. fping differs from ping in that you can specify any number of targets on the command line, or specify a file containing the lists of targets to ping.

This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple. I will show you through the step by step installation Fping on CentOS 6.

In this tutorial we will show you how to install and configuration of Fping on your CentOS 6 server.

Install Fping on CentOS 6

Step 1. First, you need to enable repository on your system.

## RHEL/CentOS 6 64-Bit ##
# wget http://pkgs.repoforge.org/fping/fping-3.9-1.el6.rf.x86_64.rpm
# rpm -ivh fping-3.9-1.el6.rf.x86_64.rpm

## RHEL/CentOS 6 32-Bit ##
# wget http://pkgs.repoforge.org/fping/fping-3.9-1.el6.rf.i686.rpm
# rpm -ivh fping-3.9-1.el6.rf.i686.rpm

Step 2. Install Fping.

 yum install fping

Installing Fping from source

Step 1. First, download fping source package (latest version is 3.10) and install.

wget http://fping.org/dist/fping-3.10.tar.gz
tar -xvf fping-3.10.tar.gz
cd fping-3.10
./configure
make
make install

Example usage fping program:

#fping 8.8.8.8 8.8.4.4 74.125.200.113

8.8.4.4 is alive
8.8.8.8 is alive
74.125.200.113 is alive

Congratulation’s! You have successfully installed PunBB. Thanks for using this tutorial for installing Fping in CentOS 6 system. Those who wants to get more information with options about Fping command please visit Fping official website.

How To Install Transmission on CentOS 6

Install Transmission on CentOS 6

Transmission BitTorrent Client features a simple interface on top of a cross-platform back-end. Transmission is licensed as a free software under the terms of the GNU General Public License (GPL), with parts under the MIT License. Transmission, like any other BitTorrent client allows users to download files from the Internet and upload their own files or torrents. By grabbing items and adding them to the interface, users can create queues of files to be downloaded and uploaded.

This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple. I will show you through the step by step installation Transmission on CentOS 6.

In this tutorial we will show you how to install and configuration of Transmission on your CentOS 6 server.

Install Transmission on CentOS 6

Step 1. First, you need to enable EPEL repository on your system.

## RHEL/CentOS 6 64-Bit ##
# wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -ivh epel-release-6-8.noarch.rpm

## RHEL/CentOS 6 32-Bit ##
# wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# rpm -ivh epel-release-6-8.noarch.rpm

Step 2. Install Transmission.

yum -y upgrade
yum -y install transmission transmission-daemon

Step 3. Configure Transmission.

Edit the settings.json file.

#find / -name settings.json
#nano /var/lib/transmission/.config/transmission/settings.json

"rpc-authentication-required": true,
"rpc-enabled": true,
"rpc-password": "mypassword",
"rpc-username": "mysuperlogin",
"rpc-whitelist-enabled": false,

Step 4. Start Transmission

 service transmission start

Installing Transmission from source

Step 1. Install dependencies and some tools we will use.

 yum -y install openssl-devel curl-devel intltool gettext wget nano

Step 2. Install libevent 2.0 dependency.

cd /usr/src
wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
tar zxvf libevent-2.0.21-stable.tar.gz
cd libevent-2.0.21-stable
./configure --prefix=/opt/libevent
make
make install

Step 3. Get and unpack Transmission.

wget https://transmission.cachefly.net/transmission-2.84.tar.xz
tar xvf transmission-2.84.tar.xz
cd transmission-2.84
export PKG_CONFIG_PATH=/opt/libevent/lib/pkgconfig
./configure --prefix=/opt/transmission
make
make install

Step 4. Now we run it once to create the settings.json in ~ (home directory)

 transmission-daemon

Step 5. Kill the appending -HUP to force dump the settings.

 killall -HUP transmission-daemon

Step 6. OK now let’s edit the settings (to your liking) and don’t forget to save.

#cd ~
#nano .config/transmission-daemon/settings.json

"rpc-authentication-required": true,
"rpc-enabled": true,
"rpc-password": "mypassword",
"rpc-username": "mysuperlogin",
"rpc-whitelist-enabled": false,

Step 7. Finally re-run transmission-daemon. It only needs to be run once and then you can access the web interface on the port you setup.

 transmission-daemon

Step 8. Accessing Transmission.

Transmission will be available on HTTP port 9091 by default. Open your favorite browser and navigate to http://yourdomain.com:9091 or http://server-ip:9091. You should be greeted with the Transmission WebUI. After logging in, you will notice that the value for the rpc-password inside the settings.json file will be hashed. If you are using a firewall, please open port 80 to enable access to the control panel.

You have successfully installed Transmission! Now, run the following command to view Transmission’s help guide:

 transmissioncli -h

Congratulation’s! You have successfully installed Transmission. Thanks for using this tutorial for installing Transmission BitTorrent Client on CentOS 6 system. For additional help or useful information, we recommend you to check the official Transmission web site.

You Might Also Like: How To Install Transmission on Ubuntu 14.04

How To Install and Enable EPEL Repo on CentOS

Install and Enable EPEL Repo on CentOS

EPEL(Extra Packages for Enterprise Linux) is a repo developed by Fedora project to ensure that there is a quality 3rd party packages available for enterprise users such as people who are using RHEL, CentOS, Oracle Linux and Scientific Linux. EPEL is a community effort to create a repository of high-quality add-on free software packages for RHEL-based distributions. Once you set up EPEL repository, you can use yum command to install any of close to 7,000 EPEL packages.

This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple. I will show you through the step by step installation and enable EPEL repository on CentOS 5, CentOS 6 and CentOS 7.

Install and Enable EPEL Repo on CentOS 5, CentOS 6 and CentOS 7

First, you need to enable EPEL repository on your system. You don’t need to configure this repository manually in your yum. Instead, download the following package and install it, which will enable the EPEL repository on your system.

  • CentOS 7 64 Bit
## RHEL/CentOS 7 64-Bit ##
# wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-8.noarch.rpm
# rpm -ivh epel-release-7-8.noarch.rpm
  • CentOS 6 64 Bit
## RHEL/CentOS 6 64-Bit ##
# wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -ivh epel-release-6-8.noarch.rpm
  • CentOS 6 32 Bit
## RHEL/CentOS 6 32-Bit ##
# wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# rpm -ivh epel-release-6-8.noarch.rpm
  • CentOS 5 64 Bit
## RHEL/CentOS 5 64-Bit ##
# wget http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
# rpm -ivh epel-release-5-4.noarch.rpm
  • CentOS 5 32 Bit
## RHEL/CentOS 5 32-Bit ##
# wget http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
# rpm -ivh epel-release-5-4.noarch.rpm

To verify that EPEL repository has been set up successfully, run the following command to list all available repositories on your system:

 # <code>yum repolist

You Might Also Like: How To Install Nginx Web Server On CentOS

How To Install Nginx With GeoIP Module

Install Nginx With GeoIP Module

Nginx GeoIP module for country and city geo targeting can be installed in a few easy steps. It brings you a geo targeting layer allowing you to show some parts of your websites, or even split traffic according to the geographical location of the end users. By default, when you install modules from yum, nginx will not come with GeoIP module (This is module: HttpGeoipModule), so we will install from source and the active the module. This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple.

In this tutorial we will show you how to install and configuration of Nginx With GeoIP Module on your Linux server.

Install Nginx With GeoIP Module

Step 1. First install require package for compiling:

 yum install gcc-c++ pre pcre-devel zlib zlib-devel -y

Step 2. Download the latest stable version of Nginx from here and build it with GeoIP module support.

## cd /opt/nginx/
## wget http://nginx.org/download/nginx-1.6.2.tar.gz
## tar -zxf nginx-1.6.2.tar.gz
## cd nginx-1.6.2/
## ./configure
--prefix=/etc/nginx \
--sbin-path=/etc/nginx/sbin/nginx \
--conf-path=/etc/nginx/conf/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--pid-path=/var/run/nginx.pid \
--lock-path=/var/run/ninx.lock \
--user=nobody \
--with-http_geoip_module \
--with-http_gzip_static_module \
--with-http_secure_link_module \
--without-mail_pop3_module \
--without-mail_imap_module \
--without-mail_smtp_module \
--without-http_ssi_module

## make
## make install


Step 3. Create an init script for Nginx.

get -O /etc/init.d/nginx https://raw.githubusercontent.com/Fleshgrinder/nginx-sysvinit-script/master/nginx
chmod 0755 /etc/init.d/nginx
chown root:root /etc/init.d/nginx

Step 4. Finally, start Nginx.

 service nginx start

Step 5. Install GeoIP library via yum

# For CentOS 6 – 64-bit

rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm 

# yum install geoip geoip-devel -y

After successful installation, the library will be stored in: /usr/share/GeoIP/GeoIP.dat
For the latest updates can be downloaded at: http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz

Configure Nginx

  • Configure on main file:
#nano /etc/nginx/conf/nginx.conf

http {
[...]
geoip_country /usr/share/GeoIP/GeoIP.dat;
map $geoip_country_code $allowed_country {
default yes;
CN no;
}
[...]
}
  • Configure nginx virtualhost:
#nano /etc/nginx/conf.d/yourdomain.conf

server {
[...]
if ($allowed_country = no) {
return 444;
# # This means the server will stop processing, returns error 444 (The connection was reset),
# # And ignore always sending the response header.
# # Replace 444 by 403 if you want
}
[...]
}

The above configuration will accept all IP and banned only from China IP (CN). About Code of the country in GeoIP database you can refer here: http://dev.maxmind.com/geoip/legacy/codes/iso3166/

Congratulation’s! You have successfully installed Nginx With GeoIP Module. Thanks for using this tutorial for installing Nginx With GeoIP Module on Linux system. For additional help or useful information, we recommend you to check the official Nginx web site.

You Might Also Like: How To Install Nginx Web Server On CentOS

How To Install and Configure HAproxy on CentOS 6

Install and Configure HAproxy on CentOS 6

HAProxy is a free and open-source Linux application used for load balancing network traffic. This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple. I will show you through the step by step installation of HAproxy on CentOS 6.x from source.

In this tutorial we will show you how to install and configuration of HAProxy on your CentOS 6 server.

Install and Configure HAproxy on CentOS 6

Step 1. First add yum repository your system.

HAProxy isn’t available in the default repositories for CentOS. In order for us to be able to install it, we need to either compile it from source (preferred) or add the EPEL repository to our server and install it using Yum.

#CentOS 6 – 32-bit
 rpm -Uvh http://mirror.overthewire.com.au/pub/epel/6/i386/epel-release-6-8.noarch.rpm

#CentOS 6 – 64-bit
 rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

Step 2. Install HAProxy using Yum.

 yum install haproxy

Step 3. Configuring HAProxy.

We have to modify the configuraion file of haproxy i.e. /etc/haproxy/haproxy.cfg as per our requirement. (Change this configuration as your network requirements). For more configuration details check this url.

#nano /etc/haproxy/haproxy.cfg global

log 127.0.0.1 local0
log 127.0.0.1 local1 debug
maxconn 45000 # Total Max Connections. This is dependent on ulimit
user haproxy
group haproxy
daemon

defaults
timeout server 86400000
timeout connect 86400000
timeout client 86400000
timeout queue 1000s

# Configuration for HTTP site
listen http_wpcademy 192.168.2.102:80
mode http
balance roundrobin # Load Balancing algorithm
option httpchk
option forwardfor
server server1 192.168.2.100:80 weight 1 maxconn 512 check
server server2 192.168.2.101:80 weight 1 maxconn 512 check

# Configuration for HTTPS site listen  
https_wpcademy 192.168.2.102:443
mode tcp
balance source# Load Balancing algorithm
reqadd X-Forwarded-Proto:\ http
server server1 192.168.2.100:443 weight 1 maxconn 512 check
server server2 192.168.2.101:443 weight 1 maxconn 512 check

listen stats 192.168.2.102:31337
mode http
option httpclose
balance roundrobin
stats uri /
stats realm Haproxy\ Statistics
stats refresh 5s
stats auth admin:passwd123

Step 4. Once you have configured HAProxy, its time to start the service.

service haproxy start
chkconfig haproxy on

Step 5. Now you will able to browse your applicaiton using the IP of the haproxy server. For haproxy Status dashboard you have to browse the URL: http://192.168.2.102:31337. It will ask you for the username and password. Use the username and password you defined on the configuraion file as “stats auth”.

Congratulation’s! You have successfully installed HAProxy. Thanks for using this tutorial for installing HAProxy on CentOS 6 system. For additional help or useful information, we recommend you to check the official HAProxy web site.

You Might Also Like: How To Install Nginx Web Server On CentOS

How To Install ClamAV on CentOS 6

Install ClamAV on CentOS 6

ClamAV is an open source (GPL) antivirus engine designed for detecting viruses, malware and other malicious threats on Linux.  It’s easy to use and best for Linux based Web & Mail server. In this article, I will show you through the step by step installation of ClamAV on CentOS 6.x from source.

In this tutorial we will show you how to install and configuration of ClamAV on your CentOS 6 server.

Install ClamAV on CentOS 6

Step 1. First add yum repository your system.

The EPEL repo is enabled by simply installing an RPM. Please use the command below to install the EPEL repository on your CentOS server.

#CentOS 6 – 32-bit
rpm -Uvh http://mirror.overthewire.com.au/pub/epel/6/i386/epel-release-6-8.noarch.rpm

#CentOS 6 – 64-bit
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm


Step 2.
Install required ClamAV packages.

 yum install clamav clamd

Step 3. Start the clamd service on system boot.

chkconfig clamd on
service clamd start

Update ClamAV’s signatures:

 freshclam

Step 4. Configuring daily scan.

In this example, I will configure a cronjob to scan the /home/ directory every day:

 nano /etc/cron.daily/clamav_scan

Add following piece of code into clamav_scan file.

#!/bin/bash
SCAN_DIR="/home"
LOG_FILE="/var/log/clamav/manual_clamscan.log"
/usr/bin/clamscan -i -r $SCAN_DIR >> $LOG_FILE

Give our cron script executable permissions:

 chmod +x /etc/cron.daily/clamav_scan

Congratulation’s! You have successfully installed ClamAV. Thanks for using this tutorial for installing ClamAV in CentOS 6 system. For additional help or useful information, we recommend you to check the official ClamAV web site.

You Might Also Like: How To Install Rar/Unrar on CentOS

How To Install PPTP VPN on CentOS 6

Install PPTP VPN on CentOS 6

The Point-to-Point Tunneling Protocol (PPTP) is a method for implementing virtual private networks. PPTP uses a control channel over TCP and a GRE tunnel operating to encapsulate PPP packets. The PPTP specification does not describe encryption or authentication features and relies on the Point-to-Point Protocol being tunneled to implement security functionality. We use PPTP because it is supported natively on almost all devices, Windows, Linux, Android, iOS and Mac OS.

This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple. Here is the steps to install PPTP VPN on CentOS 6.

In this tutorial we will show you how to install and configuration of PPTP VPN on your CentOS 6 server.

Install PPTP VPN on CentOS 6

Step 1. First install pptpd

yum install ppp iptables nano
cd /usr/local/src

#For 64bit OS
wget http://poptop.sourceforge.net/yum/stable/packages/pptpd-1.4.0-1.el6.x86_64.rpm
rpm -Uhvpptpd-1.4.0-1.el6.x86_64.rpm

#For 32bit os
wget http://poptop.sourceforge.net/yum/stable/packages/pptpd-1.4.0-1.el6.i686.rpm
rmp -Uhv pptpd-1.4.0-1.el6.i686.rpm

Step 2. Setup pptpd

Edit IP setttings in /etc/pptpd.conf:

#nano /etc/pptpd.conf

localip 192.168.0.1 # your VPS/Dedicated Server IP address 
remoteip 192.168.0.101-200

And the following settings to /etc/ppp/options.pptpd:

ms-dns 8.8.8.8
ms-dns 4.4.4.4

Step 3. Create user to access the VPN server

Add user account in/etc/ppp/chap-secrets (assign username and password):

#nano /etc/ppp/chap-secrets

vpn pptpd vpnpassword *

Step 4. Enable network forwarding in /etc/sysctl.conf

#nano /etc/sysctl.conf

net.ipv4.ip_forward = 1

#To make the changes to sysctl.conf take effect, use the following command.

sysctl -p

Step 5. Setup iptables

You need to add the following iptables rules in order to open the correct ports and properly forward the data packets:

iptables -A INPUT -i eth0 -p tcp --dport 1723 -j ACCEPT
iptables -A INPUT -i eth0 -p gre -j ACCEPT
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

Step 6. Start PPTP VPN server

service pptpd restart
chkconfig pptpd on

Congratulation’s! You have successfully installed PPTP VPN. Thanks for using this tutorial for installing PPTP VPN on CentOS 6 system. For additional help or useful information, we recommend you to check the official PPTP VPN web site.