Backup and Restore your Centos

Some time you want to take backup of your server including application and settings .below are the easy method a small example

1- The first step is to create a location to store the backup. For this article we’re going to store the backup on the same hard drive as the installed operating system

2-Make a backup directory where you will keep backup file.

mkdir /backup

3- Now we will create a compressed version of the Operating System in one single file (tarball) using the tar command.

tar cvpzf /backups/backup.tgz --exclude=/proc --exclude=/lost+found --exclude=/backups --exclude=/dev --exclude=/sys --exclude=/boot/grub --exclude=/boot/grub2 --exclude=/etc/fstab --exclude=/etc/sysconfig/network-scripts/ --exclude=/etc/udev/rules.d/70-persistent-net.rules  /

Now transfer your backup.tgz file to new server .In order to restore your server from the previously created tarball the server must have the same Operating System version loaded on it.

To Restore your backup use the following.

tar xvpfz /backups/backup.tgz -C /

Centos 5.X yum update

Update of packages using default repositories (base, update etc.) is no longer applicable.You should switch boxes, run on CentOS 5.x., to so called Vault repositories.

1- Disable base, updates and other enabled repositories (where enabled=1 is set) in the CentOS-Base.repo: 

sed -i 's/enabled=1/enabled=0/g' /etc/yum.repos.d/CentOS-Base.repo

create a new repo file and enter the following lines

vim  /etc/yum.repos.d/CentOS-Vault.repo

[c5.11-base]
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
gpgcheck=1
name=CentOS-5.11 - Base
baseurl=http://vault.centos.org/5.11/os/$basearch/
exclude=ruby* libyaml* corosync* corosynclib* pacemaker*
enabled=1
[c5.11-updates]
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
gpgcheck=1
name=CentOS-5.11 - Updates
baseurl=http://vault.centos.org/5.11/updates/$basearch/
exclude=ruby* libyaml* corosync* corosynclib* pacemaker*
enabled=1

original link :- https://docs.onapp.com/misc/eol-centos-5-x

How to configure Mikrotik DHCP Server for Cisco Phone TFTP option

How to configure Mikrotik DHCP Server for Cisco Phone TFTP option

1- Change your TFTP server IP in to hex code

you can use this online tool : http://www.miniwebtool.com/ip-address-to-hex-converter/

2- Now configure Mikrotik RouterOS :

/ip dhcp-server option add code=150 name=ciscotftp value=0xC0A80307

Continue reading How to configure Mikrotik DHCP Server for Cisco Phone TFTP option

How to install CentOS on Remote Server or VPS

How to install CentOS on Remote Server or VPS

If you want to install CentOS remotely on server on slow link  even if you are able to mount the CentOS  installation media as DVD iso .It takes lots of time and some time corrupted installation .

Linux is having a feature Netinstall you can use that feature and install the CentOS as version you want.

1- Download the Netinstall bootable media ISO file version you would like to install.

http://archive.kernel.org/centos-vault/

For demo I am going to install CentOS 5.5 32 bit

1- I went to following directory

http://archive.kernel.org/centos-vault/5.5/isos/i386/

Continue reading How to install CentOS on Remote Server or VPS

How to enable ESXi SSH And ESXi Shell Using PowerCLI

How to enable ESXi SSH And ESXi Shell Using PowerCLI

Connect to the VCenter Server

 

#Connect to VCenter Server 
Connect-VIServer -Server 192.168.10.1 -Protocol https -User Administrator@vsphere.local -Password P@ssw0rd

#Now Check which serveries are running and you want to start or stop
Get-VMHost 192.168.10.11 | Get-VMHostService

Now you will get slimier  to below screen

Continue reading How to enable ESXi SSH And ESXi Shell Using PowerCLI