Kamis, 29 Januari 2015

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.