Senin, 02 Februari 2015

How To Install Linux-dash Web Based Monitoring System In RHEL/CentOS

Linux-dash is a web-based lightweight monitoring dashboard for Linux machines. This application will display real-time, various system properties, such as CPU load, RAM usage, disk usage, Internet speed, network connections, RX/TX bandwidth, logged-in users, running processes etc. It will not store long term statistics, Thus it doesn’t have a backend database.

In this article i will show you how to install and setup Linux dash, Here my web server is Nginx.

Installation

First of all we should enable, EPEL repository.

Next, we need to install nginx with the following command.

yum install nginx

Install php-fpm component

yum install git php-common php-fpm

Now, we have to configure nginx for Linux-dash. So create /etc/nginx/conf.d/linuxdash.conf as follows.

nano /etc/nginx/conf.d/linuxdash.conf

server {
 server_name $domain_name;
 listen 8080;
 root /var/www;
 index index.html index.php;
 access_log /var/log/nginx/access.log;
 error_log /var/log/nginx/error.log;

 location ~* \.(?:xml|ogg|mp3|mp4|ogv|svg|svgz|eot|otf|woff|ttf|css|js|jpg|jpeg|gif|png|ico)$ {
 try_files $uri =404;
 expires max;
 access_log off;
 add_header Pragma public;
 add_header Cache-Control "public, must-revalidate, proxy-revalidate";
 }

 location /linux-dash {
 index index.html index.php;
 }

 # PHP-FPM via sockets
 location ~ \.php(/|$) {
 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
 fastcgi_split_path_info ^(.+?\.php)(/.*)$;
 fastcgi_pass unix:/var/run/php-fpm.sock;
 if (!-f $document_root$fastcgi_script_name) {
 return 404;
 }
 try_files $uri $uri/ /index.php?$args;
 include fastcgi_params;
 }
}

Next job is to configure php-fpm. Open  /etc/php-fpm.d/www.conf in your Favorite editor.

nano /etc/php-fpm.d/www.conf

Make sure to set “listen”, “user” and “group” fields as below. You can leave the rest of the configuration unchanged.

. . .
listen = /var/run/php-fpm.sock
user = nginx
group = nginx
. . .

Now, We are going to Download and install linux-dash under /var/www

git clone https://github.com/afaqurk/linux-dash.git
cp -r linux-dash/ /var/www/
chown -R nginx:nginx /var/www

Next, restart Nginx web server as well as php-fpm

/etc/init.d/nginx restart
/etc/init.d/php-fpm restart

Set nginx and php-fpm to auto-start upon boot

chkconfig nginx on
chkconfig php-fpm on

In this example, we have configured linux-dash to use TCP port 8080. So make sure that the firewall is not blocking TCP port 8080.

Monitor a Linux server with linux-dash

You can access Linux-dash by pointing you browser to http://ip.add.re.ss:8080/linux-dash/

The web dashboard consists of several widgets, each of which displays particular system properties. You can customize the look of the web dashboard by rearranging and/or closing some of the widgets.


Minggu, 01 Februari 2015

How To Install Openfire On Linux CentOS 7

Openfire is a real time collaboration (RTC) server licensed under the Open Source Apache License. It is also known as Jabber. It uses the only widely adopted open protocol for instant messaging, XMPP. The full name of XMPP is Extensible Messaging and Presence Protocol. It is a real-time communication protocol (which includes chat) based on XML. Installation and the management of Openfire is pretty simple.

How to boot ISO image ubuntu from your hard drive

This guide will show how to boot an ISO image file that stored in your hard drive. Booting an ISO on your hard drive is useful for testing new versions of Linux ISO file without using up a CD/DVD or USB Stick. On this case I will boot Ubuntu 13.04 iso directly from hard disk via the Grub2 boot menu. Create a directory named iso in your root folder using this command:
# sudo mkdir /isoimage

Now copy ubuntu 13.04 iso file (ubuntu-13.04-desktop-i386.iso) to directory /isoimage :
# sudo cp -v ~/ISOFILE/ubuntu-13.04-desktop-i386.iso /isoimage

Edit /boot/grub/grub.cfg file with following command:
# sudo nano /etc/grub.d/40_custom

add these lines to Custom GRUB Configuration file (/etc/grub.d/40_custom):
menuentry "Ubuntu 13.04 Live" {
 set root=(hd0,1)
 loopback loop /isoimage/ubuntu-13.04-desktop-i386.iso
 linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/isoimage/ubuntu-13.04-desktop-i386.iso noprompt noeject
 initrd (loop)/casper/initrd.lz
}


Save your file and exit with press button CTRL + X.
After this enter command:
# sudo update-grub

Then reboot ubuntu and hold down the Shift key to bring up the Grub boot menu. Select Ubuntu 13.04 Live to boot ubuntu 13.04 iso image from hard drive

Jumat, 30 Januari 2015

How-to-Install Oracle VirtualBox 4.3.20 on Ubuntu 14.04/14.10


Oracle VM VirtualBox is a software virtualization package for AMD64/Intel64-based and x86 computers from Oracle Corporation.
VirtualBox runs on Linux,Windows,Solaris and Macintosh hosts and supports a large number of guest operating systems including but not limited to DOS/Windows 3.x, Linux (2.4, 2.6 and 3.x),Windows (NT 4.0, 2000, XP, Server 2003, Vista, Windows 7, Windows 8),OpenSolaris and Solaris,OpenBSD and OS/2.
In this article show you how to install Oracle VirtualBox on your Ubuntu 14.04/14.10.

Add VirtualBox repository

First,edit /etc/apt/sources.list which typing The following command:
tri@linux:~$sudo nano /etc/apt/source.list

and add one of following line ccording to your distribution to your system:
For Ubuntu 14.10 ("Utopic Unicorn")
deb http://download.virtualbox.org/virtualbox/debian utopic contrib

For Ubuntu 14.04 ("Trusty Tahr")
deb http://download.virtualbox.org/virtualbox/debian trusty contrib

Add Oracle public key

After adding required apt repository in your system, download and import the Oracle public key for apt-secure using following commands.
tri@linux:~$wget http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc
tri@linux:~$sudo apt-key add oracle_vbox.asc

Install VirtualBox

Now, install VirtualBox:
tri@linux:~$sudo apt-get update
tri@linux:~$sudo apt-get install virtualbox-4.3 -y

how to Install Bash Autocomplete feature on CentOS/Fedora Linux

In this article I will show how to easy install Bash Autocomplete feature on Fedora Linux or CentOS/RHEL.
You need to use YUM command to install bash-completion package on your Fedora Linux or CentOS/RHEL.
Type following command to install bash-completion package:
# yum install bash-completion -y

Example output:
# yum install bash-completion -y
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: mirrors.viralvps.com
 * extras: ftp.nluug.nl
 * rpmforge: ftp.nluug.nl
 * updates: mirror.widexs.nl
Resolving Dependencies
--> Running transaction check
---> Package bash-completion.noarch 0:20060301-1.el6.rf will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=======================================================================================
 Package                Arch          Version                    Repository       Size
=======================================================================================
Installing:
 bash-completion        noarch        20060301-1.el6.rf          rpmforge        125 k

Transaction Summary
=======================================================================================
Install       1 Package(s)

Total download size: 125 k
Installed size: 470 k
Downloading Packages:
bash-completion-20060301-1.el6.rf.noarch.rpm                    | 125 kB     00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : bash-completion-20060301-1.el6.rf.noarch                            1/1
  Verifying  : bash-completion-20060301-1.el6.rf.noarch                            1/1

Installed:
  bash-completion.noarch 0:20060301-1.el6.rf

Complete!

To use feature auto competition, your need to press TAB key (Example: yum install ht [tab][tab]):


Kamis, 29 Januari 2015

How to easy Install TeamViewer 10 on Debian/Ubuntu based Linux systems


TeamViewer is a proprietary computer package software for remote control,web conferencing,file transfer between computers, desktop sharing and  online meetings.
Versions are available for the Microsoft Linux,Mac OS X,Windows,BlackBerry,Windows Phone 8, Windows RT,Android and iOS operating systems.It is also possible to access a machine running TeamViewer with a web browser.While the main focus of the application is remote control of computers, presentation and collaboration features are included.In this article we will teach you how to install TeamViewer 10 on Debian/Ubuntu based Linux distributions.

What's new in TeamViewer 10

Optimization of performance: CPU Usage, HD quality voice transmission, faster login.
Centralized arrangements may: All settings may be through a centralized management console.
Teachers whitelist: To allow only authorized users reduce administrative overhead.
History conversations and group chats
Improved quality images and video with one-click video calling
Now you can put your display picture could easily be identified in the list of friends.
Real-time record of the session: To record something important when the session is in progress.
Idle session time limit: You do not have to worry about idle session because they will
automatic closed after the deadline.
File sharing is easy: Integrated with Google Drive and Dropbox.
Chalkboard: To create a more efficient knowledge transfer.

Install TeamViewer 10

Install TeamViewer 10 on Debian/Ubuntu systems 32 Bit:
tri@linux:~$ sudo apt-get install gdebi -y
tri@linux:~$wgetdownload.teamviewer.com/download/version_10x/teamviewer_linux.deb
tri@linux:~$ sudo gdebi teamviewer_linux.deb

Install TeamViewer 10 on Debian/Ubuntu systems 64 Bit:
tri@linux:~$ sudo dpkg --add-architecture i386
tri@linux:~$ sudo apt-get update
tri@linux:~$ sudo apt-get install gdebi -y
tri@linux:~$wgetdownload.teamviewer.com/download/version_10x/teamviewer_linux.deb
tri@linux:~$ sudo gdebi teamviewer_linux.deb

How to easy Installation Control Panel (CP) Ajenti On server Ubuntu

Ajenti is a server administration panel for FreeBSD distributions and Linux . It is similar to cPanel, ISPConfig and others like them, but more light in features it is a Free Software application whose development is spear-headed by Eugene Pankov.
Besides being a server administration panelAjenti may also be used by developers as a rapid-development platform to create Web frontends, and by hardware vendors to create Web interfaces.
Install Ajenti

Add repository key:
tri@linux:~$sudo wget http://repo.ajenti.org/debian/key -O- | apt-key add -

Add repository to /etc/apt/sources.list
tri@linux:~$sudo echo "deb http://repo.ajenti.org/ng/debian main main ubuntu">>/etc/apt/sources.list

Install the package:
tri@linux:~$sudo apt-get update
tri@linux:~$sudo apt-get install ajenti

Start the service:
tri@linux:~$sudo /etc/init.d/ajenti restart

Remote access to the server is via https://ip.ad.re.ss:8000. Username is root and the password is admin.

ajenti login screen
Ajenti configuration


nterface for adding a cron job




How to easy Installation ZPanel in Centos 6.4

In this article I will tell you about one interesting free control panel which is Zpanel and I will show you how to install it on a Dedicated/VPS server with Centos 6.4.

zPanel is a php-based free control panel ( free alternative to CPanel) for windows, mac, and linux servers. The program run on top of an Apache, MySQL, PHP stack on which platform is used.

Install zPanel

Log in to your server via SSH (use Putty or Terminal) as root.
First install pre-required packages:
tri@linux#yum install wget ld-linux.so.2 curl -y

Download zPanel installer:
64 bit installer
tri@linux#wget http://www.zvps.co.uk/downloads/centos/10-1-0/installer-10-1-0-centos-64.sh.x.tar.gz

32 bit installer
tri@linux#wget http://www.zvps.co.uk/downloads/centos/10-1-0/installer-10-1-0-centos-32.sh.x.tar.gz

Unzip installer:
64 Bit Installer
tri@linux#tar -xvzf installer-10-1-0-centos-64.sh.x.tar.gz

Or
32 Bit Installer
tri@linux#tar -xvzf installer-10-1-0-centos-32.sh.x.tar.gz

Change the script to be executable:
64 Bit Installer
tri@linux## chmod +x installer-10-1-0-centos-64.sh.x

Or
32 Bit Installer
tri@linux# chmod 777 installer-10-1-0-centos-32.sh.x

Run the ZPanelX installer:
64 Bit Installer
tri@linux# ./installer-10-1-0-centos-64.sh.x

Or
32 Bit Installer
tri@linux# ./installer-10-1-0-centos-32.sh.x

Follow the  images instructions below for installation
Zpanel installation


End zPanel installation
The zadmin, MySQL root & postfix passwords are all stored in /root/passwords.txt after installation.
Zpanel login screen
zPanelcp


How to Easy Install VestaCP on Debian/Ubuntu and Centos/RHEL Linux

"Vesta is an open source hosting control panel currently supports RHEL 5.x/6.x, CentOS 5.x/6.x and Ubuntu LTS 12.04, Ubuntu 13.04 and Ubuntu 13.10. It comes with all necessary software to run and manage your websites hosted on your VPS, including:
Web Server (Apache with Nginx as Reverse Proxy)"

  • DNS server
  • Database Server
  • Mail Server
  • FTP Server
  • Nginx out of the box
  • SSL certificates & SNI
  • Wildcard support
  • Configuration Templates
  • DKIM support
  • Fast Backups
  • System Monitoring
  • AntiSpam / Antivirus
  • WHMCS billing support
  • EPEL integration
  • Simple and Clean GUI
  • Powerfull CLI
  • Reliable Platform
  • Open Data Format

Install VestaCP on RHEL/CentOS and Debian/Ubuntu linux
First, login to your server via ssh as root and type following command:
# curl -O http://vestacp.com/pub/vst-install.sh
# chmod +x vst-install.sh
# ./vst-install.sh
Install VestaCP 
The installer asks to confirm disabling SELinux and start the install process. Type Y and hit Enter.
Type your valid email address where they will is VestaCP send your admin password.
Wait for the finish installer process.
VestaCP Complite Installation

Now open up your favorite browser and login to VestaCP web-based UI using your VPS IP at port 8083.
https://ip.add.re.ss:8083/

Login as admin and use given password:
VestaCP Login
You should now see the main UI of VestaCP hosting control panel.
Main UI of VestaCP




How to Install and Use Fping app on RHEL/Centos

"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. Instead of sending to one target until it times out or replies, fping will send out a ping packet and move on to the next target in a round-robin fashion. In the default mode, if a target replies, it is noted and removed from the list of targets to check; if a target does not respond within a certain time limit and/or retry limit it is designated as unreachable. fping also supports sending a specified number of pings to a target, or looping indefinitely (as in ping ). Unlike ping, fping is meant to be used in scripts, so its output is designed to be easy to parse."

How to install fping program

First, download fping source package (latest version is 3.10):
# wget http://fping.org/dist/fping-3.10.tar.gz

To install an application fping follows these steps:
# tar -xvf fping-3.10.tar.gz
# cd fping-3.10
# ./configure
# make
# make install

You can can compile fping with support for IPv6 addresses follow next steps:
# ./configure --prefix=/usr/local --enable-ipv4 --enable-ipv6
# make
# make install

Example usage fping program

Fping multiple ip address:
# fping 8.8.8.8 8.8.4.4 104.28.25.20
8.8.4.4 is alive
8.8.8.8 is alive
104.28.25.20 is alive

Fping range of ip address:
# fping -s -g 192.168.1.1 192.168.1.5
ICMP Network Unreachable from 83.231.213.65 for ICMP Echo sent to 192.168.1.1
ICMP Network Unreachable from 83.231.213.65 for ICMP Echo sent to 192.168.1.3
ICMP Network Unreachable from 83.231.213.65 for ICMP Echo sent to 192.168.1.5
ICMP Network Unreachable from 83.231.213.65 for ICMP Echo sent to 192.168.1.1
ICMP Network Unreachable from 83.231.213.65 for ICMP Echo sent to 192.168.1.3
ICMP Network Unreachable from 83.231.213.65 for ICMP Echo sent to 192.168.1.5
ICMP Network Unreachable from 83.231.213.65 for ICMP Echo sent to 192.168.1.1
ICMP Network Unreachable from 83.231.213.65 for ICMP Echo sent to 192.168.1.3
ICMP Network Unreachable from 83.231.213.65 for ICMP Echo sent to 192.168.1.5
ICMP Network Unreachable from 83.231.213.65 for ICMP Echo sent to 192.168.1.1
ICMP Network Unreachable from 83.231.213.65 for ICMP Echo sent to 192.168.1.3
ICMP Network Unreachable from 83.231.213.65 for ICMP Echo sent to 192.168.1.5
192.168.1.1 is unreachable
192.168.1.2 is unreachable
192.168.1.3 is unreachable
192.168.1.4 is unreachable
192.168.1.5 is unreachable

       5 targets
       0 alive
       5 unreachable
       0 unknown addresses

       5 timeouts (waiting for response)
      20 ICMP Echos sent
       0 ICMP Echo Replies received
      12 other ICMP received

 0.00 ms (min round trip time)
 0.00 ms (avg round trip time)
 0.00 ms (max round trip time)
        4.191 sec (elapsed real time)


Fping complite network
# fping -g -r 3 192.168.1.1/24

Show fping version
# fping -v
fping: Version 3.10
fping: comments to david@schweikert.ch

How to Patch Linux Ghost RHEL/CentOS and Ubuntu/Debian

About GHOST Vulnerabilities

The GHOST vulnerability is a serious weakness in the Linux glibc library. It allows attackers to remotely take complete control of the victim system without having any prior knowledge of system credentials.

How to Patch Ghost On CentOS/RHEL

There is a patch available for CentOS 5, CentOS 6, CloudLinux5 and CloudLinux 6 in the repos.. soon for Debian as well. Here is how to patch in CentOS (or other yum / rhel flavor)
First, let’s see if you’re patched already by typing:
# rpm -q --changelog glibc|grep CVE-2015-0235

If you’re patched already, you’ll see:
- Fix parsing of numeric hosts in gethostbyname_r (CVE-2015-0235, #1183532).

Example:


IF you do not see that, check to if the update is in your repos yet:
# yum clean all && yum update glibc

If it says “No Packages marked for Update” then try again later…
If it shows you an update is available, run the update, then reboot (because there are a lot of various services that use glibc and restarting is a lot easier than finding and restarting each one).
# shutdown -r now

How to Patch Ghost On Ubuntu/Debian
For currently supported versions of Ubuntu or Debian, update all of your packages to the latest version available via apt-get dist-upgrade:
$ sudo apt-get update && sudo apt-get dist-upgrade

Then respond to the confirmation prompt with y.
When the update is complete, reboot the server with this command:
$ sudo reboot

A reboot is necessary since the GNU C Library is used by many applications that must be restarted to use the updated library.

Rabu, 28 Januari 2015

How to Install Openvz on CentOs


CentOS is one of the most popular free and open source server operating systems. OpenVZ is a popular open source system for creating virtual private servers. Combine the two together, and you have a low-cost yet powerful VPS system. The following is a brief installation guide to get OpenVZ running on CentOS.

Add the OpenVZ repository to Yum:

#cd /etc/yum.repos.d
#wget http://download.openvz.org/openvz.repo
#rpm –import http://download.openvz.org/RPM-GPG-Key-OpenVZ

Edit openvz.repo and disable the [openvz-kernel-rhel5] repository (enabled=0) and enable the [openvz-kernel-rhel6] repository.

Install the OpenVZ kernel:

Search using:
#yum search vzkernel

Choose the kernel you want and install:
yum install vzkernel

(This should automatically update Grub to your new kernel. If not, you may need to manually edit your grub configuration).

Install OpenVZ user tools:

#yum install vzctl vzquota

Edit /etc/sysctl.conf and ensure you have these settings:
net.ipv4.ip_forward = 1
net.ipv4.conf.default.proxy_arp = 0
net.ipv4.conf.all.rp_filter = 1
kernel.sysrq = 1
net.ipv4.conf.default.send_redirects = 1
net.ipv4.conf.all.send_redirects = 0
net.ipv4.icmp_echo_ignore_broadcasts=1
net.ipv4.conf.default.forwarding=1

If your IP addresses for your virtual machines will be on a different subnet than your host machine, you need to make sure you have this in /etc/vz/vz.conf:

NEIGHBOUR_DEVS=all

Disable SELinux bye editing /etc/sysconfig/selinux:

# enforcing – SELinux security policy is enforced.
# permissive – SELinux prints warnings instead of enforcing.
# disabled – No SELinux policy is loaded.
SELINUX=disabled

Reboot

You should now have a working OpenVZ installation. You should then test it to verify that the kernel is running and that you are able to create containers.

How to install PPTP VPN server in Centos 6.4 Linux


In this article we show you how to install and properly configure a PPTP VPN server in RHEL/CentOS linux. With this VPN you’ll have access to transfering your data encrypted and using a ethernet interface that uses your Server IP address. This tunneling technology is compatible with several devices like desktop operating systems, mobile phones and tablets.
First need enable tun module (tunelling kernel module):
echo 'modprobe tun' >> /etc/rc.modules
chmod +x /etc/rc.modules

At next boot will be loaded tun module in kernel
Make sure you begin with a clean install by removing any previously installed packages:
yum remove -y pptpd ppp
iptables --flush POSTROUTING --table nat
iptables --flush FORWARD
rm -rf /etc/pptpd.conf
rm -rf /etc/ppp

Installation procedure
First, install the poptop package from sourceforge:
rpm -Uhv http://poptop.sourceforge.net/yum/stable/rhel6/pptp-release-current.noarch.rpm
yum -y install make libpcap iptables gcc-c++ logrotate tar cpio perl pam tcp_wrappers dkms kernel_ppp_mppe ppp pptpd

Now, we need to enable IP forwading, set internal IP addresses and point the DNS Servers that will be used by the pptp server:
mknod /dev/ppp c 108 0
echo 1 > /proc/sys/net/ipv4/ip_forward
echo "mknod /dev/ppp c 108 0" >> /etc/rc.local
echo "echo 1 > /proc/sys/net/ipv4/ip_forward" >> /etc/rc.local
echo "localip 172.16.36.1" >> /etc/pptpd.conf
echo "remoteip 172.16.36.2-254" >> /etc/pptpd.conf
echo "ms-dns 8.8.8.8" >> /etc/ppp/options.pptpd
echo "ms-dns 8.8.4.4" >> /etc/ppp/options.pptpd

Then, create your users credentials for the PPTP server. This credentials will be used to log in to the PPTP server on every client/device you connect from:
nano /etc/ppp/chap-secrets

Your chap-secrets file should look like this:
# Secrets for authentication using CHAP
# client server secret IP addresses
yourusername pptpd yourpassword *

Save and close the file.
Next, you need to add the following iptables rules in order to open the correct ports and properly forward the data packets:

# VPN rules (pptpd)
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
iptables -A FORWARD -p tcp -s 172.16.36.0/24 -j TCPMSS --syn --set-mss 1356

Save and restart your iptables firewall:
service iptables save
service iptables restart

Make sure you load your iptables after every reboot:
chkconfig iptables on
chkconfig pptpd on

And finally, restart iptables and pptpd services:
service iptables start
service pptpd start

Selasa, 27 Januari 2015

How to migrate OpenVZ to KVM/VMWare

To migrate your OpenVZ virtual server to a KVM/VMWARE just follow these steps:

  • First thing you do is to install a KVM machine with the same operating system.  Preferably  the same point revision too!
  • Now logon to your OpenVZ box and run

# yum install mingetty

  • This will install a load of dependencies –  they are all required and provide the core functions to enable your machine to boot successfully!
  • Edit the file /etc/inittab and add in the following:
# Run gettys in standard runlevels

1:2345:respawn:/sbin/mingetty tty1
2:2345:respawn:/sbin/mingetty tty2
3:2345:respawn:/sbin/mingetty tty3
4:2345:respawn:/sbin/mingetty tty4
5:2345:respawn:/sbin/mingetty tty5
6:2345:respawn:/sbin/mingetty tty6

This will enable the machine to actually get a logon prompt!

  • Now.. sync the OpenVZ box to the new box

rsync –exclude=/etc/fstab –exclude=/boot –exclude=/proc –exclude=/lib/modules/ –exclude=/etc/udev –exclude=/lib/udev –exclude=/sys -e ssh –delete –numeric-ids -avpogtStlHz / root@IPTOKVM:/

This will copy every thing from the old box to the new box, but will exclude the kernel files that you will need to boot the machine!  Trust me.. it works!
  •     Power down your OpenVZ Box
  •     Reboot and start your KVM box.

This process has worked for me pretty much every time when migrating Centos 5 and Centos 6.  I am pretty certain that the same basic idea will work with other distros.

Install mod_pagespeed in RHEL/CentOS/Fedora and Debian/Ubuntu linux


mod_pagespeed (Website speed optimizer) is an open-source Apache module that automatically optimizes web pages and resources on them. It does this by rewriting the resources using filters that implement web performance best practices. It has several filters that automatically optimize files like HTML, CSS, JavaScript, JPEG, PNG and other resources.

Installing mod_pagespeed module for Apache in RHEL/CentOS/Fedora 32 and 64 bit


First install at:
#yum install at

Now download mod_pagespeed:
32 bit:
#wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_i386.rpm

For installatio on RHEL/CentOS/Fedora, please execute (also as root):
#rpm -U mod-pagespeed-stable_current_i386.rpm

64 bit:

#wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_x86_64.rpm
#rpm -U mod-pagespeed-stable_current_x86_64.rpm

Installing mod_pagespeed module in Debian/Ubuntu

To install the packages, on Debian/Ubuntu, please run (as root) the following command:
32 bit:
#wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_i386.deb
#dpkg -i mod-pagespeed-stable_current_i386.deb
#apt-get -f install

64 bit:

#wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_amd64.deb
#dpkg -i mod-pagespeed-stable_current_amd64.deb
#apt-get -f install

Verifying mod_pagespeed Module for Apache

To verify mod_pagespeed module create info.php under root directory of Apache and add following lines of code to it.
Now,navigating your web browser to http://ip.add.re.ss/info.php. You will see “X-Mod-Pagespeed” section in the HTTP header.

How to Install MariaDB, Apache/PHP on RHEL/CentOS 7

This howto guide explains you’ll how to install Apache Server with latest MariaDB and PHP on RHEL, CentOS 7 linux using Remi repository via Yum tool.

Install REMI repository

First enable remi repository:
First enable remi repository:
#rpm -ivh http://dl.fedoraproject.org/pub/epel/beta/7/x86_64/epel-release-7-0.2.noarch.rpm

Installing MariaDB (MySQL)
To install MySQL, we do install mariadb like this:
#yum -y install mariadb-server mariadb

Now, ceate the system startup links for MySQL and start the MySQL server:
#systemctl start mariadb.service
#systemctl enable mariadb.service

Set passwords for the MySQL root account:
Set passwords for the MySQL root account:
#mysql_secure_installation

[root@localhost ~]# mysql_secure_installation
/usr/bin/mysql_secure_installation: line 379: find_mysql_client: command not found

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none): <--ENTER
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n]
New password: <--yourmariadbpassword
Re-enter new password: <--yourmariadbpassword
Password updated successfully!
Reloading privilege tables..
... Success!

By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] <--ENTER
... Success!

Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] <--ENTER
... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] <--ENTER
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] <--ENTER
... Success!

Cleaning up...

All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!
[root@localhost ~]#

Install Apache server


CentOS 7.0 ships with apache 2.4. Apache2 is directly available as a CentOS 7.0 package, therefore we can install it like this:
#yum -y install httpd

Now, configure your system to start Apache at boot time:
#systemctl start httpd.service
#systemctl enable httpd.service

In CentOS 7.0 uses Firewall-cmd. Use following command to allow http and https external access.
#firewall-cmd --permanent --zone=public --add-service=http 
#firewall-cmd --permanent --zone=public --add-service=https
#firewall-cmd --reload

Now direct your browser to http://ip.add.re.ss/, and you should see the Apache2 placeholder page:
CentOS 7 default apache page
CentOS 7 default apache page

Installing PHP

We can install PHP width MySQL support and some common PHP modules that are required by CMS Systems like WordPress, Joomla and Drupal use following commands:
#yum -y install php php-mysql php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-snmp php-soap curl curl-devel

The document root of the default web site is /var/www/html. We will now create a small PHP file (info.php) in that directory and call it in a browser. The file will display lots of useful details about our PHP installation, such as the installed PHP version.
#nano /var/www/html/info.php

Now we call that file in a browser (e.g. http://ip.add.re.ss/info.php):

Example info.php page

How to Monitor MySql database using mytop command line monitoring tool

Mytop is a free and open source command line monitoring software for MySQL databases. Its similar in look to “top” command in Linux/Unix. Mytop monitors MySQL threads and the database’s overall performance, allowing system administrators or developers to get some insight on how applications are interacting with a database.

Install Mytop on RHEL/CentOS and Fedora linux



Mytop is included in the Fedora repositories, so it is just a yum install away. If you are using Red Hat Enterprise Linux or CentOS, mytop is available via the RPMForge repository.
Now install the Mytop package:

#yum install mytop -y

Monitor Databases

Now, run the following command to open the Mytop tool. It will ask the mysql root password to monitor the databases:
#mytop --prompt
mytop mysql monitoring tool
If you want to monitor a particular database, use the parameter -d. For example, to monitor the database called “example_database” enter the following command:
#mytop --prompt -d example_database

Shortcut Keys

The following keys perform various actions while mytop is running. Those which have not been implemented are listed as such. They are included to give the user idea of what is coming.
?     Display help.
c     Show “command counters” based on the Com_* values in SHOW STATUS. This is a new feature. Feedback welcome.
d    Show only threads connected to a particular database.
f     Given a thread id, display the entire query that thread was (and still may be) running.
F    Disable all filtering (host, user, and db).
h    Only show queries from a particular host.
H    Toggle the header display. You can also specify either header=0 or header=1 in your config file to set the default behavior.
i     Toggle the display of idle (sleeping) threads. If sleeping threads are filtered, the default sorting order is reversed so that the longest running queries appear at the top of the list.
k    Kill a thread.
m  Toggle modes. Currently this switches from `top’ mode to `qps’ (Queries Per Second Mode). In this mode, mytop will write out one integer per second. The number written reflects the number of queries executed by the server in the previous one second interval.
More modes may be added in the future.
o    Reverse the default sort order.
p    Pause display.
q    Quit mytop
r    Reset the server’s status counters via a FLUSH STATUS command.
s    Change the sleep time (number of seconds between display refreshes).
u   Show only threads owned by a giver user.

Thats it. Refer the official documentation page for more information about Mytop.





How to install Bmon – real-time bandwidth monitoring tool for linux

Bmon is a portable real-time bandwidth monitor and rate estimator. It supports various input methods for different architectures. Various output modes exist, including an interactive curses interface, lightweight HTML output, and simple ASCII output. Statistics may be distributed over a network using multicast or unicast and collected at some point to generate a summary of statistics for a set of nodes.

Install Bmon on Debian/Ubuntu linux

For Debian/Ubuntu systems type following command in a terminal:
$ sudo apt-get install bmon

Here are the steps to install bmon from source code:
Download the latest version from Carisma website
Download the latest version from Carisma website
$ wget http://www.carisma.slowglass.com/~tgr/bmon/files/bmon-3.1.tar.gz

Extract it
$ tar zxfv bmon-3.1.tar.gz

Go the the extracted folder
$ cd bmon-3.1

Compile and install bmon
$ ./configure
$ make
$ sudo make install

How to use bmon

Bmon is an console based tool, open a terminal and enter the command “bmon and you should see the following output:

bmon example
As shown, it lists all the available interfaces. At the bottom, you will find two options to open graph and detailed output by clicking g and d respectively. If done, the output should look like this:
bmon
To get some help how to operate bmon, press “?“button:
bmon help screen
Bmon can be a handy tool for debugging and monitor bandwidth in real-time mode. For more features, you might want to take a look at its man page:

$ man bmon
or 
bmon --help

How to Install RPMForge Repository in RHEL/CentOS


Repoforge, previously known as RPMforge, maintains a repository of RPM packages for Red Hat Enterprise Linux (RHEL), CentOS and Scientific Linux. If you are a RHEL or CentOS user, I strongly suggest you set up Repoforge repository on your system, as it contains many useful software packages that are not available in existing stock repositories.

Verifying RHEL/CentOS is 32 Bit or 64 Bit System

In order to set up Repoforge repository on CentOS, you first need to know the version of your CentOS as well as the underlying process architecture.

To find out which release version of CentOS you are using:

# cat /etc/redhat-release

Installing RPMForge Repository in RHEL/CentOS

To install Rpmforge repository use the following commands.

For RHEL/CentOS 6.x 32 Bit

# sudo rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.i686.rpm
For RHEL/CentOS 6.x 64 Bit
# sudo rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm

Once RPMforge is installed on your system, you can use yum to install all available packages from the Repoforge repo.

Verify RPMForge repository

You need to run folowing command:
#yum repolist
Verify is enabled RPMForge repository