How to Setup VNC Server on CentOS 6.3

VNC-logoVNC is a protocol that is used to display an X windows session running on another computer over the network. VNC server must be install at the target(destination) workstation and source or client will access the target workstatio using VNC client. In this post, it was assumed that the VNC server will be install on CentOS 6.3 and will be access by Win XP client using portable VNC client(VNC viewer). Meaning to say that the desktop on CentOS will be shared with others. If you are running CentOS 5 and below, yum command install will recognize vnc-server. But in CentOS 6, If you are running CentOS 6, the server is: tigervnc-server not: vnc-server will be replace with tigervnc-server not.

1. Install VNC server on CentOS 6.3 using yum command :

[root@CentOS6 ~]# yum install tigervnc-server -y

2. As a root, create the user that will use VNC user accounts :

[root@CentOS6 ~]# useradd ehowstuff
[root@CentOS6 ~]# useradd mhstar
[root@CentOS6 ~]# passwd ehowstuff
[root@CentOS6 ~]# passwd mhstar

3. Edit /etc/sysconfig/vncservers, and add the following :

VNCSERVERS="1:ehowstuff 2:mhstar"
VNCSERVERARGS[1]="-geometry 800x600"
VNCSERVERARGS[2]="-geometry 640x480"

ehowstuff will have an 800 by 600 screen and mhstar will have a 640×480 screen.

4. Set VNC passwords for each users :

[root@CentOS6 ~]# su - ehowstuff
[ehowstuff@CentOS6 ~]$ vncpasswd
Password:
Verify:
[ehowstuff@CentOS6 ~]$ cd .vnc
[ehowstuff@CentOS6 .vnc]$ ls
passwd
[ehowstuff@CentOS6 .vnc]$ exit
logout
[root@CentOS6 ~]# su - mhstar
[mhstar@CentOS6 ~]$ vncpasswd
Password:
Verify:
[mhstar@CentOS6 ~]$ cd .vnc
[mhstar@CentOS6 .vnc]$ ls
passwd
[mhstar@CentOS6 .vnc]$ exit
logout

Switch user into the account for each user. Run vncpasswd will create the ~/.vnc directory.

5. Start vncserver as a root :

[root@CentOS6 ~]# service vncserver start
Starting VNC server: 1:ehowstuff xauth:  creating new authority file /home/ehowstuff/.Xauthority
xauth: (stdin):1:  bad display name "CentOS6.3:1" in "add" command

New 'CentOS6.3:1 (ehowstuff)' desktop is CentOS6.3:1

Creating default startup script /home/ehowstuff/.vnc/xstartup
Starting applications specified in /home/ehowstuff/.vnc/xstartup
Log file is /home/ehowstuff/.vnc/CentOS6.3:1.log

2:mhstar xauth:  creating new authority file /home/mhstar/.Xauthority
xauth: (stdin):1:  bad display name "CentOS6.3:2" in "add" command

New 'CentOS6.3:2 (mhstar)' desktop is CentOS6.3:2

Creating default startup script /home/mhstar/.vnc/xstartup
Starting applications specified in /home/mhstar/.vnc/xstartup
Log file is /home/mhstar/.vnc/CentOS6.3:2.log

                                                           [  OK  ]

6. Stopping the vncserver as root :

[root@CentOS6 ~]# service vncserver stop
Shutting down VNC server: 1:ehowstuff 2:mhstar             [  OK  ]

7. Set the VNC service to be automatically start at boot :

[root@CentOS6 ~]# chkconfig vncserver on

8. Use VNC viewer to connect VNC server :


Example :

How to Install Google Chrome on CentOS 6.3

google chromeGoogle Chrome is a lightweight and fast browsing alternative browser that combines a minimal design with sophisticated technology to make the web faster, safer, and easier. It was designed to be simple and stylish not only on windows operating system, but in CentOS or other linux operating system as well. This post will show you the steps to install Google Chrome on CentOS 6.3.

1. Prepare repository :

[root@CentOS6 ~]# vi /etc/yum.repos.d/google-chrome.repo

Add the following into google-chrome.repo for CentOS 32 Bit:

[google-chrome]
name=google-chrome - 32-bit
baseurl=http://dl.google.com/linux/chrome/rpm/stable/i386
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub

Add the following into google-chrome.repo for CentOS 64 Bit:

[google-chrome]
name=google-chrome - 64-bit
baseurl=http://dl.google.com/linux/chrome/rpm/stable/x86_64
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub

2. Install the google chrome stable version :

[root@CentOS6 ~]# yum install google-chrome-stable -y

How to Install Adobe Reader on CentOS 6.3

adobe readerAdobe Reader is the free program created and distributed by Adobe Systems and useful for viewing, reading and interacting with PDF files. It’s also known as Acrobat Reader. In this post, i will share with you on how to install Adobe Reader on CentOS 6.3 32 bit.

1. Download Adobe Repository 32-bit x86 :

[root@CentOS6 ~]# wget http://linuxdownload.adobe.com/adobe-release/adobe-release-i386-1.0-1.noarch.rpm

2. Install the Adobe Repository 32-bit x86 :

[root@CentOS6 ~]# rpm -ivh adobe-release-i386-1.0-1.noarch.rpm
warning: adobe-release-i386-1.0-1.noarch.rpm: Header V3 DSA/SHA1 Signature, key ID f6777c67: NOKEY
Preparing...                ########################################### [100%]
   1:adobe-release-i386     ########################################### [100%]
[root@CentOS6 ~]# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-adobe-linux

3. Now you ready to install Adobe Reader on CentOS 6.3 :

[root@CentOS6 ~]# yum install AdobeReader_enu -y

How to Install Adobe Flash Player on CentOS 6.3

Adobe FlashAdobe Flash Player is an open source cross-platform application for web browsers that is used for streaming multimedia files like audio and video on a computer web browser like Firefox, Chrome, Opera, Safari etc. It will very useful when you want to browse the website such as You-tube. To install Adobe Flash Player you’ll need to change to root, install Adobe’s YUM repository, import the associated GPG key, update the repositories and install Adobe Flash Player. This post will show the simple steps to install Adobe Flash Player on CentOS 6.3. This post tested on 32 bit of CentOS 6.3.

1. Download Adobe Repository 32-bit x86 :

[root@CentOS6 ~]# wget http://linuxdownload.adobe.com/adobe-release/adobe-release-i386-1.0-1.noarch.rpm

2. Install the Adobe Repository 32-bit x86 :

[root@CentOS6 ~]# rpm -ivh adobe-release-i386-1.0-1.noarch.rpm
warning: adobe-release-i386-1.0-1.noarch.rpm: Header V3 DSA/SHA1 Signature, key ID f6777c67: NOKEY
Preparing...                ########################################### [100%]
   1:adobe-release-i386     ########################################### [100%]
[root@CentOS6 ~]# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-adobe-linux

3. Now you ready to install Adobe Flash Player on CentOS 6.3 :

[root@CentOS6 ~]# yum install flash-plugin -y

Example :

[root@CentOS6 ~]# yum install flash-plugin -y
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base: mirror.nus.edu.sg
 * extras: mirror.nus.edu.sg
 * updates: centos.ipserverone.com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package flash-plugin.i386 0:11.2.202.261-release will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package               Arch          Version                        Repository                 Size
====================================================================================================
Installing:
 flash-plugin          i386          11.2.202.261-release           adobe-linux-i386          6.6 M

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

Total download size: 6.6 M
Installed size: 18 M
Downloading Packages:
flash-plugin-11.2.202.261-release.i386.rpm                                   | 6.6 MB     02:16
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Installing : flash-plugin-11.2.202.261-release.i386                                           1/1
  Verifying  : flash-plugin-11.2.202.261-release.i386                                           1/1

Installed:
  flash-plugin.i386 0:11.2.202.261-release

Complete!

4. Verify Adobe Flash Player Installed or not :

How to Remove Volume Group and Physical Volume on LVM

icon-redhatlinuxBasically, adding and removing LVM will always involves these three logical “layers” which are Physical volumes (pv), Volume groups (vg) and Logical volumes (lv). This post assumed that the Logical volumes haven’t created. In certain situation, linux administrators are required to remove the existing Physical Volume or Volume Group only. It is possible to perform the required task if that system administrator has the right skill on linux. The steps as below :

1. Display the physical volumes and Volume Group using pvdisplay command :

[root@centos63 ~]# pvdisplay
  --- Physical volume ---
  PV Name               /dev/sdb1
  VG Name               vg_data
  PV Size               4.99 GiB / not usable 2.41 MiB
  Allocatable           yes
  PE Size               4.00 MiB
  Total PE              1278
  Free PE               1278
  Allocated PE          0
  PV UUID               qTmTeq-8qoL-xxEk-Dj5V-zOjl-vEag-P6Jl7L

2. Remove the Volume Group using vgremove command :

[root@centos63 ~]# vgremove vg_data
  Volume group "vg_data" successfully removed

3. Remove Physical Volume using pvremove command :

[root@centos63 ~]# pvremove /dev/sdb1
  Labels on physical volume "/dev/sdb1" successfully wiped

Additional Note :
How to Remove a Logical Volume on CentOS 6.3/RHEL6

Configure Network Time Protocol (NTP) on CentOS 6.3

Linux LogoAs opposed to the manual setup, it is possible to synchronize the system clock with a remote server over the Network Time Protocol (NTP). NTP is an Internet protocol used to synchronize the clocks of computers or servers to some NTP server on internet or intranet.

Steps A
1. To synchronization immediately or for the one-time synchronization only, use the ntpdate command as below :

[root@centos63 ~]# ntpdate -q time.internet.com

2. Enable running the ntpdate at boot time:

[root@centos63 ~]# chkconfig ntpdate on

Steps B
However, there are alternative way to set the ntpd daemon to synchronize the time at boot time automatically :

1. Install ntpd service daemon :

[root@centos63 ~]# yum install ntp -y

2. Open the NTP configuration file /etc/ntp.conf :

[root@centos63 ~]# vi /etc/ntp.conf

3. Now add or edit the list of public NTP servers.

server 0.asia.pool.ntp.org
server 1.asia.pool.ntp.org
server 2.asia.pool.ntp.org
server 3.asia.pool.ntp.org

4. Set the proper permissions, giving the unrestricted access to localhost only:

restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
restrict 127.0.0.1
restrict -6 ::1

5. Restart the NTP daemon:

[root@centos63 ~]# service ntpd restart
Shutting down ntpd:                                        [  OK  ]
Starting ntpd:                                             [  OK  ]

6.Set ntpd daemon is started at boot time :

[root@centos63 ~]# chkconfig ntpd on

Prerequisites Checking Before Install Zimbra Collaboration Suite 8 on CentOS 6.3

zimbraBefore you start installing Zimbra Collaboration Suite (ZCS) 8.0.1 or 8.0.2, there are a few prerequisites checking have to be performed. This is to ensure that the installation running smoothly without any interruption while saving your time to troubleshoot. I have installed Zimbra Collaboration Suite 8.0.1 and 8.0.2 on many CentOS 6.3 and i would like to share my experiences.

1. Make sure your target mail domain (e.g ehowstuff.local) has mx record on your DNS server.

[root@mail ~]# host -t mx ehowstuff.local
ehowstuff.local mail is handled by 0 ehowstuff.local.

2. Stop and disabled the following services :

[root@mail ~]# service iptables stop
[root@mail ~]# service ip6tables stop
[root@mail ~]# service sendmail stop
[root@mail ~]# service postfix stop

3. Disabled auto start the following services :

[root@mail ~]# chkconfig ip6tables off
[root@mail ~]# chkconfig iptables off
[root@mail ~]# chkconfig sendmail off
[root@mail ~]# chkconfig postfix off

4. Disabled Selinux :

[root@mail ~]# setenforce 0
[root@mail ~]# vi /etc/selinux/config

# 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

5. Make sure the following dependencies software has been installed :

[root@mail ~]# yum install perl nc sudo sysstat -y