How to Create LVM in Linux CentOS 7 / RHEL 7 / Oracle Linux 7

Storage technology plays a important role in improving the availability, performance, and ability to manage Linux servers.

One of the most useful and helpful technology to linux system administrator is Linux Logical Volume Manager(LVM), version 2 (or LVM 2).

LVM is a widely-used technique and extremely flexible disk management scheme for deploying logical rather than physical storage. With LVM, system administrator can easily resize and extend the logical drive when it is required.

Create Lvm

The following steps will describe how to create LVM in Linux CentOS 7 or RHEL 7 or Oracle Linux 7.

How to Create Lvm in Linux Step by Step

1. Add the new 20GB vdisk from the ESXi or vCenter :

Create Lvm

2. create a new Partiton using fdisk tool and select partition type LVM :

[root@centos7 ~]# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0xfd3bf27d.

Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-41943039, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-41943039, default 41943039):
Using default value 41943039
Partition 1 of type Linux and of size 20 GiB is set

Command (m for help): p

Disk /dev/sdb: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0xfd3bf27d

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048    41943039    20970496   83  Linux

Command (m for help): t
Selected partition 1
Hex code (type L to list all codes): L

 0  Empty           24  NEC DOS         81  Minix / old Lin bf  Solaris
 1  FAT12           27  Hidden NTFS Win 82  Linux swap / So c1  DRDOS/sec (FAT-
 2  XENIX root      39  Plan 9          83  Linux           c4  DRDOS/sec (FAT-
 3  XENIX usr       3c  PartitionMagic  84  OS/2 hidden C:  c6  DRDOS/sec (FAT-
 4  FAT16 <32M      40  Venix 80286     85  Linux extended  c7  Syrinx
 5  Extended        41  PPC PReP Boot   86  NTFS volume set da  Non-FS data
 6  FAT16           42  SFS             87  NTFS volume set db  CP/M / CTOS / .
 7  HPFS/NTFS/exFAT 4d  QNX4.x          88  Linux plaintext de  Dell Utility
 8  AIX             4e  QNX4.x 2nd part 8e  Linux LVM       df  BootIt
 9  AIX bootable    4f  QNX4.x 3rd part 93  Amoeba          e1  DOS access
 a  OS/2 Boot Manag 50  OnTrack DM      94  Amoeba BBT      e3  DOS R/O
 b  W95 FAT32       51  OnTrack DM6 Aux 9f  BSD/OS          e4  SpeedStor
 c  W95 FAT32 (LBA) 52  CP/M            a0  IBM Thinkpad hi eb  BeOS fs
 e  W95 FAT16 (LBA) 53  OnTrack DM6 Aux a5  FreeBSD         ee  GPT
 f  W95 Ext'd (LBA) 54  OnTrackDM6      a6  OpenBSD         ef  EFI (FAT-12/16/
10  OPUS            55  EZ-Drive        a7  NeXTSTEP        f0  Linux/PA-RISC b
11  Hidden FAT12    56  Golden Bow      a8  Darwin UFS      f1  SpeedStor
12  Compaq diagnost 5c  Priam Edisk     a9  NetBSD          f4  SpeedStor
14  Hidden FAT16 <3 61  SpeedStor       ab  Darwin boot     f2  DOS secondary
16  Hidden FAT16    63  GNU HURD or Sys af  HFS / HFS+      fb  VMware VMFS
17  Hidden HPFS/NTF 64  Novell Netware  b7  BSDI fs         fc  VMware VMKCORE
18  AST SmartSleep  65  Novell Netware  b8  BSDI swap       fd  Linux raid auto
1b  Hidden W95 FAT3 70  DiskSecure Mult bb  Boot Wizard hid fe  LANstep
1c  Hidden W95 FAT3 75  PC/IX           be  Solaris boot    ff  BBT
1e  Hidden W95 FAT1 80  Old Minix
Hex code (type L to list all codes): 8e
Changed type of partition 'Linux' to 'Linux LVM'

Command (m for help): p

Disk /dev/sdb: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0xfd3bf27d

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048    41943039    20970496   8e  Linux LVM

3. Initializes the partition /dev/sdb1 as an LVM physical volume :

[root@centos7 ~]# pvcreate /dev/sdb1
  Physical volume "/dev/sdb1" successfully created

4. Scanning for Block Devices

[root@centos7 ~]# lvmdiskscan
  /dev/centos/swap [       2.00 GiB]
  /dev/sda1        [     500.00 MiB]
  /dev/centos/root [      27.51 GiB]
  /dev/sda2        [      29.51 GiB] LVM physical volume
  /dev/sdb1        [      20.00 GiB] LVM physical volume
  2 disks
  1 partition
  0 LVM physical volume whole disks
  2 LVM physical volumes

5. Displaying Physical Volumes :

There are three commands you can use to display properties of LVM physical volumes: pvs,
pvdisplay, and pvscan.

The pvdisplay command provides a verbose multi-line output for each physical volume. It displays
physical properties (size, extents, volume group, etc.) in a fixed format.

[root@centos7 ~]# pvdisplay
  --- Physical volume ---
  PV Name               /dev/sda2
  VG Name               centos
  PV Size               29.51 GiB / not usable 3.00 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              7554
  Free PE               0
  Allocated PE          7554
  PV UUID               JvDOto-KDiF-gtca-TveX-ne9M-frsB-qsP1aJ

  "/dev/sdb1" is a new physical volume of "20.00 GiB"
  --- NEW Physical volume ---
  PV Name               /dev/sdb1
  VG Name
  PV Size               20.00 GiB
  Allocatable           NO
  PE Size               0
  Total PE              0
  Free PE               0
  Allocated PE          0
  PV UUID               rJ8wl7-xzIN-2qqV-ov7Z-lHKe-ELge-aAV29V

The pvscan command scans all supported LVM block devices in the system for physical volumes

[root@centos7 ~]# pvscan
  PV /dev/sda2   VG centos          lvm2 [29.51 GiB / 0    free]
  PV /dev/sdb1                      lvm2 [20.00 GiB]
  Total: 2 [49.51 GiB] / in use: 1 [29.51 GiB] / in no VG: 1 [20.00 GiB]

6. Create volume group name vg_newlvm and add /dev/sdb1 partition into the group.

[root@centos7 ~]# vgcreate vg_newlvm /dev/sdb1
  Volume group "vg_newlvm" successfully created

If you have more than one partition, you can add multiple partition in single command. This command creates a local volume named vg_newlvm that contains physical volumes /dev/sdb1 and /dev/sdc1 :

[root@centos7 ~]# vgcreate vg_newlvm /dev/sdb1 /dev/sdc1

7. Creates a logical volume called centos7_newvol that uses all of the unallocated space in the volume group vg_newlvm :

[root@centos7 ~]# lvcreate --name centos7_newvol -l 100%FREE vg_newlvm
  Logical volume "centos7_newvol" created

You can see more example of lvcreate command in article “4 lvcreate Command Examples on Linux

8. Display the created logical volumes :

[root@centos7 ~]# lvdisplay
..
..
  --- Logical volume ---
  LV Path                /dev/vg_newlvm/centos7_newvol
  LV Name                centos7_newvol
  VG Name                vg_newlvm
  LV UUID                szlkNP-0lwe-f59Z-PJVU-X7pG-unBL-qN10D4
  LV Write Access        read/write
  LV Creation host, time centos7.ehowstuff.local, 2015-01-25 15:15:48 +0800
  LV Status              available
  # open                 0
  LV Size                20.00 GiB
  Current LE             5119
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           253:2

9. Use the mkfs command to format a newly created LVM :

[root@centos7 ~]# mkfs.ext4 /dev/vg_newlvm/centos7_newvol
mke2fs 1.42.9 (28-Dec-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
1310720 inodes, 5241856 blocks
262092 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2153775104
160 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000

Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

10. Create the mount point and mount the new LVM :

[root@centos7 ~]# mkdir -p /data
[root@centos7 ~]# mount /dev/vg_newlvm/centos7_newvol /data

11. Verify thew new disk layout :

[root@centos7 ~]# df
Filesystem                           1K-blocks    Used Available Use% Mounted on
/dev/mapper/centos-root               28260132 9191032  17610516  35% /
devtmpfs                               1935888       0   1935888   0% /dev
tmpfs                                  1941892       0   1941892   0% /dev/shm
tmpfs                                  1941892    8728   1933164   1% /run
tmpfs                                  1941892       0   1941892   0% /sys/fs/cgroup
/dev/sda1                               487634   73191    384747  16% /boot
tmpfs                                  1941892    8728   1933164   1% /var/named/chroot/run/named
/dev/mapper/vg_newlvm-centos7_newvol  20507216   45080  19397384   1% /data

Rescan SCSI Bus to Add or Remove a SCSI Devices on Linux

Rescan SCSI bus

When you need to add a hard disk or network interface cards on the new VMware virtual machine on the production server, but you are not allowed to shutdown the server or you have several related issues as below. The following quick article shows how to rescan SCSI Bus to add or remove a SCSI Devices on Linux.

This steps may work on CentOS 5/6/7 and RHEL 5/6/7.

Other related Issues

  • Is it possible to add or remove a SCSI device without rebooting a running system?
  • Can you scan a SCSI bus for new or missing SCSI devices without rebooting?
  • How can I make newly connected SCSI storage devices available without rebooting?
  • What is the Linux equivalent to the Solaris command devfsadm to add or remove storage devices?
  • I am trying to add a LUN to a live system but it is not recognized
  • I am trying to add a tape drive to a live system but it is not recognized
  • I am trying to add a disk drive to a live system but it is not recognized
  • How can I force a rescan of my SAN to find newly associated LUNs?
  • What to do if a newly allocated LUN on my SAN is not available?
  • Unable to probe for a newly allocated LUN
  • Some nodes can’t see my new storage device, how can I make it available?
  • After SAN maintenance activity, not all devices returned – devices in multipath missing or remain in failed state.
  • After SAN failover testing completed, not all devices returned to running state as expected – devices in multipath missing or remain in failed state.
  • What is the best way to remove a SCSI disk from the system

After Red Hat Enterprise Linux 5.0 (RHEL 5) and above (RHEL 6 and RHEL 7), it is possible to make changes to the SCSI I/O subsystem without rebooting.

How to Rescan SCSI Bus to Add or Remove a SCSI Devices on Linux

1. Identify host bus number :

# ls /sys/class/scsi_host/
host0  host1  host2

2. Rescan the SCSI Bus to Add a SCSI Devices :

# echo "- - -" > /sys/class/scsi_host/host0/scan
# echo "- - -" > /sys/class/scsi_host/host1/scan
# echo "- - -" > /sys/class/scsi_host/host2/scan

Reference :

How to Add a New Hard Disk Without Rebooting on CentOS 7/ RHEL 7

Normally when you have added new storage to a running Virtual machine, you probably won’t see the new storage automatically.

This is because the SCSI bus to which the storage devices are connected needs to be rescanned to make the new hardware visible.

As a system administrator, to maintain the linux server uptime is very important and it is better to add a new hard disk without reboot the server.

There is one simple command to rescan the SCSI Bus and add SCSI Devices. The command will trigger the linux rescan scsi bus device on the system.

The following steps has been tested on CentOS 7, RHEL 7 and Oracle Linux 7.

Steps to Add a New Hard Disk Without Rebooting on CentOS 7/ RHEL 7

1. Add the new 20GB vdisk from the ESXi or vCenter :

Add a New Hard Disk Without Reboot

2. Show current disk and partition :

[root@centos7 ~]# fdisk -l
Disk /dev/sda: 32.2 GB, 32212254720 bytes, 62914560 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x0006b96a

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     1026047      512000   83  Linux
/dev/sda2         1026048    62914559    30944256   8e  Linux LVM

Disk /dev/mapper/centos-swap: 2147 MB, 2147483648 bytes, 4194304 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/centos-root: 29.5 GB, 29536288768 bytes, 57688064 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

3. Identify host bus number :

[root@centos7 ~]# ls /sys/class/scsi_host/
host0  host1  host2

4. Rescan the SCSI Bus to Add a SCSI Devices :

[root@centos7 ~]# echo "- - -" > /sys/class/scsi_host/host0/scan
[root@centos7 ~]# echo "- - -" > /sys/class/scsi_host/host1/scan
[root@centos7 ~]# echo "- - -" > /sys/class/scsi_host/host2/scan

4. Verify the disk and partiton and make sure 20GB has been added. In this case, the following line appeared “Disk /dev/sdb: 21.5 GB, 21474836480 bytes, 41943040 sectors” and confirmed that 20GB has been added without reboot the server :

[root@centos7 ~]# fdisk -l

Disk /dev/sda: 32.2 GB, 32212254720 bytes, 62914560 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x0006b96a

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     1026047      512000   83  Linux
/dev/sda2         1026048    62914559    30944256   8e  Linux LVM

Disk /dev/mapper/centos-swap: 2147 MB, 2147483648 bytes, 4194304 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/centos-root: 29.5 GB, 29536288768 bytes, 57688064 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sdb: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

4 lvcreate Command Examples on Linux

Logical volume management (LVM) is a widely-used technique and extremely flexible disk management scheme. It basically contain three basic command :

a. Creates the physical volumes using pvcreate
b. Create the volume group and add partition into volume group using vgcreate
c. Create a new logical volume using lvcreate

lvm-diagram1

The following examples focus on the command to create a logical volume in an existing volume group, lvcreate. lvcreate is the command do allocating logical extents from the free physical extent pool of that volume group. Normally logical volumes use up any space available on the underlying physical volumes on a next-free basis. Modifying the logical volume will frees and reallocates space in the physical volumes. The following lvcreate command has been tested on linux CentOS 5, CentOS 6, CentOS 7, RHEL 5, RHEl 6 and RHEL 7 version.

4 lvcreate Command Examples on Linux :

1. The following command creates a logical volume 15 gigabytes in size in the volume group vg_newlvm :

[root@centos7 ~]# lvcreate -L 15G vg_newlvm

2. The following command creates a 2500 MB linear logical volume named centos7_newvol in the volume group
vg_newlvm, creating the block device /dev/vg_newlvm/centos7_newvol :

[root@centos7 ~]# lvcreate -L 2500 -n centos7_newvol vg_newlvm

3. You can use the -l argument of the lvcreate command to specify the size of the logical volume in extents. You can also use this argument to specify the percentage of the volume group to use for the logical volume. The following command creates a logical volume called centos7_newvol that uses 50% of the total space in volume group vg_newlvm :

[root@centos7 ~]# lvcreate -l 50%VG -n centos7_newvol vg_newlvm

4. The following command creates a logical volume called centos7_newvol that uses all of the unallocated space in the volume group vg_newlvm :

[root@centos7 ~]# lvcreate --name centos7_newvol -l 100%FREE vg_newlvm

To see more lvcreate command options, issue the following command :

[root@centos7 ~]# lvcreate --help
  lvcreate: Create a logical volume

lvcreate
        [-A|--autobackup {y|n}]
        [-a|--activate [a|e|l]{y|n}]
        [--addtag Tag]
        [--alloc AllocationPolicy]
        [--cachemode CacheMode]
        [-C|--contiguous {y|n}]
        [-d|--debug]
        [-h|-?|--help]
        [--ignoremonitoring]
        [--monitor {y|n}]
        [-i|--stripes Stripes [-I|--stripesize StripeSize]]
        [-k|--setactivationskip {y|n}]
        [-K|--ignoreactivationskip]
        {-l|--extents LogicalExtentsNumber[%{VG|PVS|FREE}] |
         -L|--size LogicalVolumeSize[bBsSkKmMgGtTpPeE]}
        [-M|--persistent {y|n}] [--major major] [--minor minor]
        [-m|--mirrors Mirrors [--nosync] [{--mirrorlog {disk|core|mirrored}|--corelog}]]
        [-n|--name LogicalVolumeName]
        [--noudevsync]
        [-p|--permission {r|rw}]
        [--[raid]minrecoveryrate Rate]
        [--[raid]maxrecoveryrate Rate]
        [-r|--readahead ReadAheadSectors|auto|none]
        [-R|--regionsize MirrorLogRegionSize]
        [-T|--thin  [-c|--chunksize  ChunkSize]
          [--discards {ignore|nopassdown|passdown}]
          [--poolmetadatasize MetadataSize[bBsSkKmMgG]]]
          [--poolmetadataspare {y|n}]
        [--thinpool ThinPoolLogicalVolume{Name|Path}]
        [-t|--test]
        [--type VolumeType]
        [-v|--verbose]
        [-W|--wipesignatures {y|n}]
        [-Z|--zero {y|n}]
        [--version]
        VolumeGroupName [PhysicalVolumePath...]

lvcreate
        { {-s|--snapshot} OriginalLogicalVolume[Path] |
          [-s|--snapshot] VolumeGroupName[Path] -V|--virtualsize VirtualSize}
          {-T|--thin} VolumeGroupName[Path][/PoolLogicalVolume]
                      -V|--virtualsize VirtualSize}
        [-c|--chunksize]
        [-A|--autobackup {y|n}]
        [--addtag Tag]
        [--alloc AllocationPolicy]
        [-C|--contiguous {y|n}]
        [-d|--debug]
        [--discards {ignore|nopassdown|passdown}]
        [-h|-?|--help]
        [--ignoremonitoring]
        [--monitor {y|n}]
        [-i|--stripes Stripes [-I|--stripesize StripeSize]]
        [-k|--setactivationskip {y|n}]
        [-K|--ignoreactivationskip]
        {-l|--extents LogicalExtentsNumber[%{VG|FREE|ORIGIN}] |
         -L|--size LogicalVolumeSize[bBsSkKmMgGtTpPeE]}
        [--poolmetadatasize MetadataVolumeSize[bBsSkKmMgG]]
        [-M|--persistent {y|n}] [--major major] [--minor minor]
        [-n|--name LogicalVolumeName]
        [--noudevsync]
        [-p|--permission {r|rw}]
        [-r|--readahead ReadAheadSectors|auto|none]
        [-t|--test]
        [--thinpool ThinPoolLogicalVolume[Path]]
        [-v|--verbose]
        [--version]
        [PhysicalVolumePath...]

Will 2015 be the year of the Microsoft/Linux love fest?

Microsoft has finally embraced Linux — with a bit of passion. Jack Wallen reports why he believes the makers of Windows have finally come around to sidling up to the open-source platform.

There is one sentence that I swore I’d never write.

Microsoft loves Linux.

That’s right. During a webcast, new CEO Satya Nadella stood next to an image that said “Microsoft [heart symbol] Linux.” Understand, the presentation was all about Azure and the new services it has added to the system. Included with those new services were Linux-based systems (such as the Cloudera Hadoop package and the CoreOS Linux distribution) — so, it’s not like Microsoft is all of a sudden embracing Linux as a desktop OS.

Yet… sort of.

I believe Microsoft is finally gazing into the same crystal ball as everyone else has been and is seeing that “platform” is on the verge of complete irrelevancy. This isn’t 1999, where platform was King, and the King had a name — Windows. This is 2015, and the crow now rests squarely on the network — the cloud. And to make the cloud work, really work, the platform must become transparent. Otherwise, you suffer from lock-in, and that will be your death knell.

Why?

Numbers don’t lie. The majority of users get their content via mobile devices, like smartphones and tablets. As of a year ago, mobile use has exceeded desktop usage. That means the browsers and devices accessing servers, content, and SaaS are no longer tied to a desktop platform. That also means juggernauts like Microsoft have to completely reinvent the way they think and do business — otherwise, they’ll go the way of the desktop.

I’m constantly taken aback when people contact me about my author website and say, “Something’s wrong with your page. It doesn’t look right!” I open Chrome, and it looks fine. And then … I remember … they are most likely viewing the site with their phone.

Rethink. Retool. Refine.

That is why Microsoft has found itself in a position of having to “love Linux.” Microsoft needs Linux to achieve transparency for today’s market and user base. Without Linux, Microsoft’s Azure platform is not nearly as flexible as today’s tech landscape requires. Microsoft knows this, and that’s why it currently offers five Linux servers on Azure (CentOS, Ubuntu, CoreOS, OpenSuSE, and Oracle Linux). The one major Linux server missing is Red Hat, but I’m certain Microsoft will eventually open its arms and heart to one of the most powerful enterprise Linux distributions on the planet.

But let’s face it, the real competition Microsoft faces today is Google and Amazon — cloud services, not platforms (that game is done, over, kaput). And to be competitive in the cloud, Microsoft can’t, in any way, go it alone.

How times have changed.

To that end, Microsoft will find itself in a love fest with Linux this year. They will become best of friends, snap selfies together, and post on one another’s Facebook wall. Even once Windows 10 is released, this won’t change. I firmly believe that Microsoft has finally come to grips with the idea that the desktop is no longer the be-all end-all to their bottom line. Azure brings in roughly $5 billion in annual revenue for Microsoft — all the while sidling up to that which their one-time CEO called “a cancer.” Remove Linux from the picture, and that $5 billion in annual revenue shrinks drastically.

Fiction and reality have finally merged. Microsoft and Linux are sharing a spotlight that no one ever thought the penguin could possibly enjoy, all because the platform has become secondary to the new King — software and service.

Click here for full Story

How to Install Webmin 1.720 on CentOS 6/RHEL 6

Webmin is a web-based free software that is created for the administration of the system for linux and unix . It is managed through the graphical web interface that is very user friendly and suitable for beginners who are less familiar with linux command line utility. However, a recent version can also be installed and running on the Windows operating system. Webmin can be managed using a modern web browser like google chrome, mozilla firefox and internet explorer. If you are a website operator or system administrator of the virtual private server (VPS) or dedicated server, it is appropriate to use webmin as a platform to manage the system, it will make your life easier.

With webmin, system administrators can perform system administration and configuration task of such a setup user accounts, Apache configuration, DNS management, MySQL database administration, file sharing administration and more. As a reference, I have document the steps of how to setup Webmin 1.720 on CentOS 6/RHEL 6 using source instalation.

1. Download Webmin :

[root@centos66 ~]# wget http://prdownloads.sourceforge.net/webadmin/webmin-1.720.tar.gz

2. Create /software and extract webmin from where it was downloaded :

[root@centos66 ~]# mkdir -p /software
[root@centos66 ~]# tar xzvf webmin-1.720.tar.gz
[root@centos66 ~]# cd webmin-1.720

3. Run setup.sh script :

[root@centos66 webmin-1.720]# ./setup.sh /software/webmin

Example :

[root@centos66 webmin-1.720]# ./setup.sh /software/webmin

When the setup.sh script is run, it will ask the following questions :
The Webmin configuration directory
The directory in which all Webmin configuration information is stored. This is now separate from the Webmin install directory, so that configurations are saved when you upgrade. 
If you have previously installed Webmin and use the same config directory, this will be the only question asked.
The Webmin log directory
The location for pid and webserver log files.
The full path to perl on your system
This is usually /usr/bin/perl or /usr/local/bin/perl
Your Operating system type
In Webmin versions 0.990 and above, this question is only asked if your operating system cannot be automatically determined.
The setup script will display a list of supported systems. If your OS is not on the list, you can try choosing the closest match. However this may not work properly, and may even cause serious problems!
Web server port
The TCP port that the Webmin web server will listen on.
Web server login and password
The login name and password used to acess the Webmin web server.
Web server hostname
The hostname of the machine on which Webmin will run.
Use SSL
This question will only be asked if your system has the Perl SSL libraries installed. See below for more..
Start Webmin at boot time
If your OS is supported, Webmin will ask if you want to have it automatically started at boot time.
Assuming you answer all the above questions correctly, the Webmin web server will be started and the setup script will give you the URL to go to. Enter this URL into your browser, and you will be prompted for the login and password that you choose in setup.sh. Once you have logged in your browser should show the main Webmin page, on which is an icon for each module you have installed.
Typically you can connect to Webmin at http://localhost:10000/. Or if accessing it remotely, replace localhost with your system's IP address.
[root@centos66 webmin-1.720]# ./setup.sh /software/webmin
***********************************************************************
*            Welcome to the Webmin setup script, version 1.720        *
***********************************************************************
Webmin is a web-based interface that allows Unix-like operating
systems and common Unix services to be easily administered.

Installing Webmin from /root/webmin-1.720 to /software/webmin ...

***********************************************************************
Webmin uses separate directories for configuration files and log files.
Unless you want to run multiple versions of Webmin at the same time
you can just accept the defaults.

Config file directory [/etc/webmin]:
Log file directory [/var/webmin]:

***********************************************************************
Webmin is written entirely in Perl. Please enter the full path to the
Perl 5 interpreter on your system.

Full path to perl (default /usr/bin/perl):

Testing Perl ...
Perl seems to be installed ok

***********************************************************************
Operating system name:    CentOS Linux
Operating system version: 6.6

***********************************************************************
Webmin uses its own password protected web server to provide access
to the administration programs. The setup script needs to know :
 - What port to run the web server on. There must not be another
   web server already using this port.
 - The login name required to access the web server.
 - The password required to access the web server.
 - If the webserver should use SSL (if your system supports it).
 - Whether to start webmin at boot time.

Web server port (default 10000):
Login name (default admin):
Login password:
Password again:
The Perl SSLeay library is not installed. SSL not available.
Start Webmin at boot time (y/n): y
***********************************************************************
Copying files to /software/webmin ..
..done

Creating web server config files..
..done

Creating access control file..
..done

Inserting path to perl into scripts..
..done

Creating start and stop scripts..
..done

Copying config files..
..done

Configuring Webmin to start at boot time..
..done

Creating uninstall script /etc/webmin/uninstall.sh ..
..done

Changing ownership and permissions ..
..done

Running postinstall scripts ..
Subroutine setup_ca redefined at /software/webmin/webmin/webmin-lib.pl line 77.
Subroutine install_webmin_module redefined at /software/webmin/webmin/webmin-lib.pl line 127.
Subroutine grant_user_module redefined at /software/webmin/webmin/webmin-lib.pl line 439.
Subroutine delete_webmin_module redefined at /software/webmin/webmin/webmin-lib.pl line 480.
Subroutine file_basename redefined at /software/webmin/webmin/webmin-lib.pl line 589.
Subroutine gnupg_setup redefined at /software/webmin/webmin/webmin-lib.pl line 603.
Subroutine list_standard_modules redefined at /software/webmin/webmin/webmin-lib.pl line 631.
Subroutine standard_chooser_button redefined at /software/webmin/webmin/webmin-lib.pl line 663.
Subroutine list_third_modules redefined at /software/webmin/webmin/webmin-lib.pl line 676.
Subroutine third_chooser_button redefined at /software/webmin/webmin/webmin-lib.pl line 708.
Subroutine get_webmin_base_version redefined at /software/webmin/webmin/webmin-lib.pl line 719.
Subroutine base_version redefined at /software/webmin/webmin/webmin-lib.pl line 729.
Subroutine get_newmodule_users redefined at /software/webmin/webmin/webmin-lib.pl line 740.
Subroutine save_newmodule_users redefined at /software/webmin/webmin/webmin-lib.pl line 762.
Subroutine get_miniserv_sockets redefined at /software/webmin/webmin/webmin-lib.pl line 786.
Subroutine fetch_updates redefined at /software/webmin/webmin/webmin-lib.pl line 834.
Subroutine check_update_signature redefined at /software/webmin/webmin/webmin-lib.pl line 901.
Subroutine find_cron_job redefined at /software/webmin/webmin/webmin-lib.pl line 932.
Subroutine get_ipkeys redefined at /software/webmin/webmin/webmin-lib.pl line 944.
Subroutine save_ipkeys redefined at /software/webmin/webmin/webmin-lib.pl line 965.
Subroutine validate_key_cert redefined at /software/webmin/webmin/webmin-lib.pl line 997.
Subroutine detect_operating_system redefined at /software/webmin/webmin/webmin-lib.pl line 1018.
Subroutine show_webmin_notifications redefined at /software/webmin/webmin/webmin-lib.pl line 1053.
Subroutine get_webmin_notifications redefined at /software/webmin/webmin/webmin-lib.pl line 1069.
Subroutine get_system_uptime redefined at /software/webmin/webmin/webmin-lib.pl line 1271.
Subroutine list_operating_systems redefined at /software/webmin/webmin/webmin-lib.pl line 1318.
Subroutine shared_root_directory redefined at /software/webmin/webmin/webmin-lib.pl line 1343.
Subroutine submit_os_info redefined at /software/webmin/webmin/webmin-lib.pl line 1380.
Subroutine get_webmin_id redefined at /software/webmin/webmin/webmin-lib.pl line 1408.
Subroutine ip_match redefined at /software/webmin/webmin/webmin-lib.pl line 1424.
Subroutine prefix_to_mask redefined at /software/webmin/webmin/webmin-lib.pl line 1519.
Subroutine valid_allow redefined at /software/webmin/webmin/webmin-lib.pl line 1533.
Subroutine get_preloads redefined at /software/webmin/webmin/webmin-lib.pl line 1591.
Subroutine save_preloads redefined at /software/webmin/webmin/webmin-lib.pl line 1603.
Subroutine get_tempdirs redefined at /software/webmin/webmin/webmin-lib.pl line 1614.
Subroutine save_tempdirs redefined at /software/webmin/webmin/webmin-lib.pl line 1631.
Subroutine get_module_install_type redefined at /software/webmin/webmin/webmin-lib.pl line 1650.
Subroutine get_install_type redefined at /software/webmin/webmin/webmin-lib.pl line 1667.
Subroutine list_cached_files redefined at /software/webmin/webmin/webmin-lib.pl line 1697.
Subroutine show_restart_page redefined at /software/webmin/webmin/webmin-lib.pl line 1716.
Subroutine cert_info redefined at /software/webmin/webmin/webmin-lib.pl line 1734.
Subroutine cert_pem_data redefined at /software/webmin/webmin/webmin-lib.pl line 1775.
Subroutine cert_pkcs12_data redefined at /software/webmin/webmin/webmin-lib.pl line 1790.
Subroutine get_blocked_users_hosts redefined at /software/webmin/webmin/webmin-lib.pl line 1816.
Subroutine show_ssl_key_form redefined at /software/webmin/webmin/webmin-lib.pl line 1844.
Subroutine parse_ssl_key_form redefined at /software/webmin/webmin/webmin-lib.pl line 1888.
Subroutine parse_ssl_csr_form redefined at /software/webmin/webmin/webmin-lib.pl line 1961.
Subroutine build_installed_modules redefined at /software/webmin/webmin/webmin-lib.pl line 2035.
Subroutine get_latest_webmin_version redefined at /software/webmin/webmin/webmin-lib.pl line 2077.
Subroutine filter_updates redefined at /software/webmin/webmin/webmin-lib.pl line 2110.
Subroutine get_clone_source redefined at /software/webmin/webmin/webmin-lib.pl line 2152.
Subroutine retry_http_download redefined at /software/webmin/webmin/webmin-lib.pl line 2168.
Subroutine list_twofactor_providers redefined at /software/webmin/webmin/webmin-lib.pl line 2199.
Subroutine show_twofactor_apikey_authy redefined at /software/webmin/webmin/webmin-lib.pl line 2209.
Subroutine validate_twofactor_apikey_authy redefined at /software/webmin/webmin/webmin-lib.pl line 2221.
Subroutine show_twofactor_form_authy redefined at /software/webmin/webmin/webmin-lib.pl line 2246.
Subroutine parse_twofactor_form_authy redefined at /software/webmin/webmin/webmin-lib.pl line 2262.
Subroutine enroll_twofactor_authy redefined at /software/webmin/webmin/webmin-lib.pl line 2277.
Subroutine validate_twofactor_authy redefined at /software/webmin/webmin/webmin-lib.pl line 2308.
Subroutine validate_twofactor_apikey_totp redefined at /software/webmin/webmin/webmin-lib.pl line 2354.
Subroutine show_twofactor_form_totp redefined at /software/webmin/webmin/webmin-lib.pl line 2368.
Subroutine parse_twofactor_form_totp redefined at /software/webmin/webmin/webmin-lib.pl line 2382.
Subroutine generate_base32_secret redefined at /software/webmin/webmin/webmin-lib.pl line 2398.
Subroutine enroll_twofactor_totp redefined at /software/webmin/webmin/webmin-lib.pl line 2412.
Subroutine message_twofactor_totp redefined at /software/webmin/webmin/webmin-lib.pl line 2421.
Subroutine validate_twofactor_totp redefined at /software/webmin/webmin/webmin-lib.pl line 2435.
Subroutine canonicalize_ip6 redefined at /software/webmin/webmin/webmin-lib.pl line 2457.
Subroutine list_keys redefined at /software/webmin/webmin/gnupg-lib.pl line 23.
Subroutine list_keys_sorted redefined at /software/webmin/webmin/gnupg-lib.pl line 74.
Subroutine list_secret_keys redefined at /software/webmin/webmin/gnupg-lib.pl line 82.
Subroutine key_fingerprint redefined at /software/webmin/webmin/gnupg-lib.pl line 88.
Subroutine get_passphrase redefined at /software/webmin/webmin/gnupg-lib.pl line 105.
Subroutine put_passphrase redefined at /software/webmin/webmin/gnupg-lib.pl line 116.
Subroutine encrypt_data redefined at /software/webmin/webmin/gnupg-lib.pl line 128.
Subroutine decrypt_data redefined at /software/webmin/webmin/gnupg-lib.pl line 167.
Subroutine sign_data redefined at /software/webmin/webmin/gnupg-lib.pl line 224.
Subroutine verify_data redefined at /software/webmin/webmin/gnupg-lib.pl line 283.
Subroutine read_entire_file redefined at /software/webmin/webmin/gnupg-lib.pl line 327.
Subroutine write_entire_file redefined at /software/webmin/webmin/gnupg-lib.pl line 339.
Subroutine get_trust_level redefined at /software/webmin/webmin/gnupg-lib.pl line 349.
Subroutine delete_key redefined at /software/webmin/webmin/gnupg-lib.pl line 371.
Subroutine default_email_address redefined at /software/webmin/webmin/gnupg-lib.pl line 398.
Subroutine fetch_gpg_key redefined at /software/webmin/webmin/gnupg-lib.pl line 415.
Subroutine search_gpg_keys redefined at /software/webmin/webmin/gnupg-lib.pl line 442.
Use of uninitialized value in -r at /software/webmin/webalizer/webalizer-lib.pl line 16.
..done

Enabling background status collection ..
..done

Attempting to start Webmin mini web server..
Starting Webmin server in /software/webmin
Pre-loaded WebminCore
..done

***********************************************************************
Webmin has been installed and started successfully. Use your web
browser to go to

  http://centos66.ehowstuff.local:10000/

and login with the name and password you entered previously.

4. Access webmin via http://centos66.ehowstuff.local:10000/ or http://IP-Address:10000/ :

How to Import and Export MySQL Database Command line in Linux

import and export MySQL database command line in LinuxIn this article, I will show you how to import and export MySQL database command line in Linux. In this case, export is to backup while import is to restore. The syntax are very simple and easy to understand and suitable for all levels of users including beginners. This MySQL command line is useful for those who want to migrate their WordPress blog from shared hosting to virtual private server (VPS) hosting or from current VPS hosting to new VPS hosting. This MySQL Database Import and Export command has been tested on CentOS 6 and CentOS 7 and Oracle Linux either on MySQL or MariaDB database.

How to Export MySQL Database Command line in Linux

1. Syntax to Export:

mysqldump -u USERNAME -p DATABASE_NAME > filename.sql

How to Export MySQL Database Command line in Linux

2. Syntax to Import:

mysql -u USERNAME -p DATABASE_NAME < filename.sql

Example :

Export WordPress_DB :

[root@vps ~]# mysqldump -u WordPress_User -p WordPress_DB > WordPress_DB.sql

Import WordPress_DB :

[root@vps ~]# mysql -u WordPress_User -p WordPress_DB < WordPress_DB.sql

I hope this article gives you some ideas and essential guidance on how to import and export MySQL database command line in Linux.

 

A year in the life of OpenStack

What a year for OpenStack! With two shiny new releases, two excellent summits on opposite sides of the Atlantic, countless new features, and an ever-growing community of users and developers, it truly has been a year of progress for OpenStack.

Let’s take a look back at some of our coverage here on Opensource.com, and perhaps take a sneak peek at what might be in store for the new year.

OpenStack people

The best part of covering OpenStack here on Opensource.com has been getting to hear from the people who make it happen. At the beginning of the year, John Dickinson, leader of the OpenStack Swift project, took us through storage policiesand what they would mean for OpenStack’s object storage system. Anne Gentle, the documentation lead for OpenStack, shared with us here involvement in theWomen of OpenStack program and how it is bringing more female leaders to the project and to the open source community at large. And community manager Stefano Maffulli gave us some suggestions for how contributing to OpenStack could be made easier.

A little later in the year we heard from OpenStack release manager Thierry Carrez about the feature freeze and what it means for the project development cycle. We spoke to storage expert John Griffith about the Cinder block storage project. Doug Hellmann told us about his work leading the OpenStack Oslo project, where common pieces of code are stored. And we learned from Victoria Martinez de la Cruz about the translation efforts taking place to make OpenStack accessible to everyone.

After the first OpenStack Summit of the year in Atlanta, we heard some thoughts from Jim Haselmaier about OpenStack project management and what it means for driving the direction of a diverse project. DreamHost’s vice president of cloud Jonathan LaCour told us how his company is reinventing itself with OpenStack. Jesus Gonzalez-Barahona told us about some of the numbers behind OpenStack and how they compare to other open source cloud projects. And StackStorm CTO Dmitri Zimine brought us a three part series on tools for deploying and managing OpenStack and the workloads on top of it.

We ramped up our coverage even more before the Paris Summit, bringing you a full interview series. We learned from Everett Toews of Rackspace how Apache jclouds can help to simplify application development in the cloud. We spoke with OpenStack Neutron project lead Kyle Mestery about contributing effectively to that project. Sage Weil told us what software defined storage means for OpenStack, and Metacloud’s director of community evangelism Niki Acosta told us about her work in the community. Python guru Julien Danjou told us about Ceilometer, thetelemetry project for OpenStack. OpenStack board of directors member Tim Bell told us about how OpenStack powers the research at CERN. And former NASA CTO Chris Kemp told us about the early days of OpenStack.

OpenStack tutorials

This year, we launched a new tutorial series, featuring the best new guides published every month. We started in May by highlighting several excellent beginners’ guides, tips on managing floating IPs, security and server hardening guides, an introduction to multi-node installation, and an overview of what is new in the most recent release of OpenStack Heat. And in June, we linked to guides for getting OpenStack to play nice with firewalld and NetworkManager, using Test Kitchen with Puppet on an OpenStack deployment, Kerberos, Docker containers, and getting started with OpenStack on Solaris.

In July, we featured tutorials on monitoring features, metadata services, benchmarking, the Jumpgate library, logging, and even launching a Team Fortress 2 server through OpenStack, followed by August, where we looked at git tricks to make your OpenStack patches easier for others to digest, using Heat to manage Docker containers, how to delete compute instances directly from the database, and more.

When September rolled around, we gave tips for running OpenStack on FreeBSD, testing out OpenStack’s newest incubated project, building an elastic WordPress installation, and more. Then in October, we helped you with advice for building RPM packages, simplifying log files, running custom code with Nova hooks, and more.

In November, we investigated CPU topology, splitting up a Swift cluster, container orchestration, using affinity controls, sharing public images in Glance, and more. And finally in December, we highlighted tutorials for creating disk images for Glance in Ceph, deleting orphaned storage volumes, comparing patchsets in Gerrit, and more.

A cloudy world

We also covered a number of open source projects this year which might be interesting to an OpenStack user. We interviewed Frank Huerta, CEO of a company called TransLattice who is leading an open source project calledPostgres-XL designed to modernize the PostgreSQL database for clustered environments with big data. We spoke with Neela Jacques, executive director of the OpenDaylight project to learn how they are working to build an open platform for software defined networking. And we learned from Chris Hoge how to deploy OpenStack using Puppet, an open source system for automating IT operations.

In the container world, we had great success in getting started with Docker from Vincent Batts’ guide for beginners, and learned even more from Dan Walsh who taught us about Docker security in his two part series. Then, we learned aboutFlocker, Clocker, and more!

Noting the importance of big data in the cloud, we got an excellent introduction to Apache Hadoop for big data from Sachin Bappalige. Sachin also helped us to explore Apache Mesos and how it can be used as a cluster management tool in data centers.

In all, it was an exciting year for the open source cloud, and I can’t wait to see what 2015 will bring!

Click here for full Story

How to Add Linux Swap Space on CentOS 6 VPS

Linux swapI have a virtual private server (VPS) and plans to run a WordPress blog in it. A limited amount of RAM and swap size will be an issue because some software applications like MySQL, Apache, NGINX, PHP, HHVM and Varnish requires more memory to operate.

From my past experience in Ubiquity Hosting and Linode, the pre-allocated swap sizes of 2GB and 1GB VPS are 1GB and 512MB only. After switched to 2GB plan for RamNode VPS, linux swap also provided in the size of 1GB.

Why we need Linux Swap Space ?

To make your server more responsive and prevent crash when it runs out of memory, giving additional linux swap space will help. Linux swap is an area on the storage or hard disk where the operating system can temporarily store data that it no longer can hold in memory. Without the Linux swap, the VPS that runs out of memory can crash or start kill some applications to free up memory. This can cause lose for unsaved data or experience downtime.

However, swapping does have drawbacks. Reading from and writing to swap is slower than using memory. But swapping should take advantages on the SSD server. In the hard disk drive, If VPS started using linux swap space, the VPS performance can slow down significantly.

As a reference for webmasters and system administrators, here are the steps on how to increase the size of the linux swap on CentOS 6 VPS. This steps may also works and tested on CentOS 7 / RHEL 7 and oracle linux 7.

1. Check and verify the allocated disk partition for swap using “fdisl -l” command :

[root@vps ~]# fdisk -l

Disk /dev/vda: 53.7 GB, 53687091200 bytes
16 heads, 63 sectors/track, 104025 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00059ca1

   Device Boot      Start         End      Blocks   Id  System
/dev/vda1   *           3        1018      512000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/vda2            1018        3099     1048576   82  Linux swap / Solaris
Partition 2 does not end on cylinder boundary.
/dev/vda3            3099      104023    50865920   83  Linux
Partition 3 does not end on cylinder boundary.

2. From the operating system, verify the swap size from command line utility “swapon -s” and “free -m“. The current swap size is 1GB :

[root@vps ~]# swapon -s
Filename                                Type            Size    Used    Priority
/dev/vda2                               partition       1048568 0       -1
[root@vps ~]# free -m
             total       used       free     shared    buffers     cached
Mem:          1877       1624        253          0        210        503
-/+ buffers/cache:        909        967
Swap:         1023          0       1023

3. Start Create the Swap file by determine the size of the new swap file and assign the swap file name. At a shell prompt as root, type the following dd command with count being equal to the desired block size. As an example i will add 2048MB as additional space size and assigned swap file name is /swapfile-ext.

[root@vps ~]# dd if=/dev/zero of=/swapfile-ext bs=1M count=2048
2048+0 records in
2048+0 records out
2147483648 bytes (2.1 GB) copied, 4.05978 s, 529 MB/s

4. Creating a linux swap area with mkswap command :

[root@vps ~]# mkswap /swapfile-ext
mkswap: /swapfile-ext: warning: don't erase bootbits sectors
        on whole disk. Use -f to force.
Setting up swapspace version 1, size = 2097148 KiB
no label, UUID=cc49d098-52e3-4fdf-8157-c40b23e00eef

5. Assign the correct permission to prevent swap space from world-readable :

[root@vps ~]# chmod 600 /swapfile-ext

6. Activatethe swap file immediately :

[root@vps ~]# swapon /swapfile-ext

7. Verify by viewing the output using “free -m” utility. 1GB plus 2GB equal to 3GB new swap size :

[root@vps ~]# free -m
             total       used       free     shared    buffers     cached
Mem:          1877       1801         76          0        137        765
-/+ buffers/cache:        897        979
Swap:         3071          0       3071

Verify by viewing the output using “swapon -s” utility

[root@vps ~]# swapon -s
Filename                                Type            Size    Used    Priority
/dev/vda2                               partition       1048568 556     -1
/swapfile-ext                           file            2097144 0       -2

8. To enable it at boot time, edit /etc/fstab to include the following entry:

/swapfile-ext          swap            swap    defaults        0 0

How to Remove/Uninstall Nginx Installed from Source on CentOS 6/RHEL 6

On this day, Nginx web server is reported to be a most popular and fastest in the internet if installed properly. But it should always be updated from time to time in order to maintain stability and high security so that is not exposed to hackers. For system administrators and web masters, it is routine to constantly update the software Nginx if the latest version is launched on their official website, nginx.org. In this tutorial , I will explain how to remove the Nginx that was installed from source on CentOS 6/RHEL 6.

1. Stop Nginx software :

[root@centos66 ~]# service nginx stop

2. Remove autostart for Nginx :

[root@centos66 ~]# chkconfig nginx off

3. Remove the Nginx sofware :

[root@centos66 ~]# rm -rf /usr/sbin/nginx
[root@centos66 ~]# rm -rf /etc/nginx
[root@centos66 ~]# rm -rf /etc/init.d/nginx

How to Prepare for Zimbra 8 Installation Prerequisites on RHEL 7/CentOS 7

Before we install Zimbra 8, I would recommend you to meet all of these requirements. Some software prerequisites should be installed first, then setup the DNS and MX records, provides internet access to and from the Zimbra server, install the latest patches on the server zimbra 8, properly configure iptables filter or firewalld service, turn off SELinux, turn off unnecessary services that can interfere with the process installation. As a guide, i have prepared a checklist or step -by-step reference to Zimbra e-mail administrator. These steps have been tested on RHEL 7/CentOS 7

1. Prepare for a fully qualified domain name ( FQDN ) for your Zimbra mail server mx record and ensure your domain is configured correctly.

2. Configure /etc/hosts and hostname.

3. Allow iptables to by-pass all zimbra ports.

4. Disabled SELINUX :

[root@centos7 ~]# vim /etc/sysconfig/selinux

Change enforcing to disabled :

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

5. Stop sendmail, postfix or any MTA service :

[root@centos7 ~]# systemctl stop postfix
[root@centos7 ~]# systemctl disable postfix
[root@centos7 ~]# systemctl stop sendmail
[root@centos7 ~]# systemctl disable sendmail

6. Make sure CentOS and RHEL is the latest :

[root@centos7 ~]# yum update -y

7. Install the required packages and libraries using the following command :

[root@centos7 ~]# yum install perl perl-core ntpl nmap sudo libidn gmp libaio libstdc++ unzip sysstat sqlite -y

How to Install Zimbra 8.6.0 on RHEL 7/CentOS 7

Zimbra 8.6.0 brings new features, improvements in Mail server and better web clients experience. Some that caught my attention was local lmtp client can communicate over ssl for mail server, better organization of shared folders for web client and the calendar now can run search on description for location or resources. You can get detailed information on this Release Notes. In this article, I will explain step by step how to install Zimbra 8.6.0 on RHEL 7 or CentOS 7. Starting with ZCS8.5 and later, there is now a DNS caching service available for installation. However, i have excluded zimbra-dnscache in the installation steps.

Prerequisites :
Prepare for Zimbra 8 Installation Prerequisites on RHEL 7/CentOS 7

1. Log in as root to the server and download Zimbra Zimbra Open Source Edition 8.6.0 using the command wget. Before that, please make sure your Zimbra server can access the internet :

wget https://files.zimbra.com/downloads/8.6.0_GA/zcs-8.6.0_GA_1153.RHEL7_64.20141215151110.tgz

2. Extract the downloaded tar file :

tar xzf zcs-8.6.0_GA_1153.RHEL7_64.20141215151110.tgz

3. cd to the directory where the extracted ZCS Open Source Edition :

cd zcs-8.6.0_GA_1153.RHEL7_64.20141215151110

4. Start the installation with the following command :

./install.sh --platform-override

Full installation steps :

./install.sh --platform-override

Operations logged to /tmp/install.log.14668
Checking for existing installation...
    zimbra-ldap...NOT FOUND
    zimbra-logger...NOT FOUND
    zimbra-mta...NOT FOUND
    zimbra-dnscache...NOT FOUND
    zimbra-snmp...NOT FOUND
    zimbra-store...NOT FOUND
    zimbra-apache...NOT FOUND
    zimbra-spell...NOT FOUND
    zimbra-convertd...NOT FOUND
    zimbra-memcached...NOT FOUND
    zimbra-proxy...NOT FOUND
    zimbra-archiving...NOT FOUND
    zimbra-core...NOT FOUND


PLEASE READ THIS AGREEMENT CAREFULLY BEFORE USING THE SOFTWARE.
ZIMBRA, INC. ("ZIMBRA") WILL ONLY LICENSE THIS SOFTWARE TO YOU IF YOU
FIRST ACCEPT THE TERMS OF THIS AGREEMENT. BY DOWNLOADING OR INSTALLING
THE SOFTWARE, OR USING THE PRODUCT, YOU ARE CONSENTING TO BE BOUND BY
THIS AGREEMENT. IF YOU DO NOT AGREE TO ALL OF THE TERMS OF THIS
AGREEMENT, THEN DO NOT DOWNLOAD, INSTALL OR USE THE PRODUCT.

License Terms for the Zimbra Collaboration Suite:
  http://www.zimbra.com/license/zimbra-public-eula-2-5.html



Do you agree with the terms of the software license agreement? [N] y



Checking for prerequisites...
     FOUND: NPTL
     FOUND: nmap-ncat-6.40-4
     FOUND: sudo-1.8.6p7-11
     FOUND: libidn-1.28-3
     FOUND: gmp-5.1.1-5
     FOUND: libaio-0.3.109-12
     FOUND: libstdc++-4.8.2-16.2
     FOUND: unzip-6.0-13
     FOUND: perl-core-5.16.3-283

Checking for suggested prerequisites...
     FOUND: perl-5.16.3
     FOUND: sysstat
     FOUND: sqlite
Prerequisite check complete.

Checking for installable packages

Found zimbra-core
Found zimbra-ldap
Found zimbra-logger
Found zimbra-mta
Found zimbra-dnscache
Found zimbra-snmp
Found zimbra-store
Found zimbra-apache
Found zimbra-spell
Found zimbra-memcached
Found zimbra-proxy


Select the packages to install

Install zimbra-ldap [Y]

Install zimbra-logger [Y]

Install zimbra-mta [Y]

Install zimbra-dnscache [Y] N

Install zimbra-snmp [Y]

Install zimbra-store [Y]

Install zimbra-apache [Y]

Install zimbra-spell [Y]

Install zimbra-memcached [Y]

Install zimbra-proxy [Y]
Checking required space for zimbra-core
Checking space for zimbra-store
Checking required packages for zimbra-store
zimbra-store package check complete.

Installing:
    zimbra-core
    zimbra-ldap
    zimbra-logger
    zimbra-mta
    zimbra-snmp
    zimbra-store
    zimbra-apache
    zimbra-spell
    zimbra-memcached
    zimbra-proxy

The system will be modified.  Continue? [N] Y

Removing /opt/zimbra
Removing zimbra crontab entry...done.
Cleaning up zimbra init scripts...done.
Cleaning up /etc/ld.so.conf...done.
Cleaning up /etc/security/limits.conf...done.

Finished removing Zimbra Collaboration Server.

Installing packages

    zimbra-core......zimbra-core-8.6.0_GA_1153.RHEL7_64-20141215151110.x86_64.rpm...done
    zimbra-ldap......zimbra-ldap-8.6.0_GA_1153.RHEL7_64-20141215151110.x86_64.rpm...done
    zimbra-logger......zimbra-logger-8.6.0_GA_1153.RHEL7_64-20141215151110.x86_64.rpm...done
    zimbra-mta......zimbra-mta-8.6.0_GA_1153.RHEL7_64-20141215151110.x86_64.rpm...done
    zimbra-snmp......zimbra-snmp-8.6.0_GA_1153.RHEL7_64-20141215151110.x86_64.rpm...done
    zimbra-store......zimbra-store-8.6.0_GA_1153.RHEL7_64-20141215151110.x86_64.rpm...done
    zimbra-apache......zimbra-apache-8.6.0_GA_1153.RHEL7_64-20141215151110.x86_64.rpm...done
    zimbra-spell......zimbra-spell-8.6.0_GA_1153.RHEL7_64-20141215151110.x86_64.rpm...done
    zimbra-memcached......zimbra-memcached-8.6.0_GA_1153.RHEL7_64-20141215151110.x86_64.rpm...done
    zimbra-proxy......zimbra-proxy-8.6.0_GA_1153.RHEL7_64-20141215151110.x86_64.rpm...done
Operations logged to /tmp/zmsetup01032015-084819.log
Installing LDAP configuration database...done.
Setting defaults...No results returned for A lookup of centos7.ehowstuff.local
Checked nameservers:
        192.168.0.70
No results returned for AAAA lookup of centos7.ehowstuff.local
Checked nameservers:
        192.168.0.70


DNS ERROR resolving centos7.ehowstuff.local
It is suggested that the hostname be resolvable via DNS
Change hostname [Yes]
Please enter the logical hostname for this host [centos7.ehowstuff.local] mail.example.com
No results returned for A lookup of mail.example.com
Checked nameservers:
        192.168.0.70


DNS ERROR resolving mail.example.com
It is suggested that the hostname be resolvable via DNS
Re-Enter hostname [Yes]
Please enter the logical hostname for this host [centos7.ehowstuff.local] mail.example.local


DNS ERROR resolving MX for mail.example.local
It is suggested that the domain name have an MX record configured in DNS
Change domain name? [Yes]
Create domain: [mail.example.local] example.local
        MX: mail.example.local (192.168.0.70)

        Interface: 127.0.0.1
        Interface: ::1
        Interface: 192.168.0.70
done.
Checking for port conflicts

Main menu

   1) Common Configuration:
   2) zimbra-ldap:                             Enabled
   3) zimbra-logger:                           Enabled
   4) zimbra-mta:                              Enabled
   5) zimbra-snmp:                             Enabled
   6) zimbra-store:                            Enabled
        +Create Admin User:                    yes
        +Admin user to create:                 admin@example.local
******* +Admin Password                        UNSET
        +Anti-virus quarantine user:           virus-quarantine.fsbv7fj6r0@example.local
        +Enable automated spam training:       yes
        +Spam training user:                   spam.7xlmrmrh3@example.local
        +Non-spam(Ham) training user:          ham.rt_1on1o@example.local
        +SMTP host:                            mail.example.local
        +Web server HTTP port:                 8080
        +Web server HTTPS port:                8443
        +Web server mode:                      https
        +IMAP server port:                     7143
        +IMAP server SSL port:                 7993
        +POP server port:                      7110
        +POP server SSL port:                  7995
        +Use spell check server:               yes
        +Spell server URL:                     http://mail.example.local:7780/aspell.php
        +Enable version update checks:         TRUE
        +Enable version update notifications:  TRUE
        +Version update notification email:    admin@centos7.ehowstuff.local
        +Version update source email:          admin@centos7.ehowstuff.local
        +Install mailstore (service webapp):   yes
        +Install UI (zimbra,zimbraAdmin webapps): yes

   7) zimbra-spell:                            Enabled
   8) zimbra-proxy:                            Enabled
   9) Enable VMware HA:                        no
  10) Default Class of Service Configuration:
   s) Save config to file
   x) Expand menu
   q) Quit

Address unconfigured (**) items  (? - help) 6


Store configuration

   1) Status:                                  Enabled
   2) Create Admin User:                       yes
   3) Admin user to create:                    admin@example.local
** 4) Admin Password                           UNSET
   5) Anti-virus quarantine user:              virus-quarantine.fsbv7fj6r0@example.local
   6) Enable automated spam training:          yes
   7) Spam training user:                      spam.7xlmrmrh3@example.local
   8) Non-spam(Ham) training user:             ham.rt_1on1o@example.local
   9) SMTP host:                               mail.example.local
  10) Web server HTTP port:                    8080
  11) Web server HTTPS port:                   8443
  12) Web server mode:                         https
  13) IMAP server port:                        7143
  14) IMAP server SSL port:                    7993
  15) POP server port:                         7110
  16) POP server SSL port:                     7995
  17) Use spell check server:                  yes
  18) Spell server URL:                        http://mail.example.local:7780/aspell.php
  19) Enable version update checks:            TRUE
  20) Enable version update notifications:     TRUE
  21) Version update notification email:       admin@centos7.ehowstuff.local
  22) Version update source email:             admin@centos7.ehowstuff.local
  23) Install mailstore (service webapp):      yes
  24) Install UI (zimbra,zimbraAdmin webapps): yes

Select, or 'r' for previous menu [r] 4

Password for admin@example.local (min 6 characters): [SBmeBXtA] password

Store configuration

   1) Status:                                  Enabled
   2) Create Admin User:                       yes
   3) Admin user to create:                    admin@example.local
   4) Admin Password                           set
   5) Anti-virus quarantine user:              virus-quarantine.fsbv7fj6r0@example.local
   6) Enable automated spam training:          yes
   7) Spam training user:                      spam.7xlmrmrh3@example.local
   8) Non-spam(Ham) training user:             ham.rt_1on1o@example.local
   9) SMTP host:                               mail.example.local
  10) Web server HTTP port:                    8080
  11) Web server HTTPS port:                   8443
  12) Web server mode:                         https
  13) IMAP server port:                        7143
  14) IMAP server SSL port:                    7993
  15) POP server port:                         7110
  16) POP server SSL port:                     7995
  17) Use spell check server:                  yes
  18) Spell server URL:                        http://mail.example.local:7780/aspell.php
  19) Enable version update checks:            TRUE
  20) Enable version update notifications:     TRUE
  21) Version update notification email:       admin@centos7.ehowstuff.local
  22) Version update source email:             admin@centos7.ehowstuff.local
  23) Install mailstore (service webapp):      yes
  24) Install UI (zimbra,zimbraAdmin webapps): yes

Select, or 'r' for previous menu [r] 21

Version update destination address: [admin@centos7.ehowstuff.local] admin@example.local

Store configuration

   1) Status:                                  Enabled
   2) Create Admin User:                       yes
   3) Admin user to create:                    admin@example.local
   4) Admin Password                           set
   5) Anti-virus quarantine user:              virus-quarantine.fsbv7fj6r0@example.local
   6) Enable automated spam training:          yes
   7) Spam training user:                      spam.7xlmrmrh3@example.local
   8) Non-spam(Ham) training user:             ham.rt_1on1o@example.local
   9) SMTP host:                               mail.example.local
  10) Web server HTTP port:                    8080
  11) Web server HTTPS port:                   8443
  12) Web server mode:                         https
  13) IMAP server port:                        7143
  14) IMAP server SSL port:                    7993
  15) POP server port:                         7110
  16) POP server SSL port:                     7995
  17) Use spell check server:                  yes
  18) Spell server URL:                        http://mail.example.local:7780/aspell.php
  19) Enable version update checks:            TRUE
  20) Enable version update notifications:     TRUE
  21) Version update notification email:       admin@example.local
  22) Version update source email:             admin@centos7.ehowstuff.local
  23) Install mailstore (service webapp):      yes
  24) Install UI (zimbra,zimbraAdmin webapps): yes

Select, or 'r' for previous menu [r] 22

Version update source address: [admin@centos7.ehowstuff.local] admin@example.local

Store configuration

   1) Status:                                  Enabled
   2) Create Admin User:                       yes
   3) Admin user to create:                    admin@example.local
   4) Admin Password                           set
   5) Anti-virus quarantine user:              virus-quarantine.fsbv7fj6r0@example.local
   6) Enable automated spam training:          yes
   7) Spam training user:                      spam.7xlmrmrh3@example.local
   8) Non-spam(Ham) training user:             ham.rt_1on1o@example.local
   9) SMTP host:                               mail.example.local
  10) Web server HTTP port:                    8080
  11) Web server HTTPS port:                   8443
  12) Web server mode:                         https
  13) IMAP server port:                        7143
  14) IMAP server SSL port:                    7993
  15) POP server port:                         7110
  16) POP server SSL port:                     7995
  17) Use spell check server:                  yes
  18) Spell server URL:                        http://mail.example.local:7780/aspell.php
  19) Enable version update checks:            TRUE
  20) Enable version update notifications:     TRUE
  21) Version update notification email:       admin@example.local
  22) Version update source email:             admin@example.local
  23) Install mailstore (service webapp):      yes
  24) Install UI (zimbra,zimbraAdmin webapps): yes

Select, or 'r' for previous menu [r] r

Main menu

   1) Common Configuration:
   2) zimbra-ldap:                             Enabled
   3) zimbra-logger:                           Enabled
   4) zimbra-mta:                              Enabled
   5) zimbra-snmp:                             Enabled
   6) zimbra-store:                            Enabled
   7) zimbra-spell:                            Enabled
   8) zimbra-proxy:                            Enabled
   9) Enable VMware HA:                        no
  10) Default Class of Service Configuration:
   s) Save config to file
   x) Expand menu
   q) Quit

*** CONFIGURATION COMPLETE - press 'a' to apply
Select from menu, or press 'a' to apply config (? - help) a
Save configuration data to a file? [Yes]
Save config in file: [/opt/zimbra/config.23920]
Saving config in /opt/zimbra/config.23920...done.
The system will be modified - continue? [No] yes
Operations logged to /tmp/zmsetup01032015-084819.log
Setting local config values...done.
Initializing core config...Setting up CA...done.
Deploying CA to /opt/zimbra/conf/ca ...done.
Creating SSL zimbra-store certificate...done.
Creating new zimbra-ldap SSL certificate...done.
Creating new zimbra-mta SSL certificate...done.
Creating new zimbra-proxy SSL certificate...done.
Installing mailboxd SSL certificates...done.
Installing MTA SSL certificates...done.
Installing LDAP SSL certificate...done.
Installing Proxy SSL certificate...done.
Initializing ldap...done.
Setting replication password...done.
Setting Postfix password...done.
Setting amavis password...done.
Setting nginx password...done.
Setting BES searcher  password...done.
Creating server entry for mail.example.local...done.
Setting Zimbra IP Mode...done.
Saving CA in ldap ...done.
Saving SSL Certificate in ldap ...done.
Setting spell check URL...done.
Setting service ports on mail.example.local...done.
Setting zimbraFeatureTasksEnabled=TRUE...done.
Setting zimbraFeatureBriefcasesEnabled=TRUE...done.
Setting TimeZone Preference...done.
Initializing mta config...done.
Setting services on mail.example.local...done.
Adding mail.example.local to zimbraMailHostPool in default COS...done.
Creating domain example.local...done.
Setting default domain name...done.
Creating domain example.local...already exists.
Creating admin account admin@example.local...done.
Creating root alias...done.
Creating postmaster alias...done.
Creating user spam.7xlmrmrh3@example.local...done.
Creating user ham.rt_1on1o@example.local...done.
Creating user virus-quarantine.fsbv7fj6r0@example.local...done.
Setting spam training and Anti-virus quarantine accounts...done.
Initializing store sql database...done.
Setting zimbraSmtpHostname for mail.example.local...done.
Configuring SNMP...done.
Setting up syslog.conf...done.
Starting servers...done.
Installing common zimlets...
        com_zimbra_proxy_config...done.
        com_zimbra_mailarchive...done.
        com_zimbra_attachmail...done.
        com_zimbra_url...done.
        com_zimbra_phone...done.
        com_zimbra_date...done.
        com_zimbra_ymemoticons...done.
        com_zimbra_clientuploader...done.
        com_zimbra_srchhighlighter...done.
        com_zimbra_tooltip...done.
        com_zimbra_webex...done.
        com_zimbra_bulkprovision...done.
        com_zimbra_email...done.
        com_zimbra_adminversioncheck...done.
        com_zimbra_cert_manager...done.
        com_zimbra_viewmail...done.
        com_zimbra_attachcontacts...done.
Finished installing common zimlets.
Restarting mailboxd...done.
Creating galsync account for default domain...done.

You have the option of notifying Zimbra of your installation.
This helps us to track the uptake of the Zimbra Collaboration Server.
The only information that will be transmitted is:
        The VERSION of zcs installed (8.6.0_GA_1153_RHEL7_64)
        The ADMIN EMAIL ADDRESS created (admin@example.local)

Notify Zimbra of your installation? [Yes] no
Notification skipped
Setting up zimbra crontab...done.


Moving /tmp/zmsetup01032015-084819.log to /opt/zimbra/log


Configuration complete - press return to exit

5. Start zimbra services :

su - zimbra
zmcontrol start