Sunday, October 28, 2012

How to install aptana in ubuntu 10.10


How to install aptana in ubuntu 10.10

installation of aptana version 3 is shown here
#sudo add-apt-repository ppa:ferramroberto/java
#sudo apt-get update
#sudo apt-get install sun-java6-jdk sun-java6-plugin
Download & install xulrunner for ubuntu 10.10
#wget -O xulrunner.deb http://launchpadlibrarian.net/70321863/xulrunner-1.9.2_1.9.2.17%2Bbuild3%2Bnobinonly-0ubuntu1_i386.deb

#sudo dpkg -i xulrunner.deb
Download and install aptana from here
#sudo unzip [name of Aptana Studio ZIP file here].zip -d /opt
#sudo mv /opt/Aptana\ Studio\ 3 /opt/aptana-studio-3

to get the desktop icon
#wget http://www.samclarke.com/wp-content/uploads/2011/11/AptanaStudio.desktop
#sudo mv AptanaStudio.desktop /usr/share/applications/AptanaStudio.desktop
how to create a aptana launcher in ubuntu
just right click then on create launcher
afterthis give the launcher name
and the path of the launcher /opt/aptana-studio-3/AptanaStudio3
then a launcher for aptana will be created on the Desktop
here the aptana will be install in ubuntu 10.10 

how to install aptana in ubuntu on 12.04


How to install aptana studio in ubuntu 12.04

install the required packages 
#sudo apt-get install openjdk-7-jdk libjpeg62 libwebkitgtk-1.0-0 git-core

#sudo apt-get install libjpeg62 libwebkitgtk-1.0-0 git-core
#sudo add-apt-repository ppa:webupd8team/java
#sudo apt-get update
#sudo apt-get install oracle-java7-installer

after this download the aptana studio from here
after downloading extract the file to /opt

#sudo unzip [Aptana Studio ZIP file here].zip -d /opt

#wget http://www.samclarke.com/wp-content/uploads/2012/04/AptanaStudio3.desktop

#sudo mv AptanaStudio3.desktop /usr/share/applications/AptanaStudio3.desktop


after this aptana will be installaed in your system


how to create a aptana launcher in ubuntu

just right click then on create launcher
after this give the launcher name
and the path of the launcher /opt/aptana-studio-3/AptanaStudio3
then a launcher for aptana will be created on the Desktop


after installing go the the file > new > here create a new project wheather php, ruby etc,

if already existing project means create a project name with some xyz after this go to file > import here you can import alreday existing project in it

for any reference go through here




Friday, October 26, 2012

kill a process id (pid)


How to kill a process in linux

when you open a file or it it is not opening or any trouble with its process then you can simple kill the process in linux
to see the current running process in linux
#ps -aux
it will show the process like this

to kill the process simple kill the pid ( process id)
#kill pid
means if would like to kill a process runing on 2049 means do like this
#kill  -9 2049
here it will kills the 2049 pid

Friday, October 12, 2012

How to copy files and folders remotely in ubuntu


How to copy files and folders remotely in ubuntu

To copy the files and folders in ubuntu or in redhat first of all intsall the ssh packages for remote terminal login

for ubuntu
#apt-get -y install openssh-server openssh-client

for redhat
#yum install openssh-server openssh-client

if you want to get the files or folder in ubuntu and redhat
#scp -r root@remoteip:/remotepath /localpath
here it will get the copy from other remote system

if you would like to send the local copy to other means
#scp -r /localpath root@remoteip:/remotepath
here it will send the copy of local file to the remote system   

Wednesday, October 10, 2012

High Availability of linux servers using HEARTBEAT package in ubuntu


High Availability of linux servers using HEARTBEAT package in ubuntu

heartbeat package is used for high availability for the linux servers, here by configure it the load can be balanced and if any server goes down the other will take up easily by configuring. Here we will show to configure heartbeat package in ubuntu.
To install heartbeat pacakage and also pacemaker
#apt-get -y install heartbeat pacemaker

here server1 ip address 192.168.1.111 and hostname is sunny (server name or node)
another server2 ip address 192.168.1.222 and hostname is venky(server name or node)

first of all we will install nginx in ubuntu in server1 and server2
root@sunny:~# apt-get install nginx
root@venky:~# apt-get install nginx

after this we will create a dummy website and configure it, remove this default files in both the servers
root@sunny:~#rm -rf /etc/nginx/sites-available/defautls
root@sunny:~#rm -rf /etc/nginx/sites-enable/defaults
root@sunny:~#vim /etc/nginx/sites-available/basic
server {
listen 192.168.1.111:80;
server_name sunny.example.com;
access_log /var/log/nginx/basic.access.log;
error_log /var/log/nginx/basic.error.log;
location / {
root /var/www/basic;
index index.html index.htm;
}
}

then save
after this create a directory
root@sunny:~#mkdir /var/www/basic
root@sunny:~#vim /etc/www/basic/index.html
sunnys site server1

then save
then create a simulink
root@sunny:~#cd /etc/nginx/sites-enable/
root@sunny:~#ln -s ../sites-available/basic

Then restart the service
root@sunny:~#/etc/init.d/nginx restart

then here we do same in the server2 but little changes

root@venky:~#vim /etc/nginx/sites-available/basic
server {
listen 192.168.1.222:80;
server_name sunny.example.com;
access_log /var/log/nginx/basic.access.log;
error_log /var/log/nginx/basic.error.log;
location / {
root /var/www/basic;
index index.html index.htm;
}
}

then save
after this create a directory
root@venky:~#mkdir /var/www/basic
root@venky:~#vim /etc/www/basic/index.html
sunnys site this is your site two server2

then save
then create a simulink
root@venky:~#cd /etc/nginx/sites-enable/
root@venky:~#ln -s ../sites-available/basic

Then restart the service
root@venky:~#/etc/init.d/nginx restart

from here we will configure heart beat
root@sunny~# vim /etc/ha.d/ha.cf
autojoin none
bcast eth0
warntime 3
deadtime 6
initdead 60
keepalive 1
node sunny
node venky
crm respawn

then save
here we copy the same in server2
root@sunny~# scp /etc/ha.d/ha.cf venky:/etc/ha.d
root@sunny~# ( echo -ne "auth 1\n1 sha1 "; \
dd if=/dev/urandom bs=512 count=1 | openssl md5 ) \
> /etc/ha.d/authkeys
root@sunny:~# chmod 0600 /etc/ha.d/authkeys
root@sunny:~# scp /etc/ha.d/authkeys venky:/etc/ha.d
root@sunny:~# ssh chmod 0600 venky:/etc/ha.d/authkeys

here we will restart the service in both the servers
root@sunny:~# /etc/init.d/heartbeat restart
root@sunny:~# ssh venky /etc/init.d/heartbeat restart
here both the cluster must me up and known by each other to see this we use crm tool
root@sunny:~# crm_mon -1 | grep Online
root@sunny:~# crm configure
crm(live)configure# primitive site_one_ip IPaddr params ip=192.168.1.111 cidr_netmask="255.255.255.0" nic="eth0"
crm(live)configure# primitive site_two_ip IPaddr params ip=192.168.1.222 cidr_netmask="255.255.255.0" nic="eth0"
crm(live)configure# commit
crm(live)configure# exit

root@sunny:~# crm configure show
node $id="1876vbiu-g98iuhgiu09-7hb0-9775" sunny.example.com
node $id="iho1ih24-4g2jjiofnufcv0-fe98sdkf7-1as sunny.example.com
primitive site_one_ip ocf:heartbeat:IPaddr \
params ip="192.168.1.111" cidr_netmask="255.255.255.0" nic="eth0"
primitive site_two_ip ocf:heartbeat:IPaddr \
params ip="192.168.1.222" cidr_netmask="255.255.255.0" nic="eth0"
root@sunny:~# crm configure
crm(live)configure# location site_one_ip_pref site_one_ip 100: sunny.example.com
crm(live)configure# location site_two_ip_pref site_two_ip 100: sunny.example.com
crm(live)configure# commit
crm(live)configure# exit

root@sunny:~# crm configure
crm(live)configure# monitor site_one_ip 40s:20s
crm(live)configure# monitor site_two_ip 40s:20s
crm(live)configure# commit
crm(live)configure# exit

after to check check from the other system like this in local
local system is some xyz with 192.168.1.49
in this edit the /etc/hosts file
root@xyz:#vim /etc/hosts
192.168.1.111 sunny.example.com sunny
192.168.1.222 sunny.example.com venky
then save

then serach for the website with sunny.example.com
it will show “sunnys server1”
then disconnect the net from server1
then serach for sunny.example.com here the page will be redirected to the second server
it will display “sunny this is your server2”

Thursday, October 4, 2012

dns configuration in ubuntu


DNS (Domain naming system);
In the world of internet a human cant memorize each and every ip address of the websites, so the ip address of the site is resloved by the name so that the humans can memorize easily. For this purpose the dns is used it will resolve the website with ipaddress and viceversa. How to configure dns in ubuntu is shown below
my dns server ipaddress is 192.168.1.35 with the hostname ubuntu111
other system connected in lan are 192.168.1.34 with hostname ubuntu100
and other with ipaddress 192.168.1.28 with hostname venky
here I will reslove a fully qualified domain I.e; ubuntu111.team.com
for this we have to give the static ip for the server

#vim /etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.1.35
netmask 255.255.255.0
network 192.168.1.0
gateway 192.168.1.1
broadcast 192.168.1.255
:wq!

Here also set hostname
#vim /etc/hostname
ubuntu111
:wq!

And also set hosts file
#vim /etc/hosts
192.168.1.35 ubuntu111.team.com ubuntu111
:wq!


then go to dns of your system
#vim /etc/reslov.conf
search team.com.
nameserver 192.168.1.35  #(it is the dns server ip address in which you are creating)#

Then install bind package
#apt-get install bind9 dnsutils

here we will edit two files /etc/bind/named.conf.options & /etc/bind/named.conf.local

#vim /etc/bind/named.conf.options

forwaders {
192.168.1.1; #(this is gateway of your router)
123.176.37.37; (this is the default of your dns server provided by internet seen in reslov.conf)
123.176.37.35;
8.8.8.8;
8.8.4.4;
};

save and quit

#vim /etc/bind/named.conf.local
zone "team.com"
{
type master;
file "/etc/bind/zones/team.com.db";
};
zone "1.168.192.in-addr.arpa"
{
type master;
file "/etc/bind/zones/rev.1.168.192.in-addr.arpa";
};

save and quit

here we will create a directory named zone in bind
#mkdir /etc/bind/zones
#vim /etc/bind/zones/team.com.db

#vim /etc/bind/zones/ rev.1.168.192.in-addr.arpa

then we will restart the bind service
#/etc/init.d/bind9 restart

to check the dns is working or not type
#dig ubuntu111.team.com

#nslookup ubuntu111.team.com
#nslookup ubuntu100.team.com
#nslookup venky.team.com
here he have created the dns server successfully