Install Postgresql 9.3 on centos 6.5

I used to have Mysql installed on my webserver, however recently I came across some examples where the worst side of mysql was shown. And I was convinced I should be using postgresql instead.

Therefor underneath you’ll find a short guide on howto install postgresql.

 wget http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-centos93-9.3-1.noarch.rpm
rpm -ivh pgdg-centos93-9.3-1.noarch.rpm
chkconfig postgresql-9.3 --levels 2345 on
service postgresql-9.3 initdb
service postgresql-9.3 start

Spotweb on Centos 6.5

Disclaimer: This is not my product, nor do I maintain it. I merely had some struggles getting this to work for testing purposes and setup a simple guide for future reference.

Spotweb is a web utility which indexes various posts on usenet.

Prerequisites:
– Make sure your /var (or wheve-ever your www folder is located has at least 15GB)
– Have apache2, php5 and mysql 5 installed (standard repo is good): This guide will not handle the installation of a webserver with php and mysql.
– Your server / vm should have 2 cores and at least 1GB of RAM

Step 1: Installing software + deploying spotweb

yum install git
cd /var/www/html/ -your own folder-
git clone https://github.com/spotweb/spotweb.git
cd spotweb/
mkdir cache
chmod 777 cache/

Step 2: Installing spotweb
Navigate in your browser to either localhost or . For example: http://10.0.0.143/install.php
Check if everything is OK.
The following two items may be NOT OK:
– PostgresqlDB
– Own settings file

If everything is oke, click next.

Step 3: Setting the db settings
In this screen leave everything as is, except for the password. Change it to something you seem fit.
Click next

Step 4: Configuring usenet provider & admin user
In this screen fill in your own usenet provider
Hint: I prefer to use custom (at the bottom) and port 119. SSL seems to have troubles with retrieving from time to time.

In the next screen you can create your own admin user.
Admin /admin/ administrator etc are forbidden.
Just choose your own nickname and strong password!
Fill in the rest of the details (I wouldnt recommend using your real name and email).

Press next for the last step in the web install phase.

Step 5: Creating db file
Go back to the command line

vim dbsettings.inc.php
copy / paste the settings as shown into this file and save it.

Don’t forget to check if the url works! 🙂

Step 6: Install.php
To make sure nobody can ruin your installation or hijack it we’re going to move the install.php
Either remove it, or move it to your home directory

mv install.php /home/<username>spotweb
OR
rm -f install.php

Step 7: Backing up the folder in tar.gz for future use

cd .. (make sure u are one level above the spotweb folder)
tar -cvf spotweb.tar.gz spotweb/
mv spotweb.tar.gz /home/<user>/spotweb/

Step 8: Creating a database for spotweb

mysql -u root -p
CREATE DATABASE spotweb;
CREATE USER 'spotweb'@'localhost' IDENTIFIED BY '<your own password>';
GRANT ALL PRIVILEGES ON spotweb.* TO spotweb @'localhost' IDENTIFIED BY '<your own password>';
quit;

Step 9: Making a cronjob for retrieving the spots

crontab -e */30 * * * * cd /path/to/spotweb && /usr/bin/php retrieve.php > /dev/null
service crond restart
crontab -l Now this rule should be shown:
crontab -e */30 * * * * cd /path/to/spotweb && /usr/bin/php retrieve.php > /dev/null

Step 10: Login to spotweb
Use the credentials u choose during installation.
In the top right corner press config > settings > retrieve
Check with your usenet provider how much retention you have and fill in the correct number.

I am still toying around with the other settings. Check back later to see what I used.

Tips and tricks:
– Git pull can be used inside the spotweb directory to update to a newer version (backup before you do!)
– php upgrade-db.php can be used to check the database when applying a newer version of spotweb.

LVM tutorial

The scope of this article is to extend the ‘/var’ on my LVM.
* You have already extended the harddisk in ESXi

fdisk -l
fdisk /dev/sda

In fdisk perform the following

p (to show the partition information)
Command (m for help): p

Disk /dev/sda: 36.7 GB, 36679188480 bytes
255 heads, 63 sectors/track, 4459 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000f1113

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          64      512000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              64        1849    14334976   8e  Linux LVM

Leave the the fdisk utility and start vgdisplay

[root@locke ~]# vgdisplay
  --- Volume group ---
  VG Name               vg_locke
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  6
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                5
  Open LV               5
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               13.66 GiB
  PE Size               32.00 MiB
  Total PE              437
  Alloc PE / Size       437 / 13.66 GiB
  Free  PE / Size       0 / 0
  VG UUID               EryR1g-t5lD-ZVnE-lZcB-cb0z-3vig-5UWUS8

Watch the Free PE / Size. It is zero now. So no room to extend. However we will now add an extra disk.

fdisk /dev/sda
n (new partition)
p (primary table)
Select partition: 3
--> follow the suggested steps.
t (change label)
8e (Linux LVM)
w (write to table and exit)

Now create a physical volume

[root@locke ~]# pvcreate /dev/sda3
  Physical volume "/dev/sda3" successfully created
[root@locke ~]# pvdisplay
  --- Physical volume ---
  PV Name               /dev/sda2
  VG Name               vg_locke
  PV Size               13.67 GiB / not usable 15.00 MiB
  Allocatable           yes (but full)
  PE Size               32.00 MiB
  Total PE              437
  Free PE               0
  Allocated PE          437
  PV UUID               GAJzPC-8XLV-z7xD-GzU7-ss7u-IIVb-bHcpBR

  "/dev/sda3" is a new physical volume of "20.00 GiB"
  --- NEW Physical volume ---
  PV Name               /dev/sda3
  VG Name
  PV Size               20.00 GiB
  Allocatable           NO
  PE Size               0
  Total PE              0
  Free PE               0
  Allocated PE          0
  PV UUID               0SMW7L-1JyG-04Zx-UIlx-XUzf-i2Qw-2yGhIv

[root@locke ~]# vgdisplay
  --- Volume group ---
  VG Name               vg_locke
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  6
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                5
  Open LV               5
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               13.66 GiB
  PE Size               32.00 MiB
  Total PE              437
  Alloc PE / Size       437 / 13.66 GiB
  Free  PE / Size       0 / 0
  VG UUID               EryR1g-t5lD-ZVnE-lZcB-cb0z-3vig-5UWUS8

Extend the volumegroup “vg_locke” with the new physical volume /dev/sda3:

[root@locke ~]# vgextend vg_locke /dev/sda3
  Volume group "vg_locke" successfully extended

[root@locke ~]# vgdisplay
  --- Volume group ---
  VG Name               vg_locke
  System ID
  Format                lvm2
  Metadata Areas        2
  Metadata Sequence No  7
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                5
  Open LV               5
  Max PV                0
  Cur PV                2
  Act PV                2
  VG Size               33.62 GiB
  PE Size               32.00 MiB
  Total PE              1076
  Alloc PE / Size       437 / 13.66 GiB
  Free  PE / Size       639 / 19.97 GiB
  VG UUID               EryR1g-t5lD-ZVnE-lZcB-cb0z-3vig-5UWUS8

In the next step we will extend VAR with the free amount of PE:

[root@locke ~]# lvextend -l 639 /dev/mapper/vg_locke-var
  Extending logical volume var to 19.97 GiB
  Logical volume var successfully resized

[root@locke ~]# vgdisplay
  --- Volume group ---
  VG Name               vg_locke
  System ID
  Format                lvm2
  Metadata Areas        2
  Metadata Sequence No  8
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                5
  Open LV               5
  Max PV                0
  Cur PV                2
  Act PV                2
  VG Size               33.62 GiB
  PE Size               32.00 MiB
  Total PE              1076
  Alloc PE / Size       919 / 28.72 GiB
  Free  PE / Size       157 / 4.91 GiB
  VG UUID               EryR1g-t5lD-ZVnE-lZcB-cb0z-3vig-5UWUS8

Final check to see if everything succeeded. It seems so. However the extra space cannot be used yet. A resize has to performed in order to be able to make use of the new space.

[root@locke ~]# fdisk -l
Disk /dev/sda: 36.7 GB, 36679188480 bytes
255 heads, 63 sectors/track, 4459 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000f1113

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          64      512000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              64        1849    14334976   8e  Linux LVM
/dev/sda3            1849        4459    20968917+  8e  Linux LVM

Disk /dev/mapper/vg_locke-swap: 939 MB, 939524096 bytes
255 heads, 63 sectors/track, 114 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg_locke-root: 5268 MB, 5268045824 bytes
255 heads, 63 sectors/track, 640 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg_locke-opt: 2113 MB, 2113929216 bytes
255 heads, 63 sectors/track, 257 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg_locke-temp: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg_locke-var: 21.4 GB, 21441282048 bytes
255 heads, 63 sectors/track, 2606 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Perform the following command:

resize2fs /dev/mapper/vg_locke-var

The volume will extend now and the space is useable on VAR:

[root@locke ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_locke-root
                      4.9G  2.3G  2.4G  49% /
tmpfs                 499M     0  499M   0% /dev/shm
/dev/sda1             485M   57M  403M  13% /boot
/dev/mapper/vg_locke-opt
                      2.0G   35M  1.9G   2% /opt
/dev/mapper/vg_locke-temp
                     1008M   34M  924M   4% /tmp
/dev/mapper/vg_locke-var
                       20G  4.6G   15G  25% /var

Static ip Freebsd 10 (ZFSguru)

Small tutorial about the static ip in Freebsd (10)

My internal network details are as follow:

Address: 192.168.0.103
netmask: 255.255.255.0
gateway: 192.168.0.1
DNS1: 192.168.0.122
domain: domain.com (changed for privacy reasons)
*** I use vmxnet 3 adapter from ESXi 5.* ***

We’re going to work in the standard config files
/etc/rc.conf (networking)
/etc/resolv.conf (DNS)

Step 1:
ee is the default editor in freebsd.

ee /etc/rc.conf

Standard the file has the following settings:

hostname = zfsguru.bsd

ifconfig_default=DHCP
#ifconfig_em0=inet 10.0.0.101 netmask 255.255.255.0

#defaultrouter = 10.0.0.1

Change those to: (please use your own network settings)

hostname = aristoteles.domain.com

#ifconfig_default=DHCP
#ifconfig_em0=inet 10.0.0.101 netmask 255.255.255.0
ifconfig_vmx0=inet 192.168.0.103 netmask 255.255.255.0

defaultrouter=192.168.0.1

Step 2: editing resolv.conf

ee /etc/resolv.conf
#generated by resolvconf
search domain.com
nameserver 192.168.0.122

Step 3: restart networking and routing

/etc/rc.d/netif restart
/etc/rc.d/routing stop
/etc/rc.d/routing start

Step 4: Results

[root@aristoteles /home/ssh]# ifconfig
vmx0: flags=8843&lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&gt; metric 0 mtu 1500
        options=60039b&lt;RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,TSO6,RXCSUM_IPV6,TXCSUM_IPV6&gt;
        ether 00:0c:29:0a:04:11
        inet 192.168.0.103 netmask 0xffffff00 broadcast 192.168.0.255
        inet6 fe80::20c:29ff:fe0a:411%vmx0 prefixlen 64 scopeid 0x1
        nd6 options=29&lt;PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL&gt;
        media: Ethernet autoselect
        status: active
lo0: flags=8049&lt;UP,LOOPBACK,RUNNING,MULTICAST&gt; metric 0 mtu 16384
        options=600003&lt;RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6&gt;
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
        inet 127.0.0.1 netmask 0xff000000
        nd6 options=21&lt;PERFORMNUD,AUTO_LINKLOCAL&gt;
[root@aristoteles /home/ssh]# cat /etc/resolv.conf
# Generated by resolvconf
search domain.com
nameserver 192.168.0.122

Compile Zabbix 2.2.6 LTS on Centos 6.4 x64

Complete step by step guide on how to compile zabbix.

!!! Please be aware this is still heavily under construction! I decided to use the appliance instead!!!

Prequisites:
– Centos 6.5 X64 minimal or net-install with basic server (installed)
– root access
– Mysql installed
– Apache installed
– ssh access
– static ip

Step 1: Download & extract package and make directory

cd /home/&lt;user&gt;
mkdir zabbix
cd zabbix
wget http://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Stable/2.2.6/zabbix-2.2.6.tar.gz
tar -xzvf zabbix-2.2.6.tar.gz
cd zabbix-2.2.6

Step 2: Make group and user
! change to root !

sudo su
groupadd zabbix
useradd -g zabbix zabbix

Step 2: Install dependencies etc

yum -y install gcc libxml2-devel net-snmp-devel libcurl curl curl-devel rpmdevtools kernel-devel 
yum -y install mysql-devel
cd 

Step 3: Configure zabbix & make install

cd /home/&lt;user&gt;/zabbix-2.2.6/ (if you were not already).
./configure --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2
make install

You know have compiled your own zabbix

Step 4: Create an RPM package:

mkdir /home/&lt;user&gt;/zabbix
cd /home/&lt;user&gt;/zabbix
wget http://dag.wieers.com/rpm/packages/checkinstall/checkinstall-1.6.0-3.el5.rf.i386.rpm
rpm -ivh checkinstall-1.6.0-3.el5.rf.i386.rpm 
cd zabbix-2.2.6
checkinstall --nodoc --install=yes -y

Step 5: Install RPM package: WORK IN PROGRESS!

rpm -ivh &lt;zabbix&gt;.rpm

Step 6: Configure config files
Sources:
1. https://www.zabbix.com/wiki/howto/install/centos/centosinstall
2. https://www.zabbix.com/documentation/2.2/manual/installation/install

Network settings with custom DNS on Ubuntu Desktop 12.04(.5) LTS

So recently i set up a virtual Ubuntu desktop, so i could work with my vsphere web client.
However it took me some effort in using the DNS server on a remote network (connection via host to host VPN)

I kept getting the message that 127.0.0.1 was my primairy dns and i couldnt reach certain url’s which i had setup in my DNS server.

Note:
192.168.0.122 and epicurus are my DNS server.

cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.0.1
search domainname.com
$ ping -c 4 epicurus
ping: unknown host epicurus
$ ping -c 4 epicurus.domainname.com
ping: unknown host epicurus.domainname.com
$ nslookup epicurus.domainname.com
Server:     127.0.0.1
Address:    127.0.0.1#53

** server can't find epicurus.domainname.com: NXDOMAIN

I did the following to get it working.

First of all set the following in /etc/network/interfaces:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.1.101
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
dns-nameservers 192.168.0.122
dns-search domainname.com

Edit by commenting out dnsmasq in /etc/NetworkManager/NetworkManager.conf

#dns=dnsmasq

Perform a

sudo service network-manager restart

do a ifconfig:

eth0      Link encap:Ethernet  HWaddr 00:0c:29:5d:72:61  
          inet addr:192.168.1.101  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: 2001:981:4e67:1:20c:29ff:fe5d:7261/64 Scope:Global
          inet6 addr: 2001:981:4e67:1:2889:5ace:633c:3152/64 Scope:Global
          inet6 addr: fe80::20c:29ff:fe5d:7261/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:16117 errors:0 dropped:0 overruns:0 frame:0
          TX packets:16105 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:9651787 (9.6 MB)  TX bytes:9737304 (9.7 MB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:359 errors:0 dropped:0 overruns:0 frame:0
          TX packets:359 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:31654 (31.6 KB)  TX bytes:31654 (31.6 KB)

And a cat /etc/resolv.conf

 cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 192.168.0.122
search domainname.com

Ping tests:

ping -c 4 epicurus
PING epicurus.domainname.com (192.168.0.122) 56(84) bytes of data.
64 bytes from epicurus.domainname.com (192.168.0.122): icmp_req=1 ttl=62 time=18.6 ms
64 bytes from epicurus.domainname.com (192.168.0.122): icmp_req=2 ttl=62 time=17.5 ms
64 bytes from epicurus.domainname.com (192.168.0.122): icmp_req=3 ttl=62 time=17.6 ms
64 bytes from epicurus.domainname.com (192.168.0.122): icmp_req=4 ttl=62 time=17.3 ms

--- epicurus.domainname.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
rtt min/avg/max/mdev = 17.377/17.823/18.674/0.519 ms

Nslookup:

nslookup epicurus
Server:		192.168.0.122
Address:	192.168.0.122#53

Name:	epicurus.domainname.com
Address: 192.168.0.122

As you can see there is now a DNS server 192.168.0.122 rather than the 127.0.0.1.
This bug is caused by ubuntu using the DNSMASQ parameter. But as you can see you can bypass this by setting the correct settings.

I got help by:
http://unix.stackexchange.com/questions/59414/understanding-dns-in-ubuntu-12-04

Install Client Integration plugin for vSphere Web client 5.*

Quick and dirty guide!
Tested on Ubuntu 12.04.5 LTS x64 Desktop in combination with Google Chrome Stable (Version 37.0.2062.120 (64-bit))

1. Navigate to your webclient
2. Download the client bundle
3. Perform following commands:

sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install freshplayerplugin

4. Create a diretory and run commands as root!

sudo mkdir /opt/google/chrome/plugins
chmod u+x ~/Downloads/VMware-ClientIntegrationPlugin-5.5.0.x86_64.bundle
sudo ./Downloads/VMware-ClientIntegrationPlugin-5.5.0.x86_64.bundle 

5. This will work for google chrome and mozilla firefox.

All credits go to:

DNS over VPN

Recently i got my hands on an M350G5 HP server. Which is completly whitelisted for Esxi 5.*
So now i have two ESXI machines. One at my home and one at my dad’s house.

I planned out some VM’s like ubuntu desktop, vcenter etc etc.
On both addresses i have Fritz!box 7390 routers. Which are capable of setting up a LAN to LAN vpn tunnel quite easily. (No hassle ;))

So far so good, but i have a DNS at my home with ip 192.168.0.122 and i wanted to use that DNS in my dad’s network aswell.

My DNS server is a Centos 6.5 (Chroot) bind server. Which has records for all VM’s and machines with a static ip like routers etc.

But then the trouble began. I wasnt able to resolve from my dad’s house to mine.. But to make a long story short, there is an easy trick to get the DNS server working on both networks.

In the /etc/named.conf file, there is this bit:

options {
        listen-on port 53 { 127.0.0.1; 192.168.0.122;};
        listen-on-v6 port 53 { ::1; };
        directory       /var/named
        dump-file       /var/named/data/cache_dump.db
        statistics-file /var/named/data/named_stats.txt
        memstatistics-file /var/named/data/named_mem_stats.txt
        allow-query     { localhost; 192.168.0.0/24;};

We want to focus on the allow-query part.
As you can see now there is only one network allowed besides the localhost. At my home i have the ip range of 192.168.0.0/24, but at my dad’s house it is 192.168.1.0.
After an entire day of trial and error i stumbled upon a forum post which pointed me in this direction.
Simply change to:

allow-query     { localhost; 192.168.0.0/24; 192.168.1.0/24;};

All your dig / nslookup / ping tests will work.

To be sure this works, please perform a service named restart as root.
Important note: Please be aware that the network settings can be different for you. Change them to the range your network is using.

Vmware tools on Freebsd 10

Recently i upgraded my zfsguru from freebsd 9 to freebsd 10. However some changes were made and the installation of the vmware tools went a bit vague..

I performed a succesfull installation by performing the following steps:

1. mount the cdrom from either vsphere web or normal client

2. mount -t cd9660 /dev/cd0 /mnt

3. cd /tmp

4. tar xzf /mnt/vmware-freebsd-tools.tar.gz

–>important step<—

5. pkg install compat6x-amd64
(dependency on freebsd for vmware tools)

6. cd vmware-tools-distrib/

7. ./vmware-install.p

follow the steps on screen.

Voila your vmware tools are installed.

Networking on CentOS (6.*)

Static ip:

Configure eth0

nano /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
NAME="System eth0"
UUID=5fb06bd0-0bb0-7ffb-45f1-d6edd65f3e03
IPADDR=192.168.1.44
NETMASK=255.255.255.0

Configure Default Gateway

 nano /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=centos6
GATEWAY=192.168.1.1

Restart Network Interface

/etc/init.d/network restart

OR:

service network restart

Configure DNS Server

nano /etc/resolv.conf
nameserver 8.8.8.8 # Replace with your nameserver ip
nameserver 192.168.1.1 # Replace with your nameserver ip

Set up ssh:

nano /etc/ssh/sshd_config

Config file

Coming soon!

Restart the sshd service:

# /etc/init.d/sshd restart

OR

# service sshd restart

Install the open vm tools:

Installing from the OSP repository

RHEL / CentOS / Scientific Linux

1. Obtain and import the VMware Packaging Public GPG key:

wget http://packages.vmware.com/tools/keys/VMWARE-PACKAGING-GPG-RSA-KEY.pub

2. Import the key:

rpm --import VMWARE-PACKAGING-GPG-RSA-KEY.pub

3. Add the repository by creating the file /etc/yum.repos.d/vmware-tools.repo and adding the following:

[vmware-tools]
name=VMware Tools for CentOS (or OEL) $releasever - $basearch
baseurl=http://packages.vmware.com/tools/esx/5.0u2/rhel6/x86_64
enabled=1
gpgcheck=1
gpgkey=file:///srv/crypto/VMWARE-PACKAGING-GPG-RSA-KEY.pub

Edit the gpgkey line for wherever you stored the public key. Edit the baseurl line for appropriate version of ESXi, distribution and architecture.

4. Install the VMware Tools

apt-get install vmware-tools-esx

or, for no graphical support:

apt-get install vmware-tools-esx-nox