How to Change RunLevel on CentOS 7 / RHEL 7

Old method to change the runlevel via /etc/inittab in Redhat Enterprise Linux version and CentOS server has become obsolete on RHEL 7 and CentOS 7. This latest Linux operating system uses systemd system management daemon and relies on systemctl command in order to change the runlevel. RunLevel is set with linking to /etc/systemd/system/default.target. Please make sure you have already install Gnome GUI before you proceed to change runlevel.

1. Check the current runlevel :

# runlevel
N 3

or

# systemctl get-default
multi-user.target

2. We can display the default.target by using list command :

# ll /etc/systemd/system/default.target
lrwxrwxrwx. 1 root root 37 Sep  1  2014 /etc/systemd/system/default.target -> /lib/systemd/system/multi-user.target

3. For example to list all currently loaded targets :

# systemctl list-units -t target
UNIT                LOAD   ACTIVE SUB    DESCRIPTION
basic.target        loaded active active Basic System
cryptsetup.target   loaded active active Encrypted Volumes
getty.target        loaded active active Login Prompts
local-fs-pre.target loaded active active Local File Systems (Pre)
local-fs.target     loaded active active Local File Systems
multi-user.target   loaded active active Multi-User System
network.target      loaded active active Network
paths.target        loaded active active Paths
remote-fs.target    loaded active active Remote File Systems
slices.target       loaded active active Slices
sockets.target      loaded active active Sockets
swap.target         loaded active active Swap
sysinit.target      loaded active active System Initialization
timers.target       loaded active active Timers

LOAD   = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB    = The low-level unit activation state, values depend on unit type.

14 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.

4. Type the following command to change the RunLevel to Graphical-login :

# systemctl set-default graphical.target
rm '/etc/systemd/system/default.target'
ln -s '/usr/lib/systemd/system/graphical.target' '/etc/systemd/system/default.target'

5. Verify the changed runlevel :

# runlevel
N 5

or

# systemctl get-default
graphical.target

6. Reboot the server to login to GNOME gui.

redhat-banner

How to Install JAVA 8 (JDK 8u45) on CentOS 6 / CentOS 7

The JDK is a development tool for building applications, applets, and components using the Java programming language . It includes a useful tool for developing and testing programs written in the Java programming language and runs on the Java platform. You can go through this document to know more about new enhancement of Java JDK 8. This post describe how to install JAVA 8 (JDK 8u45) on CentOS 6 and CentOS 7 from rpm package.

1. Download Oracle Java 8 rpm from official website (64 bit):

# wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u45-b14/jdk-8u45-linux-x64.rpm"

2. Install Oracle Java 8 :

# rpm -ivh jdk-8u45-linux-x64.rpm
Preparing...                          ################################# [100%]
Updating / installing...
   1:jdk1.8.0_45-2000:1.8.0_45-fcs    ################################# [100%]
Unpacking JAR files...
        rt.jar...
        jsse.jar...
        charsets.jar...
        tools.jar...
        localedata.jar...
        jfxrt.jar...
        plugin.jar...
        javaws.jar...
        deploy.jar...

3. Verify the Oracle Java version :

# java -version
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

How To Get Email Alerts for SSH Login on Linux Server

Enable SSH server on a virtual private server (VPS) will expose the server to the internet and provide opportunities for hacking activities, especially when VPS still using root as a primary access. VPS should be configured with a email alert automatically to each successful login attempts via SSH server . VPS server owner shall be notified of any SSH server access log, such as who, when and which source IP address. This is an important security concern for server owners to protect the server from unknown login attempts. This is because if hackers use brute force to log into your VPS via ssh then it can be very dangerous. In this article, I will explain how to set up an email alert to all SSH login users on linux CentOS 6, CentOS 7, RHEL 6 and RHEL 7.

1. Login to your server as root user :

2. Configure at alert from source global definitions (/etc/bashrc). This will enabled for root and normal users :

[root@vps ~]# vi /etc/bashrc

Add the following at the bottom of the files.

echo 'ALERT - Root Shell Access (vps.ehowstuff.com) on:' `date` `who` | mail -s "Alert: Root Access from `who | cut -d'(' -f2 | cut -d')' -f1`" recipient@gmail.com

3. Optionally you can enable alert for root only :

[root@vps ~]# vi .bashrc

Add the following at the bottom of /root/.bashrc :

echo 'ALERT - Root Shell Access (vps.ehowstuff.com) on:' `date` `who` | mail -s "Alert: Root Access from `who | cut -d'(' -f2 | cut -d')' -f1`" recipient@gmail.com

Full Configuration file example :

# .bashrc

# User specific aliases and functions

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi
echo 'ALERT - Root Shell Access (vps.ehowstuff.com) on:' `date` `who` | mail -s "Alert: Root Access from `who | cut -d'(' -f2 | cut -d')' -f1`" recipient@gmail.com

4. Optionally you can enable alert for specify normal user (e.g skytech ) :

[root@vps ~]# vi /home/skytech/.bashrc

Add the following at the bottom of /home/skytech/.bashrc :

echo 'ALERT - Root Shell Access (vps.ehowstuff.com) on:' `date` `who` | mail -s "Alert: Root Access from `who | cut -d'(' -f2 | cut -d')' -f1`" recipient@gmail.com

fail2ban-security

How to Disable Autostart for a Service at boot on Linux CentOS 7 / RHEL 7

Question : Due to some reason, I had to stop a service on linux CentOS 7. But when i restarted the server, the service starts again automatically. How to stop or disabled auto start services at boot ?

Answer : Just issue the following command to disabled auto start for particular service.

Syntax :

sudo systemctl disable <service-named>.service

Example :

[root@centos7 ~]# sudo systemctl disable named-chroot.service
rm '/etc/systemd/system/multi-user.target.wants/named-chroot.service'

How to Setup Zimbra Collaboration Suite 8.0.8 on CentOS 7.0

Zimbra Collaboration Suite (ZCS) is a groupware product created by Zimbra, Inc. Zimbra Collaboration Open Source Edition version 8.0.8 is available for us to test, evaluate, deploy, customize and improve. I have prepared the steps to install and configure Zimbra Collaboration Suite 8.0.8 on CentOS 7.0. There are new features and enhancements available in the ZCS 8.0.8 Open Source release as below :

Major Issues Fixed for 8.0.8

Admin Console:
• Improved admin console usability when returned results are over the limit.
• GetEffectiveRightRequest in searchdirectory request loading improved.
• Fixed issued causing ZCS 8.0.7 Patch 1 breaking delegated admin functionality.
• Delegated admin ability to edit distribution list fixed.
• Delegated admin ability to edit account fixed.
• Delegated admin ability to edit resources fixed.

Backup and Restore:
• Folders now accessible after a restore of users account.

Briefcase – Server:
• Ability to edit Zimbra Document in Briefcase.
• Share URL correct when selecting files in shared briefcase.

IMAP/POP Server:
• Handling translation of IMAP metacharacters into regexes no longer causes high server load when IMAP LIST commands are issued.

Install and Upgrade:
• Updated EULA.
• MySQL version upgrade is performed prior to checking if upgrade is possible.
• Fixed issue during replication and MMR mode configuration causing masters to go into endless loop.

Localization:
• Fixed typo in ZsMsg_fr.properties results in the share access URL not being embedded in the email.

Mail – MTA/Spam/Virus:
• zmmtactl restart is an option post 8.0.7 upgrade.

Mail – Server:
• Fixed issue causing zmmboxmove to exhaust LDAP connection pool during migrations.

Steps to Install and Configure ZCS 8.0.8 :

1. Prepare for Fully qualified domain name (FQDN) for your zimbra mail server and make sure your domain mx record in configured properly.

2. Configure /etc/hosts and hostname.

3. Allow iptables to listen 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. 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

7. Log in as root to the Zimbra server and cd to the directory where the ZCS Open Source Edition 8.0.8 archive tar file is saved. To unpack the file, type the following commands:

[root@centos7 ~]# tar xzvf zcs-8.0.8_GA_6184.RHEL7_64.20140925165850.tgz

8. Go to extracted directory and start the installation, do replace example.local to your own domain :

[root@centos7 ~]# cd zcs-8.0.8_GA_6184.RHEL7_64.20140925165850
[root@centos7 zcs-8.0.8_GA_6184.RHEL7_64.20140925165850]# ./install.sh --platform-override

Operations logged to /tmp/install.log.3552
Checking for existing installation...
    zimbra-ldap...NOT FOUND
    zimbra-logger...NOT FOUND
    zimbra-mta...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-cluster...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


..
..
..

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-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-snmp [Y]

Install zimbra-store [Y]

Install zimbra-apache [Y]

Install zimbra-spell [Y]

Install zimbra-memcached [N]

Install zimbra-proxy [N]
Checking required space for zimbra-core
Checking space for zimbra-store

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

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.0.8_GA_6184.RHEL7_64-20140925165850.x86_64.rpm...done
    zimbra-ldap......zimbra-ldap-8.0.8_GA_6184.RHEL7_64-20140925165850.x86_64.rpm...done
    zimbra-logger......zimbra-logger-8.0.8_GA_6184.RHEL7_64-20140925165850.x86_64.rpm...done
    zimbra-mta......zimbra-mta-8.0.8_GA_6184.RHEL7_64-20140925165850.x86_64.rpm...done
    zimbra-snmp......zimbra-snmp-8.0.8_GA_6184.RHEL7_64-20140925165850.x86_64.rpm...done
    zimbra-store......zimbra-store-8.0.8_GA_6184.RHEL7_64-20140925165850.x86_64.rpm...done
    zimbra-apache......zimbra-apache-8.0.8_GA_6184.RHEL7_64-20140925165850.x86_64.rpm...done
    zimbra-spell......zimbra-spell-8.0.8_GA_6184.RHEL7_64-20140925165850.x86_64.rpm...done
Operations logged to /tmp/zmsetup.11132014-000729.log
Installing LDAP configuration database...done.
Setting defaults...No results returned for A lookup of centos7.ehowstuff.local
Checked nameservers:
        127.0.0.1
No results returned for AAAA lookup of centos7.ehowstuff.local
Checked nameservers:
        127.0.0.1


DNS ERROR resolving centos7.ehowstuff.local
It is suggested that the hostname be resolvable via DNS
Change hostname [Yes] 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-store:                            Enabled
        +Create Admin User:                    yes
        +Admin user to create:                 admin@example.local
******* +Admin Password                        UNSET
        +Anti-virus quarantine user:           virus-quarantine.60bpggjwr@example.local
        +Enable automated spam training:       yes
        +Spam training user:                   spam.zuum3_i3g@example.local
        +Non-spam(Ham) training user:          ham.sblunut9k@example.local
        +SMTP host:                            mail.example.local
        +Web server HTTP port:                 80
        +Web server HTTPS port:                443
        +Web server mode:                      https
        +IMAP server port:                     143
        +IMAP server SSL port:                 993
        +POP server port:                      110
        +POP server SSL port:                  995
        +Use spell check server:               yes
        +Spell server URL:                     http://mail.example.local:7780/aspell.php
        +Configure for use with mail proxy:    FALSE
        +Configure for use with web proxy:     FALSE
        +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

   4) zimbra-mta:                              Enabled
   5) zimbra-snmp:                             Enabled
   6) zimbra-logger:                           Enabled
   7) zimbra-spell:                            Enabled
   8) Enable VMware HA:                        no
   9) Default Class of Service Configuration:
   r) Start servers after configuration        yes
   s) Save config to file
   x) Expand menu
   q) Quit

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


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.60bpggjwr@example.local
   6) Enable automated spam training:          yes
   7) Spam training user:                      spam.zuum3_i3g@example.local
   8) Non-spam(Ham) training user:             ham.sblunut9k@example.local
   9) SMTP host:                               mail.example.local
  10) Web server HTTP port:                    80
  11) Web server HTTPS port:                   443
  12) Web server mode:                         https
  13) IMAP server port:                        143
  14) IMAP server SSL port:                    993
  15) POP server port:                         110
  16) POP server SSL port:                     995
  17) Use spell check server:                  yes
  18) Spell server URL:                        http://mail.example.local:7780/aspell.php
  19) Configure for use with mail proxy:       FALSE
  20) Configure for use with web proxy:        FALSE
  21) Enable version update checks:            TRUE
  22) Enable version update notifications:     TRUE
  23) Version update notification email:       admin@centos7.ehowstuff.local
  24) Version update source email:             admin@centos7.ehowstuff.local

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

Password for admin@example.local (min 6 characters): [9j08ZCNI] 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.60bpggjwr@example.local
   6) Enable automated spam training:          yes
   7) Spam training user:                      spam.zuum3_i3g@example.local
   8) Non-spam(Ham) training user:             ham.sblunut9k@example.local
   9) SMTP host:                               mail.example.local
  10) Web server HTTP port:                    80
  11) Web server HTTPS port:                   443
  12) Web server mode:                         https
  13) IMAP server port:                        143
  14) IMAP server SSL port:                    993
  15) POP server port:                         110
  16) POP server SSL port:                     995
  17) Use spell check server:                  yes
  18) Spell server URL:                        http://mail.example.local:7780/aspell.php
  19) Configure for use with mail proxy:       FALSE
  20) Configure for use with web proxy:        FALSE
  21) Enable version update checks:            TRUE
  22) Enable version update notifications:     TRUE
  23) Version update notification email:       admin@centos7.ehowstuff.local
  24) Version update source email:             admin@centos7.ehowstuff.local

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

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.60bpggjwr@example.local
   6) Enable automated spam training:          yes
   7) Spam training user:                      spam.zuum3_i3g@example.local
   8) Non-spam(Ham) training user:             ham.sblunut9k@example.local
   9) SMTP host:                               mail.example.local
  10) Web server HTTP port:                    80
  11) Web server HTTPS port:                   443
  12) Web server mode:                         https
  13) IMAP server port:                        143
  14) IMAP server SSL port:                    993
  15) POP server port:                         110
  16) POP server SSL port:                     995
  17) Use spell check server:                  yes
  18) Spell server URL:                        http://mail.example.local:7780/aspell.php
  19) Configure for use with mail proxy:       FALSE
  20) Configure for use with web proxy:        FALSE
  21) Enable version update checks:            TRUE
  22) Enable version update notifications:     TRUE
  23) Version update notification email:       admin@example.local
  24) Version update source email:             admin@centos7.ehowstuff.local

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

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.60bpggjwr@example.local
   6) Enable automated spam training:          yes
   7) Spam training user:                      spam.zuum3_i3g@example.local
   8) Non-spam(Ham) training user:             ham.sblunut9k@example.local
   9) SMTP host:                               mail.example.local
  10) Web server HTTP port:                    80
  11) Web server HTTPS port:                   443
  12) Web server mode:                         https
  13) IMAP server port:                        143
  14) IMAP server SSL port:                    993
  15) POP server port:                         110
  16) POP server SSL port:                     995
  17) Use spell check server:                  yes
  18) Spell server URL:                        http://mail.example.local:7780/aspell.php
  19) Configure for use with mail proxy:       FALSE
  20) Configure for use with web proxy:        FALSE
  21) Enable version update checks:            TRUE
  22) Enable version update notifications:     TRUE
  23) Version update notification email:       admin@example.local
  24) Version update source email:             admin@example.local

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

Main menu

   1) Common Configuration:
   2) zimbra-ldap:                             Enabled
   3) zimbra-store:                            Enabled
   4) zimbra-mta:                              Enabled
   5) zimbra-snmp:                             Enabled
   6) zimbra-logger:                           Enabled
   7) zimbra-spell:                            Enabled
   8) Enable VMware HA:                        no
   9) Default Class of Service Configuration:
   r) Start servers after configuration        yes
   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.10476]
Saving config in /opt/zimbra/config.10476...done.
The system will be modified - continue? [No] yes
Operations logged to /tmp/zmsetup.11132014-000729.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.
Installing mailboxd SSL certificates...done.
Installing MTA SSL certificates...done.
Installing LDAP 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.
Adding mail.example.local to zimbraMailHostPool in default COS...done.
Setting zimbraFeatureTasksEnabled=TRUE...done.
Setting zimbraFeatureBriefcasesEnabled=FALSE...done.
Setting MTA auth host...done.
Setting TimeZone Preference...done.
Initializing mta config...done.
Setting services on mail.example.local...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.zuum3_i3g@example.local...done.
Creating user ham.sblunut9k@example.local...done.
Creating user virus-quarantine.60bpggjwr@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_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.0.8_GA_6184_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/zmsetup.11132014-000729.log to /opt/zimbra/log


Configuration complete - press return to exit

9. Restart the zimbra service :

[zimbra@centos7 ~]$ zmcontrol restart

What are the Differences Between the Open-VM-Tools package and VMware Tools package

Question.
Many of the system administrator asked whether they need to install Open-VM-Tools package or VMware Tools package that ships with ESX/ESXi VMware products.

Answer.
VMware Tools is a suite of utilities that enhances the performance of the virtual machine’s guest operating system and improves management of the virtual machine.

How to Install Vmware-tools for windows
How to Install Vmware-tools for Linux

The Open Virtual Machine Tools (open-vm-tools) are the open source implementation of VMware Tools. They consists of a suite of virtualization utilities that improves the functionality, administration, and management of virtual machines within a VMware environment. As virtualization technology rapidly becomes mainstream, each virtualization solution provider implements their own set of tools and utilities to supplement the guest virtual machine. The primary purpose for open-vm-tools is to enable operating system vendors and/or communities and virtual appliance vendors to bundle VMware Tools into their product releases.

open-vm-tools is available with these operating systems:

  • Fedora 19 and later releases
  • Debian 7.x and later releases
  • openSUSE 11.x and later releases
  • Recent Ubuntu releases (12.04 LTS, 13.10 and later)
  • Red Hat Enterprise Linux 7.0 and later releases
  • SUSE Linux Enterprise 12 – available Q4 2014
  • CentOS 7
  • Oracle Linux 7

Note : If your OS is not listed above, i would suggest you to install VMware Tools package that ships with ESX/ESXi VMware products.

VMware support policy

  • VMware recommends using open-vm-tools redistributed by operating system vendors.
  • VMware fully supports virtual machines that include open-vm-tools redistributed by operating system vendors, which is done in collaboration with the OS vendor and OS communities. However, the operating system release must be published as certified by the specific VMware product in the online VMware Compatibility Guide.
  • VMware provides assistance to operating system vendors and communities with the integration of open-vm-tools with OS releases.
  • VMware fully supports virtual appliances that include open-vm-tools, which is done in collaboration with the virtual appliance vendor.
  • VMware does not recommend removing open-vm-tools redistributed by operating system vendors.

References :
http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2073803
http://partnerweb.vmware.com/GOSIG/CentOS_7.html

How to Change Hostname on CentOS 7.0/RHEL 7.0

Q. I have CentOS 7.0 virtual private server, but the default hostname still localhost.localdomain. How do i change the hostname to my prefer hostname or FQDN ?

[root@localhost ~]# hostname
localhost.localdomain

A. There are four(4) method to change the hostname on CentOS 7.0/RHEL 7.0.

Method 1
1. Login to your VPS as a root.
2. Type hostname followed by the new hostname.

As example :

[root@localhost ~]# hostname mynewhostname.local
[root@localhost ~]# hostname
mynewhostname.local

Note : But the following changes will be lost after reboot.

Method 2
1. Login to your VPS as a root.
2. Use hostnamectl set-hostname command to change the current hostname :

As example :

[root@localhost ~]# hostnamectl set-hostname ns1.e-coupondeals.com

3. Restart the systemd-hostnamed daemon to reflect the changes permanently :

[root@localhost ~]# systemctl restart systemd-hostnamed

4. Check the new hostname :

[root@localhost ~]# hostnamectl status
   Static hostname: ns1.e-coupondeals.com
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 72863e389b584a4dab36fae7f3bffda2
           Boot ID: 1cf2f4b5478649549916c0a5bd5d2414
    Virtualization: xen
  Operating System: CentOS Linux 7 (Core)
       CPE OS Name: cpe:/o:centos:centos:7
            Kernel: Linux 3.15.4-x86_64-linode45
      Architecture: x86_64

Method 3
1. Login to your VPS as a root.
2. Modify /etc/hostname using your favourite text editor replace localhost.localdomain to your most prefered hostname or FQDN:

[root@ns1 ~]# vi /etc/hostname

Edit to the following as example :

ns1.e-coupondeals.com

3. Try to login again by opening another putty session :

[root@ns1 ~]# hostname
ns1.e-coupondeals.com

Method 4
1. Login to your VPS as a root.
2. Type nmtui in the terminal:

[root@ns1 ~]# nmtui

3. Text user interface will appear :
centos7-change hostname1

4. Using the arrow keys select Set system hostname and use tab to select OK.
centos7-change hostname2

5. Confirmation message will appear, Press OK to complete.

How to Configure Static IP Address on RHEL 7.0/CentOS 7.0/Oracle Linux 7

This article will describe the procedure to configure static Ip address on RHEL 7/CentOS 7/Oracle Linux 7 minimal installation. Network interface configuration files control the software interfaces for individual network devices. As the system boots, it uses these files to determine what interfaces to bring up and how to configure them. These files are usually named ifcfg-name. Since the release of RHEL 7, redhat come with the new naming scheme for the network devices. In RHEL7/CentOS7/Oracle Linux 7, the default network interface name is based on firmware, topology, and location information. In this procedure, the network interface name is ifcfg-ens160.

1. Original ip configuration :

# cat /etc/sysconfig/network-scripts/ifcfg-ens160
HWADDR=00:02:22:G4:EE:FF
TYPE=Ethernet
BOOTPROTO=dhcp
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=ens160
UUID=34796933-af4b-4a41-8287-6e57ac131234
ONBOOT=no

2. Please change BOOTPROTO to static or none, ONBOOT statement is set on YES and don’t change HWADDR and UUID values provided by default. Please add IPADDR, NETMASK, GATEWAY and DNS1 line as below :

HWADDR=00:02:22:G4:EE:FF
TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=ens160
UUID=34796933-af4b-4a41-8287-6e57ac131234
ONBOOT=yes
IPADDR=192.168.0.70
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
DNS1=8.8.8.8

3. Restart network interface to take effect :

# systemctl restart network

or

# service network restart
Restarting network (via systemctl):                        [  OK  ]

4. Run ifconfig to display the ip address. If your ifconfig command is not found, please follow this instruction to install it.(How to Install ifconfig and netstat on RHEL 7.0/CentOS 7.0):

# ifconfig
ens160: flags=4163  mtu 1500
        inet 192.168.0.70  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::20c:29ff:feba:3efe  prefixlen 64  scopeid 0x20
        ether 00:0c:29:ba:3e:fe  txqueuelen 1000  (Ethernet)
        RX packets 20775  bytes 1455662 (1.3 MiB)
        RX errors 0  dropped 40  overruns 0  frame 0
        TX packets 1289  bytes 179594 (175.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10
        loop  txqueuelen 0  (Local Loopback)
        RX packets 8  bytes 656 (656.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 8  bytes 656 (656.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

How to Install ifconfig and netstat on RHEL 7.0/CentOS 7.0/Oracle Linux 7

Question :
I have just setup on RHEL 7.0/CentOS 7.0/Oracle Linux 7 minimal server installation but i notice ifconfig and netstat command not found. How to make those command available ?

Solution :
By default, ifconfig and netstat utility is not installed on RHEL 7.0/CentOS 7.0/Oracle Linux 7 minimal server installation. You need to install net-tools utility manually, this include ifconfig and netstat command.

# ifconfig
-bash: ifconfig: command not found

1. Run installation command :

# yum install net-tools -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.biz.net.id
 * extras: mirror.smartmedia.net.id
 * updates: centos.biz.net.id
Resolving Dependencies
--> Running transaction check
---> Package net-tools.x86_64 0:2.0-0.17.20131004git.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package              Arch              Version                               Repository       Size
====================================================================================================
Installing:
 net-tools            x86_64            2.0-0.17.20131004git.el7              base            304 k

Transaction Summary
====================================================================================================
Install  1 Package

Total download size: 304 k
Installed size: 917 k
Downloading packages:
warning: /var/cache/yum/x86_64/7/base/packages/net-tools-2.0-0.17.20131004git.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Public key for net-tools-2.0-0.17.20131004git.el7.x86_64.rpm is not installed
net-tools-2.0-0.17.20131004git.el7.x86_64.rpm                                | 304 kB  00:00:10
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Importing GPG key 0xF4A80EB5:
 Userid     : "CentOS-7 Key (CentOS 7 Official Signing Key) "
 Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
 Package    : centos-release-7-0.1406.el7.centos.2.3.x86_64 (@anaconda)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : net-tools-2.0-0.17.20131004git.el7.x86_64                                        1/1
  Verifying  : net-tools-2.0-0.17.20131004git.el7.x86_64                                        1/1

Installed:
  net-tools.x86_64 0:2.0-0.17.20131004git.el7

Complete!

2. Try ifconfig command :

# ifconfig
ens160: flags=4163  mtu 1500
        inet 192.168.0.18  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::20c:29ff:feba:3efe  prefixlen 64  scopeid 0x20
        ether 00:0c:29:ba:3e:fe  txqueuelen 1000  (Ethernet)
        RX packets 10357  bytes 9459534 (9.0 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 8239  bytes 2341646 (2.2 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10
        loop  txqueuelen 0  (Local Loopback)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

3. Try netstat command :

# netstat -plunt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1919/master
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1318/sshd
tcp6       0      0 ::1:25                  :::*                    LISTEN      1919/master
tcp6       0      0 :::22                   :::*                    LISTEN      1318/sshd
udp        0      0 0.0.0.0:47445           0.0.0.0:*                           572/avahi-daemon: r
udp        0      0 0.0.0.0:5353            0.0.0.0:*                           572/avahi-daemon: r

How to Disable SELinux on RHEL 7/CentOS 7/Oracle Linux 7

Security-Enhanced Linux (SELinux) is an implementation of security policies for operating systems that provides a mechanism to support and help control access in the linux kernel. On Red Hat Enterprise Linux 7 (RHEL 7), CentOS 7 and Oracle Linux 7 (OL7), SELinux services were installed by default. The following tutorial will show you the basic steps to permanently disable SELinux on RHEL 7, CentOS 7 and OL7.

1. Check SELinux status :

[root@centos7 ~]# sestatus
SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   enforcing
Mode from config file:          enforcing
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Max kernel policy version:      28

2. Open selinux configuration file :

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

3. Change “SELINUX=enforcing” to “SELINUX=disabled” and save the configuration file :

# 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

4. Reboot the server to take effect :

[root@centos7 ~]# reboot

5. After reboot, you can verify the status of SELinux. Issue “sestatus” command to verify that SELinux permanently disabled:

[root@centos7 ~]# sestatus
SELinux status:                 disabled

How to Check Swap Space/Memory/Size on Linux VPS Server

Linux uses swap space as a back up to its physical memory with an overflow area. Swapping is necessary for two important reasons. First, when the system requires more memory than is physically available, the swap space will gives memory to the current application (process) that needs the memory immediately. Second, a significant number of the pages used by an application during its startup phase may only be used for initialization and then never used again. The system can swap out those pages and free the memory for other applications or even for the disk cache. All these four commands will show the allocated swap disk or disks, if any and have been tested on linux CentOS 6, CentOS 7, RHEL 6 and RHEL 7. Your output should look like the followings :

1. Check Swap Space/Memory/Size using “swapon -s

[root@centos63 ~]# swapon -s
Filename                                Type            Size    Used    Priority
/dev/dm-1                               partition       2064376 0       -1

2. Check Swap Space/Memory/Size using “cat /proc/swaps

[root@centos63 ~]# cat /proc/swaps
Filename                                Type            Size    Used    Priority
/dev/dm-1                               partition       2064376 0       -1

3. Check Swap Space/Memory/Size using “free -m

[root@centos63 ~]# free -m
             total       used       free     shared    buffers     cached
Mem:          1006        121        885          0          7         71
-/+ buffers/cache:         41        964
Swap:         2015          0       2015

4. Check Swap Space/Memory/Size using “cat /proc/meminfo | grep Swap

[root@centos63 ~]# cat /proc/meminfo | grep Swap
SwapCached:            0 kB
SwapTotal:       2064376 kB
SwapFree:        2064376 kB

How to Mount CDROM Media on CentOS 5/CentOS 6/CentOS 7

Question :
How to mount CDROM/DVDROM media on linux CentOS server ?

Solution :
In certain situations, system administrators will need to mount cdrom containing the installer or data on linux CentOS or RHEL. Once cdrom mounted, they can access the data in the media discs directly. For reference, here is the easy way to do it through the command line on Linux CentOS 5 or CentOS 6 or CentOS 7 :

Note : This example will mount the device /dev/cdrom to /mnt.

[root@centos6 ~]# mount /dev/cdrom /mnt

Examples :

[root@centos6 ~]# mount /dev/cdrom /mnt
mount: block device /dev/sr0 is write-protected, mounting read-only