Friday, 7 December 2012

What to do when you get a new server?

First of all have a big smile mmmmmmmmmmmmmm :)

It's always been a lovely experience to play with a new server, it's like you got a new power source and you start thinking of how to optimize the utilization of the resource, Shall i create distributed memory system or I shall deploy some other components on this machine because it is having higher computation power, woooow. It's fascinating.

Any ways, I am first writing this basic set of commands which will work on Debian systems (and yes Ubuntu is built on Debian architecture), to set the basic things always required on a new machine.

First thing you must do is
$ apt-get update
$ apt-get upgrade

1. Using command apt-cache you can search the package 
apt-cache search jdk
2. Using command apt-get you can install the package
$ apt-get install openjdk-6-jdk
$ apt-get install mysql-server
$ apt-get install atop

If you want only mysql client - try this
$apt-get install mysql-client-5.5

3. Set the timezone on debian machine
$ dpkg-reconfigure tzdata
And choose Asia->Kolkata

4. Installing sar on ubuntu
$ sudo apt-get install sysstat
$ sudo vi /etc/default/sysstat
change ENABLED=”false” to ENABLED=”true”
$ sudo vi /etc/cron.d/sysstat
Change 5-55/10 * * * * root command -v debian-sa1 > /dev/null && debian-sa1 1 1
To */2 * * * * root command -v debian-sa1 > /dev/null && debian-sa1 1 1

$ sudo service sysstat restart
$ sar -A
If you want to save the statistics for further analysis to a file use:
$ sudo sar -A > $(date +`hostname`-%d-%m-%y-%H%M.log)

5. apt-get install zip

6. You might want to change the file limits - find details at here