How to Setup Samba SWAT on CentOS 6.5

Samba service can provides files haring and printing services to its clients. System administrator can install SWAT in order to configure samba and perform samba administration from the web browser. In this post i will show simple steps to get Samba SWAT running on your CentOS 6.5 server. With SWAT, you can easily manage your samba server without messing with command line. You just need to install xinetd together with samba-SWAT software.

1. Install samba-swat and xinetd :

[root@samba ~]# yum install samba-swat xinetd -y

2. Software install will be as below :

====================================================================================================
 Package                        Arch            Version                      Repository        Size
====================================================================================================
Installing:
 samba-swat                     x86_64          3.6.9-167.el6_5              updates          7.3 M
Installing for dependencies:
 libtalloc                      x86_64          2.0.7-2.el6                  base              20 k
 libtdb                         x86_64          1.2.10-1.el6                 base              33 k
 libtevent                      x86_64          0.9.18-3.el6                 base              26 k
 samba                          x86_64          3.6.9-167.el6_5              updates          5.0 M
 samba-common                   x86_64          3.6.9-167.el6_5              updates           10 M
 samba-winbind                  x86_64          3.6.9-167.el6_5              updates          2.1 M
 samba-winbind-clients          x86_64          3.6.9-167.el6_5              updates          2.0 M
 xinetd                         x86_64          2:2.3.14-39.el6_4            base             121 k

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

Total download size: 27 M
Installed size: 85 M

3. Add 192.168.0.0/24 network and enable swat by set ‘disable’ to ‘no’.

# default: off
# description: SWAT is the Samba Web Admin Tool. Use swat \
#              to configure your Samba server. To use SWAT, \
#              connect to port 901 with your favorite web browser.
service swat
{
        port            = 901
        socket_type     = stream
        wait            = no
        only_from       = 127.0.0.1 192.168.0.0/16
        user            = root
        server          = /usr/sbin/swat
        log_on_failure  += USERID
        disable         = no
}

4. Start the xinetd service :

[root@samba ~]# service xinetd start
Starting xinetd:                                           [  OK  ]

5. Make xinetd auto start at boot :

[root@samba ~]# chkconfig xinetd on

6. Access to [http://(server’s IP address):901] and enter root login password.

How to Change 389 LDAP Password using PHP Scripting

Change 389 LDAP PasswordThis article has been prepared for the purpose of future reference for system administrator. It will describe how to change 389 ldap password using PHP scripting. In order to use this PHP script, you just need to change few parameters and also tested on CentOS 6.5. 389 LDAP Directory is an enterprise-class Open Source LDAP server for GNU/Linux. It is hardened by real-world use, is full-featured, supports multi-master replication, and already handles many of the largest LDAP deployments in the world.

Steps to Change 389 LDAP Password using PHP Scripting

1. Make sure your 389 ldap has been configure correctly :
2. Install php-ldap package into your apache server :

[root@ldapmaster-11 ~]# yum install php-ldap -y

3. Create changepassword.php file and put it into your apache root directory :

[root@ldapmaster-11 ~]# vim /var/www/html/changepassword.php

Modify the $server and $dn in .php file :

<?php
$message = array();

function changePassword($user,$oldPassword,$newPassword,$newPasswordCnf){
  global $message;

  $server = "localhost";
  $dn = "dc=ehowstuff,dc=local";
  $userid = $user;

  $user = "uid=".$user.",".$dn;
  error_reporting(0);
  ldap_connect($server);
  $con = ldap_connect($server);
  ldap_set_option($con, LDAP_OPT_PROTOCOL_VERSION, 3);

  // bind anon and find user by uid
  $sr = ldap_search($con,$dn,"(uid=*)");
  $records = ldap_get_entries($con, $sr);

  $message[] = "Username: " . $userid;
  //$message[] = "DN: " . $user;
  //$message[] = "Current Pass: " . $oldPassword;
  //$message[] = "New Pass: " . $newPassword;

  /* try to bind as that user */
  if (ldap_bind($con, $user, $oldPassword) === false) {
    $message[] = "Error E101 - Current Username or Password is wrong.";
    return false;
  }
  if ($newPassword != $newPasswordCnf ) {
    $message[] = "Error E102 - Your New passwords do not match! ";
    return false;
  }
  if (strlen($newPassword) < 4 ) {
    $message[] = "Error E103 - Your new password is too short! ";
    return false;
  }
  if (!preg_match("/[0-9]/",$newPassword)) {
    $message[] = "Error E104 - Your new password must contain at least one digit. ";
    return false;
  }
  if (!preg_match("/[a-zA-Z]/",$newPassword)) {
    $message[] = "Error E105 - Your new password must contain at least one letter. ";
    return false;
  }
  if (!preg_match("/[A-Z]/",$newPassword)) {
    $message[] = "Error E106 - Your new password must contain at least one uppercase letter. ";
    return false;
  }
  if (!preg_match("/[a-z]/",$newPassword)) {
    $message[] = "Error E107 - Your new password must contain at least one lowercase letter. ";
    return false;
  }

  /* change the password finally */
  $entry = array();
  $entry["userPassword"] = "{SHA}" . base64_encode( pack( "H*", sha1( $newPassword ) ) );

  if (ldap_modify($con,$user,$entry) === false){
    $message[] = "E200 - Your password cannot be change, please contact the administrator.";
  } else {
    $message[] = " Your password has been changed. ";
    //mail($records[0]["mail"][0],"Password change notice : ".$userid," Your password has just been changed.");
  }
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Change your LDAP password</title>
  <style type="text/css">
  body { font-family: Verdana,Arial,Courier New; font-size: 0.7em;  }
  input:focus { background-color: #eee; border-color: red; }
  th { text-align: right; padding: 0.8em; }
  #container { text-align: center; width: 500px; margin: 5% auto; }
  ul { text-align: left; list-style-type: square; }
  .msg { margin: 0 auto; text-align: center; color: navy;  border-top: 1px solid red;  border-bottom: 1px solid red;  }
  </style>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>
<body>
  <div id="container">
    <h2>Change your LDAP password</h2>
<ul>
  <li> Your new password must be 8 characters long and contain at least one letter and one digit. </li>
</ul>
    <form action="<?php print $_SERVER['PHP_SELF']; ?>" name="passwordChange" method="post">
      <table style="width: 400px; margin: 0 auto;">
        <tr><th>Username:</th><td><input name="username" type="text" size="20" autocomplete="off" /></td></tr>
        <tr><th>Old password:</th><td><input name="oldPassword" size="20" type="password" /></td></tr>
        <tr><th>New password:</th><td><input name="newPassword1" size="20" type="password" /></td></tr>
        <tr><th>New password (again):</th><td><input name="newPassword2" size="20" type="password" /></td></tr>
        <tr><td colspan="2" style="text-align: center;" >
          <input name="submitted" type="submit" value="Change Password"/>
          <button onclick="$('frm').action='changepassword.php';$('frm').submit();">Cancel</button>
        </td></tr>
      </table>
    </form>
    <div class="msg"><?php
      if (isset($_POST["submitted"])) {
        changePassword($_POST['username'],$_POST['oldPassword'],$_POST['newPassword1'],$_POST['newPassword2']);
        foreach ( $message as $one ) { echo "<p>$one</p>"; }
      } ?>
    </div>
  </div>
</body>
</html>

Reference :
https://gist.github.com/657334/98d7c111796db51059a5fd788240fd69672b8daf
http://ideone.com/Ib90W
http://technology.mattrude.com/2010/11/ldap-php-change-password-webpage/
https://gist.github.com/mattrude/657334

How to Upgrade Zimbra Collaboration Suite 8.0.5 to 8.0.6 on CentOS 6.5 x86_64

Zimbra Collaboration Server (ZCS) Open Source Edition is available for us to test and install. The latest version ZCS 8.0.6 has been released. There are several issues and security fix has been addressed on this ZCS 8.0.6 release. This post describes the steps to upgrade existing ZCS 8.0.5 to ZCS 8.0.6 on CentOS 6.5 64 bit. It is advisable to review the Known Issues section for a list of outstanding issues in this release before upgrading.

Major Issues Fixed for 8.0.6
-License updates are applied to all servers.
-Birthday and anniversary dates display correctly in the Zimbra Web Client, regardless of the language setting.
-Tagged items that are shared display correctly.
-Work week displays correctly in calendar view.
-In a multi-server environment that has both master and replicas, the zmprov -l option falls back to the replica if the master is down.

Security Fix for 8.0.6

A critical security vulnerability has been resolved in this maintenance release. It is recommended for customers running all previous versions to upgrade as soon as possible. This issue is being tracked in our Bugzilla system as the following:

  • Bug # 84547: http://bugzilla.zimbra.com/show_bug.cgi?id=84547
  • Summary: Critical Security Vulnerability
  • Affected Version: 7.2.5 and 8.0.5 and all previous releases

To protect customers as they plan to apply this update, this bug is marked as private in our system and technical details are not publicly available.

Release Notes for ZCS 8.0.6

STEPS :
1. Show current zimbra version :

[root@centos65-Zimbra8 ~]# su - zimbra
[zimbra@centos65-Zimbra8 ~]$ zmcontrol -v
Release 8.0.5_GA_5839.RHEL6_64_20130910123908 RHEL6_64 FOSS edition.

2. Download ZCS 8.0.6 :

[root@centos65-Zimbra8 ~]# wget http://files2.zimbra.com/downloads/8.0.6_GA/zcs-8.0.6_GA_5922.RHEL6_64.20131203103705.tgz

3. Extract the zcs tgz file and enter extracted folder :

[root@centos65-Zimbra8 ~]# tar xzvf zcs-8.0.6_GA_5922.RHEL6_64.20131203103705.tgz

4. Upgrade zimbra. The steps and command almost similar with the installation :

[root@centos65-Zimbra8 ~]# cd zcs-8.0.6_GA_5922.RHEL6_64.20131203103705
[root@centos65-Zimbra8 zcs-8.0.6_GA_5922.RHEL6_64.20131203103705]# ./install.sh --platform-override

Example :

[root@centos65-Zimbra8 zcs-8.0.6_GA_5922.RHEL6_64.20131203103705]# ./install.sh --platform-override

Operations logged to /tmp/install.log.21908
Checking for existing installation...
    zimbra-ldap...FOUND zimbra-ldap-8.0.5_GA_5839
    zimbra-logger...FOUND zimbra-logger-8.0.5_GA_5839
    zimbra-mta...FOUND zimbra-mta-8.0.5_GA_5839
    zimbra-snmp...FOUND zimbra-snmp-8.0.5_GA_5839
    zimbra-store...FOUND zimbra-store-8.0.5_GA_5839
    zimbra-apache...FOUND zimbra-apache-8.0.5_GA_5839
    zimbra-spell...FOUND zimbra-spell-8.0.5_GA_5839
    zimbra-convertd...NOT FOUND
    zimbra-memcached...FOUND zimbra-memcached-8.0.5_GA_5839
    zimbra-proxy...FOUND zimbra-proxy-8.0.5_GA_5839
    zimbra-archiving...NOT FOUND
    zimbra-cluster...NOT FOUND
    zimbra-core...FOUND zimbra-core-8.0.5_GA_5839
ZCS upgrade from 8.0.5 to 8.0.6 will be performed.

Saving existing configuration file to /opt/zimbra/.saveconfig

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.4.html

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

Oracle Binary Code License Agreement for the Java SE Platform Products

ORACLE  AMERICA, INC. ("ORACLE"), FOR AND ON BEHALF OF ITSELF AND ITS SUBSIDIARIES AND AFFILIATES UNDER COMMON CONTROL, IS WILLING TO  LICENSE  THE SOFTWARE  TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS  CONTAINED IN THIS BINARY CODE LICENSE AGREEMENT AND SUPPLEMENTAL  LICENSE TERMS (COLLECTIVELY "AGREEMENT").  PLEASE READ THE AGREEMENT  CAREFULLY.  BY SELECTING THE "ACCEPT LICENSE AGREEMENT" (OR THE EQUIVALENT) BUTTON AND/OR BY USING THE SOFTWARE YOU ACKNOWLEDGE THAT YOU HAVE READ THE TERMS AND AGREE TO THEM.  IF YOU ARE AGREEING TO THESE TERMS ON BEHALF OF A  COMPANY OR OTHER LEGAL ENTITY, YOU REPRESENT THAT YOU HAVE THE LEGAL  AUTHORITY TO BIND THE LEGAL ENTITY TO THESE TERMS.  IF YOU DO NOT HAVE SUCH  AUTHORITY, OR IF YOU DO NOT WISH TO BE BOUND BY THE TERMS, THEN SELECT THE "DECLINE LICENSE AGREEMENT" (OR THE EQUIVALENT) BUTTON AND YOU MUST NOT USE THE SOFTWARE ON THIS SITE OR ANY OTHER MEDIA ON WHICH THE SOFTWARE IS CONTAINED.

1.  DEFINITIONS.  "Software" means the Java SE Platform Products in binary form that you selected for download, install or use from Oracle or its authorized licensees, any other machine readable materials (including, but not limited to,  libraries,  source  files,  header  files, and data  files), any updates or error corrections provided by Oracle, and any user manuals, programming guides and other documentation provided to you by Oracle under this Agreement.  "General Purpose Desktop Computers and Servers" means computers,  including desktop and laptop computers, or servers, used for general  computing functions under end user control (such as but not specifically  limited to email, general purpose Internet browsing, and office suite  productivity tools).  The use of Software in systems and solutions that provide dedicated functionality (other than as mentioned above) or designed  for use in embedded or function-specific software applications, for example but not limited to: Software embedded in or bundled with industrial control systems, wireless mobile telephones, wireless handheld devices, netbooks, kiosks, TV/STB, Blu-ray Disc devices, telematics and network control switching equipment, printers and storage management systems, and other related systems are excluded from this definition and not licensed under this  Agreement.  "Programs" means Java technology applets and applications  intended to run on the Java Platform, Standard Edition platform on Java-enabled General Purpose Desktop Computers and Servers.  ?Commercial Features? means those features identified in Table 1-1 (Commercial Features In Java SE Product Editions) of the Software documentation accessible at  http://www.oracle.com/technetwork/java/javase/documentation/index.html.  ?README File? means the README file for the Software accessible at http://www.oracle.com/technetwork/java/javase/terms/readme/index.html.

2.  LICENSE TO USE.  Subject to the terms and conditions of this Agreement   including, but not limited to, the Java Technology Restrictions of the  Supplemental License Terms, Oracle grants you a non-exclusive, non-transferable, limited license without license fees to reproduce and use internally the Software complete and unmodified for the sole purpose of  running Programs.  THE LICENSE SET FORTH IN THIS SECTION 2 DOES NOT EXTEND TO THE COMMERCIAL FEATURES.  YOUR RIGHTS AND OBLIGATIONS RELATED TO THE COMMERCIAL FEATURES ARE AS SET FORTH IN THE SUPPLEMENTAL TERMS ALONG WITH ADDITIONAL LICENSES FOR DEVELOPERS AND PUBLISHERS.

3.  RESTRICTIONS.  Software is copyrighted.  Title to Software and all associated intellectual property rights is retained by Oracle and/or its licensors.  Unless enforcement is prohibited by applicable law, you may not modify, decompile, or reverse engineer Software.  You acknowledge that the Software is developed for general use in a variety of information management applications; it is not developed or intended for use in any inherently dangerous applications, including applications that may create a risk of personal injury. If you use the Software in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure its safe use.  Oracle disclaims any express or implied warranty of fitness for such uses.  No right, title or interest in or to any trademark,  service mark, logo or trade name of Oracle or its licensors is granted under this  Agreement.  Additional restrictions for developers and/or publishers licenses are set forth in the Supplemental License Terms.

4.  DISCLAIMER OF WARRANTY.  THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND.  ORACLE FURTHER DISCLAIMS ALL WARRANTIES, EXPRESS AND IMPLIED, INCLUDING WITHOUT LIMITATION, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.

5.  LIMITATION OF LIABILITY.  IN NO EVENT SHALL ORACLE BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, PUNITIVE OR CONSEQUENTIAL DAMAGES, OR DAMAGES FOR LOSS OF PROFITS, REVENUE, DATA OR DATA USE, INCURRED BY YOU OR ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT, EVEN IF ORACLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. ORACLE'S ENTIRE LIABILITY FOR DAMAGES HEREUNDER SHALL IN NO EVENT EXCEED ONE THOUSAND DOLLARS (U.S. $1,000).

6.  TERMINATION.  This Agreement is effective until terminated.  You may terminate this Agreement at any time by destroying all copies of Software.  This Agreement will terminate immediately without notice from Oracle if you  fail to comply with any provision of this Agreement.  Either party may  terminate this Agreement immediately should any Software become, or in either party's opinion be likely to become, the subject of a claim of infringement  of any intellectual property  right.  Upon termination, you must destroy all copies of Software.

7.  EXPORT  REGULATIONS.  You agree that U.S. export control laws and other applicable export and import laws govern your use of the Software, including technical data; additional information can be found on Oracle's Global Trade Compliance web site (http://www.oracle.com/products/export). You agree that neither the Software nor any direct product thereof will be exported, directly, or indirectly, in violation of these laws, or will be used for any purpose prohibited by these laws including, without limitation, nuclear, chemical, or biological weapons proliferation.

8.  TRADEMARKS AND LOGOS.  You acknowledge and agree as between you
and Oracle that Oracle owns the ORACLE and JAVA trademarks and all ORACLE- and JAVA-related trademarks, service marks, logos and other brand
designations ("Oracle Marks"), and you agree to comply with the Third
Party Usage Guidelines for Oracle Trademarks currently located at
http://www.oracle.com/us/legal/third-party-trademarks/index.html.  Any use you make of the Oracle Marks inures to Oracle's benefit.

9.  U.S.  GOVERNMENT LICENSE RIGHTS.  If Software is being acquired by or on  behalf of the U.S. Government or by a U.S. Government prime contractor or  subcontractor (at any tier), then the Government's rights in Software and accompanying documentation shall be only those set forth in this Agreement.

10.  GOVERNING  LAW.  This agreement is governed by the substantive and procedural laws of California. You and Oracle agree to submit to the exclusive jurisdiction of, and venue in, the courts of San Francisco, or Santa Clara counties in California in any dispute arising out of or relating to this agreement.

11.  SEVERABILITY.  If any  provision of this  Agreement is held to be unenforceable, this Agreement will remain in effect with the provision omitted, unless omission would frustrate the intent of the parties, in which case this Agreement will immediately terminate.

12.  INTEGRATION.  This Agreement is the entire agreement  between you and Oracle relating to its subject matter.  It supersedes all prior or contemporaneous oral or written communications, proposals, representations  and warranties and prevails over any  conflicting  or additional  terms  of  any  quote, order, acknowledgment, or other communication between the parties  relating to its subject matter during the term of this Agreement.  No modification of this Agreement will be  binding,  unless  in  writing  and  signed  by an  authorized representative of each party.

SUPPLEMENTAL LICENSE TERMS

These  Supplemental  License  Terms add to or modify  the terms of the Binary Code License Agreement.  Capitalized terms not defined in these Supplemental  Terms shall have the same meanings ascribed to them in the Binary Code License Agreement.  These Supplemental Terms shall supersede any  inconsistent or conflicting terms in the Binary Code License Agreement, or in any license contained within the Software.

A.  COMMERCIAL FEATURES.  You may not use the Commercial Features for running Programs, Java applets or applications in your internal business operations or for any commercial or production  purpose, or for any purpose other than as set forth in Sections B, C, D and E of these Supplemental Terms.  If You want to use the Commercial Features for any purpose other than as permitted in this Agreement, You must obtain a separate license from Oracle.

B.  SOFTWARE INTERNAL USE FOR DEVELOPMENT LICENSE GRANT.  Subject to the terms and conditions of this Agreement and restrictions and exceptions set forth in the README File incorporated herein by reference,  including, but not limited to the Java Technology Restrictions of these  Supplemental Terms, Oracle grants you a non-exclusive, non-transferable,  limited license without fees to reproduce internally and use internally the Software complete and unmodified for the purpose of designing, developing, and testing your Programs.

C.  LICENSE TO DISTRIBUTE SOFTWARE.  Subject to the terms and conditions of this Agreement and restrictions and exceptions set forth in the   README File, including, but not limited to the Java Technology Restrictions of these Supplemental Terms, Oracle grants you a non-exclusive, non-transferable, limited license without fees to reproduce and distribute the  Software, provided that (i) you distribute the Software complete and  unmodified and only bundled as part of, and for the sole purpose of running, your Programs, (ii) the Programs add significant and primary functionality  to the Software, (iii) you do not distribute additional  software intended to replace any component(s) of the Software, (iv) you do not remove or alter any proprietary legends or notices contained in the Software, (v) you only distribute the Software subject to a license agreement that: (a) is a complete, unmodified reproduction of this Agreement; or (b) protects Oracle's  interests consistent with the terms contained in this Agreement and that includes the notice set forth in Section G, and (vi) you agree to defend and indemnify Oracle and its licensors from and against any damages, costs, liabilities, settlement amounts and/or expenses (including  attorneys' fees)  incurred in connection  with any claim, lawsuit or action by any third party that arises or results from the use or distribution of any and all Programs and/or Software.

D.  LICENSE TO DISTRIBUTE REDISTRIBUTABLES.  Subject to the terms and conditions of this Agreement and restrictions and exceptions set forth in the README  File, including but not limited to the Java Technology Restrictions of these Supplemental Terms, Oracle grants you a non-exclusive,  non-transferable, limited license without fees to reproduce and distribute  those files specifically identified as redistributable in the   README File ("Redistributables") provided that: (i) you distribute the  Redistributables complete and unmodified, and only bundled as part of Programs, (ii) the Programs add significant and primary functionality to the  Redistributables, (iii) you do not distribute additional software intended to supersede any component(s) of the Redistributables (unless otherwise specified in the applicable README File), (iv) you do not remove or alter any proprietary legends or notices contained in or on the Redistributables, (v)  you only distribute the Redistributables pursuant to a license agreement  that: (a) is a complete, unmodified reproduction of this Agreement; or (b) protects Oracle's interests consistent with the terms contained in the Agreement and includes the notice set forth in Section G, (vi) you agree to defend and indemnify Oracle and its licensors from and against any damages,  costs, liabilities, settlement amounts and/or expenses (including  attorneys'  fees) incurred in connection with any claim, lawsuit or action by any third  party that arises or results from the use or distribution of any and all Programs and/or Software.

E.  DISTRIBUTION BY PUBLISHERS.  This section pertains to your distribution  of the JavaTM SE Development Kit Software with your printed book or magazine (as those terms are commonly used in the industry) relating to Java technology ("Publication").  Subject to and conditioned upon your compliance  with the restrictions and obligations contained in the Agreement, Oracle hereby grants to you a non-exclusive, nontransferable limited right to reproduce complete and unmodified copies of the Software on electronic  media (the "Media") for the sole purpose of inclusion and distribution with your Publication(s), subject to the following terms: (i) You may not distribute  the Software on a stand-alone basis; it must be distributed with your Publication(s); (ii) You are responsible for downloading the Software from the applicable Oracle web site; (iii) You must refer to the Software as JavaTM SE Development Kit; (iv) The Software must be reproduced in its entirety and without any modification whatsoever (including with respect to all proprietary notices) and distributed with your Publication subject to a license agreement that is a complete, unmodified reproduction of this Agreement; (v) The Media label shall include the following information:  Copyright 2011, Oracle America, Inc.  All rights reserved.  Use is subject to license terms.  ORACLE and JAVA trademarks and all ORACLE- and JAVA-related trademarks, service marks, logos and other brand
designations are trademarks or registered  trademarks of Oracle in the U.S. and other countries.  This information must be placed on the Media  label in such a manner as to only apply to the Oracle  Software;  (vi) You must clearly identify the Software as Oracle's product on the Media  holder or Media label, and you may not state or imply that Oracle is responsible for any third-party software contained on the Media; (vii) You may not include any third  party software on the Media which is intended to be a  replacement or substitute for the Software; (viii) You agree to defend and indemnify Oracle and its licensors from and against any damages, costs, liabilities, settlement amounts and/or expenses (including  attorneys'  fees) incurred in connection with any claim, lawsuit or action by any third party that arises or results from the use or distribution of the Software and/or the Publication; ; and (ix) You shall provide Oracle with a written notice for each Publication; such notice shall include the following information: (1) title of Publication, (2) author(s), (3) date of Publication,  and (4)  ISBN or ISSN  numbers.  Such notice shall be sent to  Oracle America, Inc.,  500 Oracle  Parkway, Redwood Shores,  California  94065 U.S.A , Attention:  General Counsel.

F.  JAVA TECHNOLOGY RESTRICTIONS.  You may not create, modify, or change the behavior of, or authorize your licensees to create, modify, or change the behavior of, classes, interfaces, or subpackages that are in any way  identified  as  "java", "javax", "sun", ?oracle? or similar convention as   specified by Oracle in any naming convention designation.

G.  COMMERCIAL FEATURES NOTICE.  For purpose of complying with Supplemental Term Section  C.(v)(b) and D.(v)(b), your license agreement shall include the following notice, where the notice is displayed in a manner that anyone using the Software will see the notice:

Use of the Commercial Features for any commercial or production purpose requires a separate license from Oracle.  ?Commercial Features? means those features identified Table 1-1 (Commercial Features In Java SE Product Editions) of the Software documentation accessible at http://www.oracle.com/technetwork/java/javase/documentation/index.html

H.  SOURCE CODE.  Software may contain source code that, unless expressly   licensed for other purposes, is provided solely for reference purposes  pursuant to the terms of this Agreement.  Source code may not be redistributed  unless  expressly  provided for in this Agreement.

I.  THIRD PARTY CODE.  Additional copyright notices and license terms applicable to portions of the Software are set forth in the THIRDPARTYLICENSEREADME file accessible at http://www.oracle.com/technetwork/java/javase/documentation/index.html.  In addition to any terms and conditions of any third party opensource/freeware license identified in the  THIRDPARTYLICENSEREADME file, the disclaimer of warranty and limitation of liability  provisions in  paragraphs 4 and 5 of the Binary Code License Agreement shall apply to all Software in this distribution.

J.  TERMINATION FOR INFRINGEMENT.  Either party may terminate this Agreement immediately should any Software become, or in either party's opinion be likely to become, the subject of a claim of infringement of any intellectual property right.

K.  INSTALLATION AND AUTO-UPDATE.  The Software's installation and auto-update processes transmit a limited amount of data to Oracle (or its service  provider) about those specific processes to help Oracle understand and optimize them.  Oracle does not associate the data with personally  identifiable  information.  You can find more  information about the data Oracle collects as a result of your Software download at http://www.oracle.com/technetwork/java/javase/documentation/index.html.

For inquiries please contact:  Oracle America, Inc., 500 Oracle Parkway,
Redwood Shores, California 94065, USA.

Last updated May 17, 2011

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

Checking for prerequisites...
     FOUND: NPTL
     FOUND: nc-1.84-22
     FOUND: sudo-1.8.6p3-12
     FOUND: libidn-1.18-2
     FOUND: gmp-4.3.1-7
     FOUND: /usr/lib64/libstdc++.so.6

Checking for suggested prerequisites...
     FOUND: perl-5.10.1
     FOUND: sysstat
     FOUND: sqlite
Prerequisite check complete.
Checking current number of databases...

Do you want to verify message store database integrity? [Y] y
Verifying integrity of message store databases.  This may take a while.
mysqld is alive
No errors found

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

The Zimbra Collaboration Server appears already to be installed.
It can be upgraded with no effect on existing accounts,
or the current installation can be completely removed prior
to installation for a clean install.

Do you wish to upgrade? [Y]

Select the packages to install
    Upgrading zimbra-core
    Upgrading zimbra-ldap
    Upgrading zimbra-logger
    Upgrading zimbra-mta
    Upgrading zimbra-snmp
    Upgrading zimbra-store
    Upgrading zimbra-apache
    Upgrading zimbra-spell
    Upgrading zimbra-memcached
    Upgrading zimbra-proxy
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
    zimbra-memcached
    zimbra-proxy

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

Shutting down zimbra mail

Backing up the ldap database...done.

Removing existing packages

   zimbra-ldap...done
   zimbra-logger...done
   zimbra-mta...done
   zimbra-snmp...done
   zimbra-store...done
   zimbra-spell...done
   zimbra-memcached...done
   zimbra-proxy...done
   zimbra-apache...done
   zimbra-core...done

Removing deployed webapp directories
Installing packages

    zimbra-core......zimbra-core-8.0.6_GA_5922.RHEL6_64-20131203103705.x86_64.rpm...done
    zimbra-ldap......zimbra-ldap-8.0.6_GA_5922.RHEL6_64-20131203103705.x86_64.rpm...done
    zimbra-logger......zimbra-logger-8.0.6_GA_5922.RHEL6_64-20131203103705.x86_64.rpm...done
    zimbra-mta......zimbra-mta-8.0.6_GA_5922.RHEL6_64-20131203103705.x86_64.rpm...done
    zimbra-snmp......zimbra-snmp-8.0.6_GA_5922.RHEL6_64-20131203103705.x86_64.rpm...done
    zimbra-store......zimbra-store-8.0.6_GA_5922.RHEL6_64-20131203103705.x86_64.rpm...done
    zimbra-apache......zimbra-apache-8.0.6_GA_5922.RHEL6_64-20131203103705.x86_64.rpm...done
    zimbra-spell......zimbra-spell-8.0.6_GA_5922.RHEL6_64-20131203103705.x86_64.rpm...done
    zimbra-memcached......zimbra-memcached-8.0.6_GA_5922.RHEL6_64-20131203103705.x86_64.rpm...done
    zimbra-proxy......zimbra-proxy-8.0.6_GA_5922.RHEL6_64-20131203103705.x86_64.rpm...done

Setting defaults from saved config in /opt/zimbra/.saveconfig/config.save
   HOSTNAME=centos65.ehowstuff.local
   LDAPHOST=centos65.ehowstuff.local
   LDAPPORT=389
   SNMPTRAPHOST=centos65.ehowstuff.local
   SMTPSOURCE=admin@ehowstuff.local
   SMTPDEST=admin@ehowstuff.local
   SNMPNOTIFY=yes
   SMTPNOTIFY=yes
   LDAPROOTPW=35WrLoqhzZ
   LDAPZIMBRAPW=35WrLoqhzZ
   LDAPPOSTPW=35WrLoqhzZ
   LDAPREPPW=35WrLoqhzZ
   LDAPAMAVISPW=35WrLoqhzZ
   LDAPNGINXPW=35WrLoqhzZ
Restoring existing configuration file from /opt/zimbra/.saveconfig/localconfig.xml...done
Operations logged to /tmp/zmsetup.02252014-233906.log
Upgrading from 8.0.5_GA_5839 to 8.0.6_GA_5922
Stopping zimbra services...done.
Starting mysql...done.
This appears to be 8.0.5_GA
Checking ldap status...not running.
Running zmldapapplyldif...done.
Checking ldap status...not running.
Starting ldap...done.
Stopping mysql...done.
Updating from 8.0.6_GA
Updating global config and COS's with attributes introduced after 8.0.5_GA...done.
Stopping ldap...done.
Upgrade complete.

Running zmldapapplyldif...done.
Checking ldap status....not running.
Starting ldap...done.
Setting defaults...done.
Setting defaults from existing config...done.
Checking for port conflicts
Setting defaults from ldap...done.
Saving config in /opt/zimbra/config.2886...done.
Operations logged to /tmp/zmsetup.02252014-233906.log
Setting local config values...done.
Initializing core config...Setting up CA...done.
Deploying CA to /opt/zimbra/conf/ca ...done.
Setting replication password...done.
Setting Postfix password...done.
Setting amavis password...done.
Setting nginx password...done.
Creating server entry for centos65.ehowstuff.local...already exists.
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 centos65.ehowstuff.local...done.
Adding centos65.ehowstuff.local to zimbraMailHostPool in default COS...done.
Setting Keyboard Shortcut Preferences...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 centos65.ehowstuff.local...done.
Creating user spam.wc5ohhoylp@ehowstuff.local...already exists.
Creating user ham.ypxiyleoyj@ehowstuff.local...already exists.
Creating user virus-quarantine.kl6ejsnmd@ehowstuff.local...already exists.
Setting spam training and Anti-virus quarantine accounts...done.
Configuring SNMP...done.
Setting up syslog.conf...done.
Starting servers...done.
Checking for deprecated zimlets...done.
Checking for network zimlets in LDAP...done.
Removing network zimlets...
Finished removing network zimlets.
Installing common zimlets...
        com_zimbra_webex...done.
        com_zimbra_date...done.
        com_zimbra_adminversioncheck...done.
        com_zimbra_cert_manager...done.
        com_zimbra_tooltip...done.
        com_zimbra_proxy_config...done.
        com_zimbra_attachcontacts...done.
        com_zimbra_viewmail...done.
        com_zimbra_bulkprovision...done.
        com_zimbra_clientuploader...done.
        com_zimbra_phone...done.
        com_zimbra_attachmail...done.
        com_zimbra_ymemoticons...done.
        com_zimbra_srchhighlighter...done.
        com_zimbra_url...done.
        com_zimbra_email...done.
Finished installing common zimlets.
Getting list of all zimlets...done.
Updating non-standard zimlets...
Finished updating non-standard zimlets.
Restarting mailboxd...done.
Skipping creation of default domain GAL sync account - existing install detected.

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.6_GA_5922_RHEL6_64)
        The ADMIN EMAIL ADDRESS created (admin@ehowstuff.local)

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

Moving /tmp/zmsetup.02252014-233906.log to /opt/zimbra/log

Configuration complete - press return to exit

5. As per Release Notes for ZCS 8.0.6, please run zmldapupgrade -b 66387 after upgrading.

[zimbra@centos65-Zimbra8 ~]$ zmldapupgrade -b 66387


--------------
com.zimbra.cs.account.ldap.upgrade.LdapUpgrade -b 66387
--------------
Number of accounts using zimbraAllowFromAddress: 0
Number of accounts migrated: 0
Migration completed


--------------
done 66387
--------------

6. Check Zimbra Version :

[root@centos65-Zimbra8 ~]# su - zimbra
[zimbra@centos65-Zimbra8 ~]$ zmcontrol -v
Release 8.0.6_GA_5922.RHEL6_64_20131203103705 RHEL6_64 FOSS edition.

7. Verify zimbra status :

[zimbra@centos65-Zimbra8 ~]$ zmcontrol status
Host centos65.ehowstuff.local
        antispam                Running
        antivirus               Running
        ldap                    Running
        logger                  Running
        mailbox                 Running
        memcached               Running
        mta                     Running
        opendkim                Running
        proxy                   Running
        snmp                    Running
        spell                   Running
        stats                   Running
        zmconfigd               Running

How to setup Postfix Transport to Route the email messages

This post will show you how to route messages to other mail server using postfix transport file. This feature allows you to perform mail routing to respective host according to the map defined. Postfix will checking the transport map first instead of reading the DNS for MX record. The steps was tested on CentOS 6.5 and Postfix 2.6.6.

1. In order for Postfix to use the transport file, configure main.cf to use transport map :

vi /etc/postfix/main.cf

Append the following at the bottom :

transport_maps = hash:/etc/postfix/transport

2. Edit transport map file :

vi /etc/postfix/transport

Append the following at the bottom :

ehowstuff.local           smtp:[192.168.0.2]

3. Rebuild the transport database file :

[root@mx-mx06 ~]# postmap /etc/postfix/transport

Note : The command “postmap /etc/postfix/transport” should be execute whenever you change the transport table.

4. Reload postfix to apply the new transport :

[root@mx-mx06 ~]# postfix reload
postfix/postfix-script: refreshing the Postfix mail system

5. Verify :

[root@mx-mx06 ~]# telnet localhost 25
Trying ::1...
Connected to localhost.
Escape character is '^]'.
220 mx.ehowstuff.local ESMTP Postfix
ehlo abc.com
250-mx.ehowstuff.local
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
mail from:root@ehowstuff.local
250 2.1.0 Ok
rcpt to:root@ehowstuff.local
250 2.1.5 Ok
data
354 End data with .
.
250 2.0.0 Ok: queued as D02D861B50
quit
221 2.0.0 Bye
Connection closed by foreign host.

How to Install Nagios Monitoring Server on CentOS 6.5

Nagios is one of the alternate open source computer, network and infrastructure monitoring system that will help organizations to identify and resolve IT infrastructure problems before they affect critical business processes. Nagios provides host, service and network monitoring capabilities and was designed with scalability and flexibility. With complete monitoring and alerting, nagios allows you to detect and repair problems and mitigate future issues before they affect end-users and customers. This post will show you how you can install Nagios monitoring server on CentOS 6.5

1. Prepare and download EPEL repository :

[root@centos6-05 ~]# wget dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

2. Install EPEL repository :

[root@centos6-05 ~]# rpm -Uvh epel-release-6-8.noarch.rpm
warning: epel-release-6-8.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Preparing...                ########################################### [100%]
1:epel-release           ########################################### [100%]

3. Install Nagis packages, php and httpd web server :

[root@centos6-05 ~]# yum install nagios nagios-plugins-all nagios-plugins-nrpe nrpe php httpd -y

Example:

[root@centos6-05 ~]# yum install nagios nagios-plugins-all nagios-plugins-nrpe nrpe php httpd -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * Webmin: download.webmin.com
 * base: mirror.upsi.edu.my
 * epel: mirror.smartmedia.net.id
 * extras: mirror.upsi.edu.my
 * updates: mirror.upsi.edu.my
Setting up Install Process
Package php-5.3.3-27.el6_5.x86_64 already installed and latest version
Package httpd-2.2.15-29.el6.centos.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package nagios.x86_64 0:3.5.1-1.el6 will be installed
--> Processing Dependency: user(nagios) for package: nagios-3.5.1-1.el6.x86_64
--> Processing Dependency: user(nagios) for package: nagios-3.5.1-1.el6.x86_64
--> Processing Dependency: nagios-common for package: nagios-3.5.1-1.el6.x86_64
--> Processing Dependency: mailx for package: nagios-3.5.1-1.el6.x86_64
--> Processing Dependency: group(nagios) for package: nagios-3.5.1-1.el6.x86_64
--> Processing Dependency: group(nagios) for package: nagios-3.5.1-1.el6.x86_64
--> Processing Dependency: libgd.so.2()(64bit) for package: nagios-3.5.1-1.el6.x86_64
---> Package nagios-plugins-all.x86_64 0:1.4.16-10.el6 will be installed
--> Processing Dependency: nagios-plugins-wave for package: nagios-plugins-all-1.4.16-10.el6.x86_64
--> Processing Dependency: nagios-plugins-users for package: nagios-plugins-all-1.4.16-10.el6.x86_64
--> Processing Dependency: nagios-plugins-ups for package: nagios-plugins-all-1.4.16-10.el6.x86_64
--> Processing Dependency: nagios-plugins-time for package: nagios-plugins-all-1.4.16-10.el6.x86_64
--> Processing Dependency: nagios-plugins-tcp for package: nagios-plugins-all-1.4.16-10.el6.x86_64
--> Processing Dependency: nagios-plugins-swap for package: nagios-plugins-all-1.4.16-10.el6.x86_64
--> Processing Dependency: nagios-plugins-ssh for package: nagios-plugins-all-1.4.16-10.el6.x86_64
--> Processing Dependency: nagios-plugins-snmp for package: nagios-plugins-all-1.4.16-10.el6.x86_64
--> Processing Dependency: nagios-plugins-smtp for package: nagios-plugins-all-1.4.16-10.el6.x86_64
--> Processing Dependency: nagios-plugins-sensors for package: nagios-plugins-all-1.4.16-10.el6.x86_64
--> Processing Dependency: nagios-plugins-rpc for package: nagios-plugins-all-1.4.16-10.el6.x86_64
--> Processing Dependency: nagios-plugins-real for package: nagios-plugins-all-1.4.16-10.el6.x86_64
--> Processing Dependency: nagios-plugins-procs for package: nagios-plugins-all-1.4.16-10.el6.x86_64
--> Processing Dependency: nagios-plugins-ping for package: nagios-plugins-all-1.4.16-10.el6.x86_64
--> Processing Dependency: nagios-plugins-pgsql for package: nagios-plugins-all-1.4.16-10.el6.x86_64
--> Processing Dependency: nagios-plugins-overcr for package: nagios-plugins-all-1.4.16-10.el6.x86_64
--> Processing Dependency: nagios-plugins-oracle for package: nagios-plugins-all-1.4.16-10.el6.x86_64
--> Processing Dependency: nagios-plugins-nwstat for package: nagios-plugins-all-1.4.16-10.el6.x86_64
--> Processing Dependency: nagios-plugins-ntp-perl for package: nagios-plugins-all-1.4.16-10.el6.x86_64
--> Processing Dependency: nagios-plugins-ntp for package: nagios-plugins-all-1.4.16-10.el6.x86_64
--> Processing Dependency: nagios-plugins-nt for package: nagios-plugins-all-1.4.16-10.el6.x86_64
--> Processing Dependency: nagios-plugins-nagios for package: nagios-plugins-all-1.4.16-10.el6.x86_64
--> Processing Dependency: nagios-plugins-mysql for package: nagios-plugins-all-1.4.16-10.el6.x86_64
--> Processing Dependency: nagios-plugins-mrtgtraf for package: nagios-plugins-all-1.4.16-10.el6.x86_64
--> Processing Dependency: nagios-plugins-mrtg for package: nagios-plugins-all-1.4.16-10.el6.x86_64
--> Processing Dependency: nagios-plugins-mailq for package: nagios-plugins-all-1.4.16-10.el6.x86_64
--> Processing Dependency: nagios-plugins-log for package: nagios-plugins-all-1.4.16-10.el6.x86_64
--> Processing Dependency: nagios-plugins-load for package: nagios-plugins-all-1.4.16-10.el6.x86_64
--> Processing Dependency: nagios-plugins-ldap for package: nagios-plugins-all-1.4.16-10.el6.x86_64
--> Processing Dependency: nagios-plugins-ircd for package: nagios-plugins-all-1.4.16-10.el6.x86_64
--> Processing Dependency: nagios-plugins-ide_smart for package: nagios-plugins-all-1.4.16-10.el6.x86_64
--> Processing Dependency: nagios-plugins-icmp for package: nagios-plugins-all-1.4.16-10.el6.x86_64
--> Processing Dependency: nagios-plugins-http for package: nagios-plugins-all-1.4.16-10.el6.x86_64
--> Processing Dependency: nagios-plugins-hpjd for package: nagios-plugins-all-1.4.16-10.el6.x86_64
--> Processing Dependency: nagios-plugins-game for package: nagios-plugins-all-1.4.16-10.el6.x86_64
--> Processing Dependency: nagios-plugins-fping for package: nagios-plugins-all-1.4.16-10.el6.x86_64
--> Processing Dependency: nagios-plugins-flexlm for package: nagios-plugins-all-1.4.16-10.el6.x86_64
--> Processing Dependency: nagios-plugins-file_age for package: nagios-plugins-all-1.4.16-10.el6.x86_64
--> Processing Dependency: nagios-plugins-dummy for package: nagios-plugins-all-1.4.16-10.el6.x86_64
..
..
..

Installed:
  nagios.x86_64 0:3.5.1-1.el6                     nagios-plugins-all.x86_64 0:1.4.16-10.el6
  nagios-plugins-nrpe.x86_64 0:2.14-5.el6         nrpe.x86_64 0:2.14-5.el6

Dependency Installed:
  dmidecode.x86_64 1:2.11-2.el6                    fontconfig.x86_64 0:2.8.0-3.el6
  fping.x86_64 0:2.4b2-10.el6                      gd.x86_64 0:2.0.35-11.el6
  libgssglue.x86_64 0:0.1-11.el6                   libtalloc.x86_64 0:2.0.7-2.el6
  libtdb.x86_64 0:1.2.10-1.el6                     libtevent.x86_64 0:0.9.18-3.el6
  libtirpc.x86_64 0:0.2.1-6.el6_4                  lm_sensors.x86_64 0:3.1.1-17.el6
  mailx.x86_64 0:12.4-7.el6                        nagios-common.x86_64 0:3.5.1-1.el6
  nagios-plugins.x86_64 0:1.4.16-10.el6            nagios-plugins-breeze.x86_64 0:1.4.16-10.el6
  nagios-plugins-by_ssh.x86_64 0:1.4.16-10.el6     nagios-plugins-cluster.x86_64 0:1.4.16-10.el6
  nagios-plugins-dhcp.x86_64 0:1.4.16-10.el6       nagios-plugins-dig.x86_64 0:1.4.16-10.el6
  nagios-plugins-disk.x86_64 0:1.4.16-10.el6       nagios-plugins-disk_smb.x86_64 0:1.4.16-10.el6
  nagios-plugins-dns.x86_64 0:1.4.16-10.el6        nagios-plugins-dummy.x86_64 0:1.4.16-10.el6
  nagios-plugins-file_age.x86_64 0:1.4.16-10.el6   nagios-plugins-flexlm.x86_64 0:1.4.16-10.el6
  nagios-plugins-fping.x86_64 0:1.4.16-10.el6      nagios-plugins-game.x86_64 0:1.4.16-10.el6
  nagios-plugins-hpjd.x86_64 0:1.4.16-10.el6       nagios-plugins-http.x86_64 0:1.4.16-10.el6
  nagios-plugins-icmp.x86_64 0:1.4.16-10.el6       nagios-plugins-ide_smart.x86_64 0:1.4.16-10.el6
  nagios-plugins-ircd.x86_64 0:1.4.16-10.el6       nagios-plugins-ldap.x86_64 0:1.4.16-10.el6
  nagios-plugins-load.x86_64 0:1.4.16-10.el6       nagios-plugins-log.x86_64 0:1.4.16-10.el6
  nagios-plugins-mailq.x86_64 0:1.4.16-10.el6      nagios-plugins-mrtg.x86_64 0:1.4.16-10.el6
  nagios-plugins-mrtgtraf.x86_64 0:1.4.16-10.el6   nagios-plugins-mysql.x86_64 0:1.4.16-10.el6
  nagios-plugins-nagios.x86_64 0:1.4.16-10.el6     nagios-plugins-nt.x86_64 0:1.4.16-10.el6
  nagios-plugins-ntp.x86_64 0:1.4.16-10.el6        nagios-plugins-ntp-perl.x86_64 0:1.4.16-10.el6
  nagios-plugins-nwstat.x86_64 0:1.4.16-10.el6     nagios-plugins-oracle.x86_64 0:1.4.16-10.el6
  nagios-plugins-overcr.x86_64 0:1.4.16-10.el6     nagios-plugins-perl.x86_64 0:1.4.16-10.el6
  nagios-plugins-pgsql.x86_64 0:1.4.16-10.el6      nagios-plugins-ping.x86_64 0:1.4.16-10.el6
  nagios-plugins-procs.x86_64 0:1.4.16-10.el6      nagios-plugins-real.x86_64 0:1.4.16-10.el6
  nagios-plugins-rpc.x86_64 0:1.4.16-10.el6        nagios-plugins-sensors.x86_64 0:1.4.16-10.el6
  nagios-plugins-smtp.x86_64 0:1.4.16-10.el6       nagios-plugins-snmp.x86_64 0:1.4.16-10.el6
  nagios-plugins-ssh.x86_64 0:1.4.16-10.el6        nagios-plugins-swap.x86_64 0:1.4.16-10.el6
  nagios-plugins-tcp.x86_64 0:1.4.16-10.el6        nagios-plugins-time.x86_64 0:1.4.16-10.el6
  nagios-plugins-ups.x86_64 0:1.4.16-10.el6        nagios-plugins-users.x86_64 0:1.4.16-10.el6
  nagios-plugins-wave.x86_64 0:1.4.16-10.el6       net-snmp-utils.x86_64 1:5.5-49.el6
  ntp.x86_64 0:4.2.6p5-1.el6.centos                ntpdate.x86_64 0:4.2.6p5-1.el6.centos
  openssh-clients.x86_64 0:5.3p1-94.el6            qstat.x86_64 0:2.11-9.20080912svn311.el6
  rpcbind.x86_64 0:0.2.0-11.el6                    samba-client.x86_64 0:3.6.9-167.el6_5
  samba-common.x86_64 0:3.6.9-167.el6_5            samba-winbind.x86_64 0:3.6.9-167.el6_5
  samba-winbind-clients.x86_64 0:3.6.9-167.el6_5

Complete!

4. Make httpd and nagios software auto start at boot :

[root@centos6-05 ~]# chkconfig httpd on
[root@centos6-05 ~]# chkconfig nagios on

5. Start httpd and nagios software :

[root@centos6-05 ~]# service httpd start
Starting httpd:                                            [  OK  ]
[root@centos6-05 ~]# service nagios start
Starting nagios: done.

6. Set Nagios Admin Panel Password:

[root@centos6-05 ~]# htpasswd -c /etc/nagios/passwd nagiosadmin
New password:
Re-type new password:
Adding password for user nagiosadmin

7. Navigate over to your IP address http://IPADDRESS/nagios and login using above “nagiosadmin” > However, you still able to change /etc/nagios/cgi.cfg and redefine authorized admin anytime later.

[root@centos6-05 ~]# vi /etc/nagios/cgi.cfg
..
..
authorized_for_system_information=nagiosadmin
..
..

How to Setup Webmin 1.670 on CentOS 6.5

Webmin is a freeware program that provide web-based interface for system administration and system configuration tool for administrators. Its for Unix-like systems, although recent versions can also be installed and run on Windows operating system. With Webmin, system administrators can perform daily systems administration task and administer the servers from graphical web-based interface which very useful for newbies who do not know much about unix/linux command line. As our future references, i will show you multiple ways to setup Webmin 1.670 on CentOS 6.5 :

Option A : Setup Webmin using Yum

1. Enabling Yum repository for Webmin. Create the /etc/yum.repos.d/webmin.repo file containing :

[root@centos6-05 ~]# vi /etc/yum.repos.d/webmin.repo
[Webmin]
name=Webmin Distribution Neutral
#baseurl=http://download.webmin.com/download/yum
mirrorlist=http://download.webmin.com/download/yum/mirrorlist
enabled=1

2. Download and install my GPG key :

[root@centos6-05 ~]# wget http://www.webmin.com/jcameron-key.asc
[root@centos6-05 ~]# rpm --import jcameron-key.asc

3. Run “yum install” command to install Webmin software and all required dependencies :

[root@centos6-05 ~]# yum install webmin -y

Option B : Setup Webmin using RPM file

1. If you plan to use RPM version of Webmin, you have to download the file for webmin.

[root@centos6-05 ~]# wget http://prdownloads.sourceforge.net/webadmin/webmin-1.670-1.noarch.rpm

2. Then run the command to install the downloaded RPM file :

[root@centos6-05 ~]# rpm -U webmin-1.670-1.noarch.rpm

Example :

[root@centos6-05 ~]# rpm -U webmin-1.670-1.noarch.rpm
Operating system is CentOS Linux
Webmin install complete. You can now login to http://centos6.5.ehowstuff.local:10000/
as root with your root password.

Option C : Setup Webmin using the tar.gz file

1. Download the Webmin and extract the tar.gz package.

[root@centos6-05 ~]# cd /tmp
[root@centos6-05 tmp]# wget http://prdownloads.sourceforge.net/webadmin/webmin-1.670.tar.gz
[root@centos6-05 tmp]# gunzip webmin-1.670.tar.gz
[root@centos6-05 tmp]# tar xf webmin-1.670.tar
[root@centos6-05 tmp]# cd webmin-1.670

2. When unpacked, the distribution creates a subdirectory called webmin-1.670. Run the setup.sh to start the installation s below command :

[root@centos6-05 webmin-1.670]# ./setup.sh /usr/local/webmin

Example :

[root@centos6-05 webmin-1.670]# ./setup.sh /usr/local/webmin
***********************************************************************
*            Welcome to the Webmin setup script, version 1.670        *
***********************************************************************
Webmin is a web-based interface that allows Unix-like operating
systems and common Unix services to be easily administered.

Installing Webmin from /tmp/webmin-1.670 to /usr/local/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.5

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

Enabling background status collection ..
..done

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

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

  http://centos6.5.ehowstuff.local:10000/

and login with the name and password you entered previously.

Install MySQL, Apache and PHP on CentOS 6.5

LAMP stand for Linux, Apache, MySQL and PHP which is group of software used to run an web applications. The combination of these software is called LAMP stack. This document will walk you through the steps to install MySQL, Apache and PHP on CentOS 6.5.


What is Apache ?

Apache httpd is one of the most popular web servers and has a lot of features that make it very extensible and useful for many different types of websites.

What is MySQL?
MySQL Database server is one of the most popular used database in the internet especially for content management and blogging site.

What is PHP?
PHP is a widely-used and open-source server-side scripting language that was especially designed for web development to produce dynamic web pages and can be embedded into HTML.

Steps :
1. Install MySQL, Apache and PHP :

[root@centos6-05 ~]# yum install mysql mysql-server httpd php* -y

2. Start Apache and MySQL :

[root@centos6-05 ~]# service httpd start
[root@centos6-05 ~]# service mysqld start

3. Check Apache, MySQL and PHP version :
Apache

[root@centos6-05 ~]# httpd -v
Server version: Apache/2.2.15 (Unix)
Server built:   Aug 13 2013 17:29:28

MySQL

[root@centos6-05 ~]# mysql -V
mysql  Ver 14.14 Distrib 5.1.71, for redhat-linux-gnu (x86_64) using readline 5.1

PHP

[root@centos6-05 ~]# php -v
PHP 5.3.3 (cli) (built: Dec 11 2013 03:29:57)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

4. Verifying Apache, MySQL and PHP :

Create a page called phpinfo.php under web root directory /var/www/html.

[root@centos6-05 ~]# vi /var/www/html/index.php
<?php

     phpinfo ();
?>

Restart Apache :

[root@centos6-05 ~]# service httpd restart

php-info

Setup vsftpd Service on CentOS 6.5

vsftpd is a free FTP service for UNIX and linux systems. It is very stable, fast and secure ftp server. In this post, i will share how to setup sftpd Service on CentOS 6.5. The steps has been tested working fine with other version of CentOS 6.

1. Install vsftpd ftp service :

[root@server-05 ~]# yum install vsftpd -y

Example :

[root@server-05 ~]# yum install vsftpd -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.upsi.edu.my
 * extras: mirror.upsi.edu.my
 * updates: mirror.upsi.edu.my
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package vsftpd.x86_64 0:2.2.2-11.el6_4.1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package              Arch                 Version                         Repository          Size
====================================================================================================
Installing:
 vsftpd               x86_64               2.2.2-11.el6_4.1                base               151 k

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

Total download size: 151 k
Installed size: 331 k
Downloading Packages:
vsftpd-2.2.2-11.el6_4.1.x86_64.rpm                                           | 151 kB     00:03
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : vsftpd-2.2.2-11.el6_4.1.x86_64                                                   1/1
  Verifying  : vsftpd-2.2.2-11.el6_4.1.x86_64                                                   1/1

Installed:
  vsftpd.x86_64 0:2.2.2-11.el6_4.1

Complete!

2. Install ftp client on linux :

[root@server-05 ~]# yum install ftp -y

3. Create local user1 to access ftp service.

[root@server-05 ~]# useradd user1
[root@server-05 ~]# passwd user1
Changing password for user user1.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.

4. Add user1 into vsftpd userlist as below :

[root@server-05 ~]# vi /etc/vsftpd/user_list
root
bin
daemon
adm
lp
sync
shutdown
halt
mail
news
uucp
operator
games
nobody
user1

5. Disabled anonymous access:

anonymous_enable=YES

to below :

anonymous_enable=NO

6. Add the following to bottom of the config file. If userlist_deny=NO, only allow users in this file :

userlist_deny=NO

7. Update the following banner :

ftpd_banner=Welcome to ehowstuff FTP service.

8. Start vsftpd service :

[root@server-05 ~]# service vsftpd start
Starting vsftpd for vsftpd:                                [  OK  ]

9. Configure vsftpd daemon start automatically on booting :

[root@server-05 ~]# chkconfig vsftpd on

10. Test ftp service connection from windows client using user1 :


C:\>ftp 192.168.0.5
Connected to 192.168.0.5.
220 Welcome to ehowstuff FTP service.
User (192.168.0.5:(none)): user1
331 Please specify the password.
Password:
230 Login successful.
ftp> bye
221 Goodbye.

11. Test ftp service connection from linux client using user1 :

[root@server-05 ~]# ftp 192.168.0.5
Connected to 192.168.0.5 (192.168.0.5).
220 Welcome to ehowstuff FTP service.
Name (192.168.0.5:root): user1
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> exit
221 Goodbye.

Download CentOS 6.5 x86_64 and x86 ISO

CentOS 6.5 has just been released on 1st December 2013. CentOS is an Enterprise-class Linux Distribution derived from sources freely provided to the public. It has 100% binary compatibility with its upstream source, Red Hat Enterprise Linux (RHEL).

Released Note :

http://wiki.centos.org/Manuals/ReleaseNotes/CentOS6.5

Major changes :
-The Precision Time Protocol – previously a technology preview – is now fully supported. The following drivers support network time stamping: bnx2x, tg3, e1000e, igb, ixgbe, and sfc.
-OpenSSL has been updated to version 1.0.1.
-OpenSSL and NSS now support TLS 1.1 and 1.2.
-KVM received various enhancements. These include improved read-only support of VMDK- and VHDX-Files, CPU hot plugging and updated virt-v2v-/virt-p2v-conversion tools.
-Hyper-V and VMware drivers have been updated.
-Updates to Evolution (2.32) and Libre Office (4.0.4).

Download URL for x86 and x64 ISO
http://mirrors.hostemo.com/CentOS/6.5/isos/x86_64/
http://mirrors.hostemo.com/CentOS/6.5/isos/i386/

Disable SELinux on CentOS 6.5

This post will show how to disable Security-Enhanced Linux (SELinux) on CentOS 6.5. The steps was very simple, but if we did not disable this feature, you may hit a problem when try to do software installation. SELinux checking for allowed operations after standard Linux discretionary access controls are checked.

1. Check selinux status :

[root@centos6 ~]# sestatus
SELinux status:                 enabled
SELinuxfs mount:                /selinux
Current mode:                   enforcing
Mode from config file:          enforcing
Policy version:                 24
Policy from config file:        targeted

2. Disable SELinux on CentOS 6.4 permanently :

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

Change “SELINUX=enforcing” to “SELINUX=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,
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

3. Reboot CentOS 6.5 Operating system :

[root@centos6 ~]# init 6

or

[root@centos6 ~]# reboot

How to Install VMware Tools on CentOS 6.5

vmwaretoolsVMware Tools is one of important components in order to run virtual machine (VM) with excellent performance. It is a group of utilities that help to enhances the overall performance of the virtual machine’s guest operating system (OS) and improves management of the VM. Without the VMware Tools, guest OS performance will lacks some of the important functionality. Below steps shows how to install the VMware Tools on CentOS 6.5 :

1. Install the prerequisites into your CentOS 6.5.

[root@centos6 ~]# yum install perl gcc make kernel-headers kernel-devel -y

Example.

[root@centos6 ~]# yum install perl gcc make kernel-headers kernel-devel -y
Loaded plugins: fastestmirror
base                                                                         | 3.7 kB     00:00
http://ossm.utm.my/centos/6.5/os/x86_64/repodata/617a880b84a87969e04bfeebb1b96d5f441da42ee931d374fa6b6d57decd821e-primary.sqlite.bz2: [Errno 12] Timeout on http://ossm.utm.my/centos/6.5/os/x86_64/repodata/617a880b84a87969e04bfeebb1b96d5f441da42ee931d374fa6b6d57decd821e-primary.sqlite.bz2: (28, 'Operation too slow. Less than 1 bytes/sec transfered the last 30 seconds')
Trying other mirror.
base/primary_db                                                              | 4.4 MB     00:49
extras                                                                       | 3.4 kB     00:00
extras/primary_db                                                            |  18 kB     00:00
updates                                                                      | 3.4 kB     00:00
updates/primary_db                                                           |  65 kB     00:00
Setting up Install Process
Package 1:make-3.81-20.el6.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package gcc.x86_64 0:4.4.7-4.el6 will be installed
--> Processing Dependency: libgomp = 4.4.7-4.el6 for package: gcc-4.4.7-4.el6.x86_64
--> Processing Dependency: cpp = 4.4.7-4.el6 for package: gcc-4.4.7-4.el6.x86_64
--> Processing Dependency: glibc-devel >= 2.2.90-12 for package: gcc-4.4.7-4.el6.x86_64
--> Processing Dependency: cloog-ppl >= 0.15 for package: gcc-4.4.7-4.el6.x86_64
--> Processing Dependency: libgomp.so.1()(64bit) for package: gcc-4.4.7-4.el6.x86_64
---> Package kernel-devel.x86_64 0:2.6.32-431.el6 will be installed
---> Package kernel-headers.x86_64 0:2.6.32-431.el6 will be installed
---> Package perl.x86_64 4:5.10.1-136.el6 will be installed
--> Processing Dependency: perl-libs = 4:5.10.1-136.el6 for package: 4:perl-5.10.1-136.el6.x86_64
--> Processing Dependency: perl-libs for package: 4:perl-5.10.1-136.el6.x86_64
--> Processing Dependency: perl(version) for package: 4:perl-5.10.1-136.el6.x86_64
--> Processing Dependency: perl(Pod::Simple) for package: 4:perl-5.10.1-136.el6.x86_64
--> Processing Dependency: perl(Module::Pluggable) for package: 4:perl-5.10.1-136.el6.x86_64
--> Processing Dependency: libperl.so()(64bit) for package: 4:perl-5.10.1-136.el6.x86_64
--> Running transaction check
---> Package cloog-ppl.x86_64 0:0.15.7-1.2.el6 will be installed
--> Processing Dependency: libppl_c.so.2()(64bit) for package: cloog-ppl-0.15.7-1.2.el6.x86_64
--> Processing Dependency: libppl.so.7()(64bit) for package: cloog-ppl-0.15.7-1.2.el6.x86_64
---> Package cpp.x86_64 0:4.4.7-4.el6 will be installed
--> Processing Dependency: libmpfr.so.1()(64bit) for package: cpp-4.4.7-4.el6.x86_64
---> Package glibc-devel.x86_64 0:2.12-1.132.el6 will be installed
--> Processing Dependency: glibc-headers = 2.12-1.132.el6 for package: glibc-devel-2.12-1.132.el6.x86_64
--> Processing Dependency: glibc-headers for package: glibc-devel-2.12-1.132.el6.x86_64
---> Package libgomp.x86_64 0:4.4.7-4.el6 will be installed
---> Package perl-Module-Pluggable.x86_64 1:3.90-136.el6 will be installed
---> Package perl-Pod-Simple.x86_64 1:3.13-136.el6 will be installed
--> Processing Dependency: perl(Pod::Escapes) >= 1.04 for package: 1:perl-Pod-Simple-3.13-136.el6.x86_64
---> Package perl-libs.x86_64 4:5.10.1-136.el6 will be installed
---> Package perl-version.x86_64 3:0.77-136.el6 will be installed
--> Running transaction check
---> Package glibc-headers.x86_64 0:2.12-1.132.el6 will be installed
---> Package mpfr.x86_64 0:2.4.1-6.el6 will be installed
---> Package perl-Pod-Escapes.x86_64 1:1.04-136.el6 will be installed
---> Package ppl.x86_64 0:0.10.2-11.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package                         Arch             Version                      Repository      Size
====================================================================================================
Installing:
 gcc                             x86_64           4.4.7-4.el6                  base            10 M
 kernel-devel                    x86_64           2.6.32-431.el6               base           8.7 M
 kernel-headers                  x86_64           2.6.32-431.el6               base           2.8 M
 perl                            x86_64           4:5.10.1-136.el6             base            10 M
Installing for dependencies:
 cloog-ppl                       x86_64           0.15.7-1.2.el6               base            93 k
 cpp                             x86_64           4.4.7-4.el6                  base           3.7 M
 glibc-devel                     x86_64           2.12-1.132.el6               base           978 k
 glibc-headers                   x86_64           2.12-1.132.el6               base           608 k
 libgomp                         x86_64           4.4.7-4.el6                  base           118 k
 mpfr                            x86_64           2.4.1-6.el6                  base           157 k
 perl-Module-Pluggable           x86_64           1:3.90-136.el6               base            40 k
 perl-Pod-Escapes                x86_64           1:1.04-136.el6               base            32 k
 perl-Pod-Simple                 x86_64           1:3.13-136.el6               base           212 k
 perl-libs                       x86_64           4:5.10.1-136.el6             base           578 k
 perl-version                    x86_64           3:0.77-136.el6               base            51 k
 ppl                             x86_64           0.10.2-11.el6                base           1.3 M

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

Total download size: 40 M
Installed size: 98 M
Downloading Packages:
(1/16): cloog-ppl-0.15.7-1.2.el6.x86_64.rpm                                  |  93 kB     00:00
(2/16): cpp-4.4.7-4.el6.x86_64.rpm                                           | 3.7 MB     00:42
(3/16): gcc-4.4.7-4.el6.x86_64.rpm                                           |  10 MB     01:40
(4/16): glibc-devel-2.12-1.132.el6.x86_64.rpm                                | 978 kB     00:09
(5/16): glibc-headers-2.12-1.132.el6.x86_64.rpm                              | 608 kB     00:06
(6/16): kernel-devel-2.6.32-431.el6.x86_64.rpm                               | 8.7 MB     01:25
(7/16): kernel-headers-2.6.32-431.el6.x86_64.rpm                             | 2.8 MB     00:30
(8/16): libgomp-4.4.7-4.el6.x86_64.rpm                                       | 118 kB     00:01
(9/16): mpfr-2.4.1-6.el6.x86_64.rpm                                          | 157 kB     00:01
(10/16): perl-5.10.1-136.el6.x86_64.rpm                                      |  10 MB     01:35
(11/16): perl-Module-Pluggable-3.90-136.el6.x86_64.rpm                       |  40 kB     00:00
(12/16): perl-Pod-Escapes-1.04-136.el6.x86_64.rpm                            |  32 kB     00:00
(13/16): perl-Pod-Simple-3.13-136.el6.x86_64.rpm                             | 212 kB     00:01
(14/16): perl-libs-5.10.1-136.el6.x86_64.rpm                                 | 578 kB     00:05
(15/16): perl-version-0.77-136.el6.x86_64.rpm                                |  51 kB     00:00
(16/16): ppl-0.10.2-11.el6.x86_64.rpm                                        | 1.3 MB     00:11
----------------------------------------------------------------------------------------------------
Total                                                               103 kB/s |  40 MB     06:35
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Importing GPG key 0xC105B9DE:
 Userid : CentOS-6 Key (CentOS 6 Official Signing Key) <centos-6-key@centos.org>
 Package: centos-release-6-5.el6.centos.11.1.x86_64 (@anaconda-CentOS-201311272149.x86_64/6.5)
 From   : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : 1:perl-Pod-Escapes-1.04-136.el6.x86_64                                          1/16
  Installing : 4:perl-libs-5.10.1-136.el6.x86_64                                               2/16
  Installing : 1:perl-Pod-Simple-3.13-136.el6.x86_64                                           3/16
  Installing : 3:perl-version-0.77-136.el6.x86_64                                              4/16
  Installing : 1:perl-Module-Pluggable-3.90-136.el6.x86_64                                     5/16
  Installing : 4:perl-5.10.1-136.el6.x86_64                                                    6/16
  Installing : ppl-0.10.2-11.el6.x86_64                                                        7/16
  Installing : cloog-ppl-0.15.7-1.2.el6.x86_64                                                 8/16
  Installing : mpfr-2.4.1-6.el6.x86_64                                                         9/16
  Installing : cpp-4.4.7-4.el6.x86_64                                                         10/16
  Installing : libgomp-4.4.7-4.el6.x86_64                                                     11/16
  Installing : kernel-headers-2.6.32-431.el6.x86_64                                           12/16
  Installing : glibc-headers-2.12-1.132.el6.x86_64                                            13/16
  Installing : glibc-devel-2.12-1.132.el6.x86_64                                              14/16
  Installing : gcc-4.4.7-4.el6.x86_64                                                         15/16
  Installing : kernel-devel-2.6.32-431.el6.x86_64                                             16/16
  Verifying  : 1:perl-Module-Pluggable-3.90-136.el6.x86_64                                     1/16
  Verifying  : kernel-headers-2.6.32-431.el6.x86_64                                            2/16
  Verifying  : cpp-4.4.7-4.el6.x86_64                                                          3/16
  Verifying  : glibc-devel-2.12-1.132.el6.x86_64                                               4/16
  Verifying  : 1:perl-Pod-Escapes-1.04-136.el6.x86_64                                          5/16
  Verifying  : libgomp-4.4.7-4.el6.x86_64                                                      6/16
  Verifying  : 4:perl-5.10.1-136.el6.x86_64                                                    7/16
  Verifying  : mpfr-2.4.1-6.el6.x86_64                                                         8/16
  Verifying  : 4:perl-libs-5.10.1-136.el6.x86_64                                               9/16
  Verifying  : 1:perl-Pod-Simple-3.13-136.el6.x86_64                                          10/16
  Verifying  : kernel-devel-2.6.32-431.el6.x86_64                                             11/16
  Verifying  : gcc-4.4.7-4.el6.x86_64                                                         12/16
  Verifying  : 3:perl-version-0.77-136.el6.x86_64                                             13/16
  Verifying  : ppl-0.10.2-11.el6.x86_64                                                       14/16
  Verifying  : cloog-ppl-0.15.7-1.2.el6.x86_64                                                15/16
  Verifying  : glibc-headers-2.12-1.132.el6.x86_64                                            16/16

Installed:
  gcc.x86_64 0:4.4.7-4.el6                          kernel-devel.x86_64 0:2.6.32-431.el6
  kernel-headers.x86_64 0:2.6.32-431.el6            perl.x86_64 4:5.10.1-136.el6

Dependency Installed:
  cloog-ppl.x86_64 0:0.15.7-1.2.el6                   cpp.x86_64 0:4.4.7-4.el6
  glibc-devel.x86_64 0:2.12-1.132.el6                 glibc-headers.x86_64 0:2.12-1.132.el6
  libgomp.x86_64 0:4.4.7-4.el6                        mpfr.x86_64 0:2.4.1-6.el6
  perl-Module-Pluggable.x86_64 1:3.90-136.el6         perl-Pod-Escapes.x86_64 1:1.04-136.el6
  perl-Pod-Simple.x86_64 1:3.13-136.el6               perl-libs.x86_64 4:5.10.1-136.el6
  perl-version.x86_64 3:0.77-136.el6                  ppl.x86_64 0:0.10.2-11.el6

Complete!

2. Attach the vmware tools sofware from vSphere client. Assumed that the host is ESXi 4.1.
1

3. Mount the attached vmware tool software.
[root@centos6 tmp]# mount /dev/cdrom /mnt
[root@centos6 tmp]# cd /mnt
[root@centos6 tmp]# ls
VMwareTools-8.3.7-341836.tar.gz  yum.log

4. Extract the VMware tools

[root@centos6 tmp]# tar xzvf VMwareTools-8.3.7-341836.tar.gz

5. Start install by issue command “./vmware-install.pl”

[root@centos6 tmp]# cd vmware-tools-distrib
[root@centos6 vmware-tools-distrib]# ls
bin  doc  etc  FILES  INSTALL  installer  lib  vmware-install.pl
[root@centos6 vmware-tools-distrib]# ./vmware-install.pl

Full installation as below :

[root@centos6 vmware-tools-distrib]# ./vmware-install.pl
Creating a new VMware Tools installer database using the tar4 format.

Installing VMware Tools.

In which directory do you want to install the binary files?
[/usr/bin]

What is the directory that contains the init directories (rc0.d/ to rc6.d/)?
[/etc/rc.d]

What is the directory that contains the init scripts?
[/etc/rc.d/init.d]

In which directory do you want to install the daemon files?
[/usr/sbin]

In which directory do you want to install the library files?
[/usr/lib/vmware-tools]

The path "/usr/lib/vmware-tools" does not exist currently. This program is
going to create it, including needed parent directories. Is this what you want?
[yes]

In which directory do you want to install the documentation files?
[/usr/share/doc/vmware-tools]

The path "/usr/share/doc/vmware-tools" does not exist currently. This program
is going to create it, including needed parent directories. Is this what you
want? [yes]

The installation of VMware Tools 8.3.7 build-341836 for Linux completed
successfully. You can decide to remove this software from your system at any
time by invoking the following command: "/usr/bin/vmware-uninstall-tools.pl".

Before running VMware Tools for the first time, you need to configure it by
invoking the following command: "/usr/bin/vmware-config-tools.pl". Do you want
this program to invoke the command for you now? [yes]

Initializing...

Stopping VMware Tools services in the virtual machine:
   Guest operating system daemon:                          [  OK  ]
   Virtual Printing daemon:                                [  OK  ]
   Unmounting HGFS shares:                                 [  OK  ]
   Guest filesystem driver:                                [  OK  ]

The module vmmemctl has already been installed on this system by another
installer or package and will not be modified by this installer.  Use the flag
--clobber-kernel-modules=vmmemctl to override.

Found a compatible pre-built module for vmhgfs.  Installing it...

Found a compatible pre-built module for vmxnet.  Installing it...

Found a compatible pre-built module for vmblock.  Installing it...

Found a compatible pre-built module for vmci.  Installing it...

Found a compatible pre-built module for vsock.  Installing it...

The module vmxnet3 has already been installed on this system by another
installer or package and will not be modified by this installer.  Use the flag
--clobber-kernel-modules=vmxnet3 to override.

The module pvscsi has already been installed on this system by another
installer or package and will not be modified by this installer.  Use the flag
--clobber-kernel-modules=pvscsi to override.

No X install found.

Creating a new initrd boot image for the kernel.
   Checking acpi hot plug                                  [  OK  ]
Starting VMware Tools services in the virtual machine:
   Switching to guest configuration:                       [  OK  ]
   VM communication interface:                             [  OK  ]
   VM communication interface socket family:               [  OK  ]
   Guest operating system daemon:                          [  OK  ]
   Virtual Printing daemon:                                [  OK  ]

The configuration of VMware Tools 8.3.7 build-341836 for Linux for this running
kernel completed successfully.

You must restart your X session before any mouse or graphics changes take
effect.

You can now run VMware Tools by invoking the following command:
"/usr/bin/vmware-toolbox" during an X server session.

To enable advanced X features (e.g., guest resolution fit, drag and drop, and
file and text copy/paste), you will need to do one (or more) of the following:
1. Manually start /usr/bin/vmware-user
2. Log out and log back into your desktop session; and,
3. Restart your X session.

Enjoy,

--the VMware team

/sbin/restorecon:  Warning no default label for /tmp/vmware-block-restore0/tmp_file

How to Install and Use Traceroute in Linux RHEL 6/7, CentOS 6/7, Oracle Linux 6/7

Traceroute command is a network diagnostic tool for displaying the route packets take to network host or destination. It shows how long each hop will takes and how many hops that the packet requires to reach the specify destination. In linux, traceroute command is used while in windows and dos environment, they used tracert command. In this post i will show you how to install and how to use traceroute command to diagnose your IP network related issues. This steps has been tested on RHEL 6/7, CentOS 6/7 and Oracle Linux 6/7.

1. If your linux VPS or dedicated server does not installed with traceroute, it will return this warning :

# traceroute www.google.com
-bash: traceroute: command not found

Or you can verify the traceroute install or not by issue which command :

# which traceroute
/usr/bin/which: no traceroute in (/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)

2. To install traceroute, run the following command :

# yum install traceroute -y

3. Verify the command install or not :

# which traceroute
/bin/traceroute

4. How to use traceroute command :

a. Find the network path from my centos6 server to google.com :

# traceroute [options]

Example :

# traceroute www.google.com
traceroute to www.google.com (58.27.108.153), 30 hops max, 60 byte packets
 1  192.168.2.1 (192.168.2.1)  9.233 ms  9.020 ms  8.857 ms
 2  219.93.218.177 (219.93.218.177)  20.717 ms  20.529 ms  27.526 ms
 3  60.49.55.93 (60.49.55.93)  57.368 ms  57.446 ms  57.187 ms
 4  10.55.32.58 (10.55.32.58)  76.846 ms 10.55.32.56 (10.55.32.56)  66.418 ms  66.906 ms
 5  58.27.105.125 (58.27.105.125)  75.779 ms  65.556 ms  65.592 ms
 6  * * *
 7  * * *
 8  * * *
 9  * * *
10  * * *
11  * * *
12  * * *
13  * * *
14  * * *
15  * * *
16  * * *
17  * * *
18  * * *
19  * * *
20  * * *
21  * * *
22  * * *
23  * * *
24  * * *
25  * * *
26  * * *
27  * * *
28  * * *
29  * * *
30  * * *

1 is the internet gateway on the network this traceroute was done (ADSL modem local IP)
2 is the ISP the origin computer is connected to.

My PPPoE modem WAN IP details :
1

b. Find the network path from my centos6 server to google.com and do not resolve IP addresses to their domain names :

# traceroute www.google.com -n

c. Find the network path from my centos6 server to google.com and set the number of seconds to wait for response to a probe to 0.1 seconds (Default is 5.0) :

# traceroute www.google.com -w 0.1

d. Find the network path from my centos6 server to google.com and set the number of probes per each hop to 5 (Default is 3) :

# traceroute www.google.com -q 5

5. Display basic command line options help for more usage :

# traceroute --help
Usage:
  traceroute [ -46dFITnreAUV ] [ -f first_ttl ] [ -g gate,... ] [ -i device ] [ -m max_ttl ] [ -N squeries ] [ -p port ] [ -t tos ] [ -l flow_label ] [ -w waittime ] [ -q nqueries ] [ -s src_addr ] [ -z sendwait ] host [ packetlen ]
Options:
  -4                          Use IPv4
  -6                          Use IPv6
  -d  --debug                 Enable socket level debugging
  -F  --dont-fragment         Do not fragment packets
  -f first_ttl  --first=first_ttl
                              Start from the first_ttl hop (instead from 1)
  -g gate,...  --gateway=gate,...
                              Route packets through the specified gateway
                              (maximum 8 for IPv4 and 127 for IPv6)
  -I  --icmp                  Use ICMP ECHO for tracerouting
  -T  --tcp                   Use TCP SYN for tracerouting
  -i device  --interface=device
                              Specify a network interface to operate with
  -m max_ttl  --max-hops=max_ttl
                              Set the max number of hops (max TTL to be
                              reached). Default is 30
  -N squeries  --sim-queries=squeries
                              Set the number of probes to be tried
                              simultaneously (default is 16)
  -n                          Do not resolve IP addresses to their domain names
  -p port  --port=port        Set the destination port to use. It is either
                              initial udp port value for "default" method
                              (incremented by each probe, default is 33434), or
                              initial seq for "icmp" (incremented as well,
                              default from 1), or some constant destination
                              port for other methods (with default of 80 for
                              "tcp", 53 for "udp", etc.)
  -t tos  --tos=tos           Set the TOS (IPv4 type of service) or TC (IPv6
                              traffic class) value for outgoing packets
  -l flow_label  --flowlabel=flow_label
                              Use specified flow_label for IPv6 packets
  -w waittime  --wait=waittime
                              Set the number of seconds to wait for response to
                              a probe (default is 5.0). Non-integer (float
                              point) values allowed too
  -q nqueries  --queries=nqueries
                              Set the number of probes per each hop. Default is
                              3
  -r                          Bypass the normal routing and send directly to a
                              host on an attached network
  -s src_addr  --source=src_addr
                              Use source src_addr for outgoing packets
  -z sendwait  --sendwait=sendwait
                              Minimal time interval between probes (default 0).
                              If the value is more than 10, then it specifies a
                              number in milliseconds, else it is a number of
                              seconds (float point values allowed too)
  -e  --extensions            Show ICMP extensions (if present), including MPLS
  -A  --as-path-lookups       Perform AS path lookups in routing registries and
                              print results directly after the corresponding
                              addresses
  -M name  --module=name      Use specified module (either builtin or external)
                              for traceroute operations. Most methods have
                              their shortcuts (`-I' means `-M icmp' etc.)
  -O OPTS,...  --options=OPTS,...
                              Use module-specific option OPTS for the
                              traceroute module. Several OPTS allowed,
                              separated by comma. If OPTS is "help", print info
                              about available options
  --sport=num                 Use source port num for outgoing packets. Implies
                              `-N 1'
  -U  --udp                   Use UDP to particular port for tracerouting
                              (instead of increasing the port per each probe),
                              default port is 53
  -UL                         Use UDPLITE for tracerouting (default dest port
                              is 53)
  -P prot  --protocol=prot    Use raw packet of protocol prot for tracerouting
  --mtu                       Discover MTU along the path being traced. Implies
                              `-F -N 1'
  --back                      Guess the number of hops in the backward path and
                              print if it differs
  -V  --version               Print version info and exit
  --help                      Read this help and exit

Arguments:
+     host          The host to traceroute to
      packetlen     The full packet length (default is the length of an IP
                    header plus 40). Can be ignored or increased to a minimal
                    allowed value