No-IP for those with no static IP…

So people do not have a permanent ip and it makes supporting those users/clients. As you need to keep track of there ip when you need to log into there system/server. A handy way to do this is to use a third party service that tracks your clients non static ip to a dynamic name service. On of these services is no-ip.org This service requires you to install software upon your clients server/machine. Every 30 minutes the software talks to the no-ip.org domain name service and inserts the ip of the clients wan into the no-ip.org name server. So instead of remembering the clients ip address you can remember there name and attach the no-ip.org address. There are many other domains no-ip.org allows you to choose from but this is the domain I have choosen. e.g. client.no-ip.org. better than remembering a ip address. To install no-ip, there following steps are required on you clients server/machine.

Generic:

You must create a on no-ip.org for you to be able to add hostnames. Once this is done you will need to log into your account and be able to add hosts which are the machines that have the dynamic ip. Note, do not create the hosts into groups or one machine will change all the machines ip to the same ip as the machine that does the update. Leave them ungrouped. Below is a image of the buttons that need to be ticked.

CentOS:

Download the no-ip.org unix client.

# wget https://www.no-ip.com/client/linux/noip-duc-linux.tar.gz

# tar xvfz www.no-ip.com/client/linux/noip-duc-linux.tar.gz

You can compile the source code yourself, but for the purposes of the excercise

# cd noip-2.1.9-1/binaries

# noip2.i686 /usr/local/bin/noip2

# chown root:root /usr/local/bin/noip2

# chmod 755 /usr/local/bin/noip2

Now we run noip for the first time to configure for connection to the no-ip service.

# /usr/local/bin/noip2 -C

# cd ..

We now create the startup script so no-ip starts up when the machine starts up.

# cp redhat.noip.sh /etc/rc.d/init.d/noip2

# chmod 755 /etc/rc.d/init.d/noip2

# cd /etc/rc.d/rc5.d

# ln -s /etc/rc.d/init.d/noip2 S99noip2

# cd ../rc6.d

# ln -s /etc/rc.d/init.d/noip2 K99noip2

We can now start the no-ip service

# /etc/rc.d/init.d/noip2 stop

# /etc/rc.d/init.d/noip2 start

Install Virtualbox Headless Server for Guests Operating Systems.

To install Virtualbox which is a free virtual machine software, that allows you to run machines/containers upon a physical server. Virtualbox is free open source technology. It is available for all platforms e.g. Mac OSX, Centos, Windows etc. Virtualbox is very easy to setup upon linux variants as there is software packages already available that you can install in one easy command. Below I will show you howto install Virtualbox and create a container. Virtualbox has a very active community, where help can be found very easily.

This installation will show you how to install via headless solution where no gui isused.

CENTOS:

To install Virtualbox upon Centos is a very easy procedure. The following steps will tell how to install Virtualbox upon centos.

# cd /etc/yum.repos.d

# wget http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo

# yum –enablerepo rpmforge install dkms

Below we will now install the kernel drivers for Virtualbox.

# yum groupinstall “Development Tools”

# yum install kernel-devel

Now we will install the Virtualbox package itself.

# yum install VirtualBox-4.1

The last item we need to do is add the user who will run the Virtualbox application to the Virtualbox group.

# usermod -G vboxusers username

Ubuntu:

To install Virtualbox upon Ubuntu is a very easy procedure. The following steps will tell how to install Virtualbox upon centos.

# cd /etc/apt

# vi sources.list

Add the following line below to the sources.list file so we can talk to the Virtualbox repository.

deb http://download.virtualbox.org/virtualbox/debian lucid contrib non-free

Now we will install the Virtualbox package itself.

# wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add –

The last item we need to do is add the user who will run the Virtualbox application to the Virtualbox group.

# sudo apt-get update

# sudo apt-get install virtualbox-4.1

Below I use the root user, you can use any user you believe you want to run

# usermod -a vboxusers

Next we will now post howto setup/create a virtual machine in our next post.

Disable SELinux:

CentOS:

To disable SElinux, the security system within centos, you need to modify the SElinux file. Reasons for wanting to disable SElinux, would be that your server is internal, and to configure each service is a waste of time. SELinux is good for machines that are facing the internet, within a De-militarized Zone.

The SELinux configuration file is located at

/etc/selinux/config

To disable SELinux go to the configuration file look for the following line

SELINUX

then change the line 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 – SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted – Only targeted network daemons are protected.
# strict – Full SELinux protection. SELINUXTYPE=targeted
# SETLOCALDEFS= Check local definitition file.
SETLOCALDEFS=0

The above with take effect during the next reboot, but if you need the effect to be immediate you can disable SELinux immediately at the command line with the following command

# setenforce 0

Network Time Protocol:

Keeping track of time on your server can become a bit daunting, when you start having multiple number of servers. A solution is called ntp (network time protocol). The machine ever so often, loses time, by going out up to a few hours. Defined period checks with a main time server, and adjusts your machines time if it is out from the main timeserver.

CentOS:

The following commands below will install and configure ntp under CentOS.

# yum install ntp
# chkconfig ntpd on
# ntpdate pool.ntp.org
# /etc/rc.d/init.d/ntpd restart

The results will be shown as below.

Shutting down ntpd:    [ OK ]
Starting ntpd:              [ OK ]

Ubuntu:

The following commands below will install and configure ntp under Ubuntu.

# apt-get install ntp

# /etc/init.d/ntp restart

Configuring the ntp.conf files will not be needed as they are automatically configured during installation.

Generic

Another way around this issue is to manually have the ntpdate application run directly via the cron to update the time. This issue is caused on virtual machines where the virtual software forces the virtual machine to sync with the host machine. Below is a work around. Just enter this into cron. The ip of the time server is au.pool.ntp.org

# crontab -e

*/5 * * * * /sbin/ntpdate -u 149.20.68.17

Change System Hostname:

CentOS:

To change the hostname, the hostname is located in the following configuration file

/etc/sysconfig/network

The file contains three lines. We are only interested in changing the third linux beginning with hostname as this is the hostname. You can add whatever suits your fancy after the equals symbol.

NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=bob

Then you need to restart the networking process, via the following command

# /etc/rc.d/init.d/network restart

Now you can restart the network services that control the hostname at startup. Manually starting the  above command should show you the results below.

Shutting down interface eth0:                             [  OK  ]
Shutting down loopback interface:                    [  OK  ]
Setting network parameters:                                [  OK  ]
Bringing up loopback interface:                          [  OK  ]
Bringing up interface eth0:                                   [  OK  ]

Now your hostname should be changed. You can check your hostname with the hostname command

# hostname
bob

Ubuntu:

Under ubuntu to change the hostname as of this writing using ubuntu version 10.04.03 you need to modify the following file

/etc/hostname

There will be one line with the name of the machine. Just change the name from what exists to the new name you want the machine to be called. There is a issue I have with ubuntu 10.04.03. It seems that the init script to restart the hostname does not work, nor the hostname service. The only way I have been able to get around this is to reboot the machine. This may be fixed in versions afterwards.