Monday, July 23, 2012

ruby and rails installation on ubuntu


Installation of ruby and rails in ubuntu

to install ruby and rails in ubuntu 10.10 follow the procedure for the installation of ruby & rails
to install ruby

#apt-get install ruby-full
after this the ruby will be installed

then after this for download the ruby gems
#wget production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz

after this the rubygems will be downloaded as a .tar file then extract the the downloaded file
#tar-xvf rubygems-1.3.7.tgz

after this move to th rubygem directory
#cd rubygems-1.3.7/

after this install the rubygems
#ruby setup.rb

here the ruby gem will be installed
create link file the gems
#ln -s /usr/bin/gem1.8 /usr/bin/gem

then insall gem like this
#gem install rdoc

for the installation of rails 2.3.8 version of rails
#gem install –version=2.3.8 rails --include-dependencies
after this the ruby and rails will be installed

after this install the below package for the installation of mysql gem
#apt-get install libmysql-ruby libmysqlclient-dev

#gem install mysql
here the gem for mysql will be installed

installation of phpmyadmin for lamp in ubuntu


                                        PHPMYADMIN

how to install php myadmin in ubuntu? Its a simple process to install php my admin in ubuntu

# sudo apt-get install phpmyadmin
after this the installation of phpmyadmin completes

# sudo dpkg-reconfigure -plow phpmyadmin
after this create a link file between phpmyadmin and apache2 (installation depends on the earlier post)
if you install lamp it will be reflected like this

#sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf.d/phpmyadmin.conf

after this a link file will be created between myadmin and apache
then restart the server
# sudo /etc/init.d/apache2 restart
after this go to browser and type like http://localhost/phpmyadmin

installation of lamp in ubuntu


                                         Lamp server

Installation of lamp is same as xammp but the only difference is we use linux in the place of the windows
lamp can be installed in ubuntu. if we install the lamp server we will get mysql, php, linux

#sudo apt-get install lamp-server^
here the (^) is important because it will be installed only if we use ^ .so don't miss this symbol (^)
after this the lamp will be installed
after this will ask for the mysql root password for the creation of the database
after this it will be completed
to test your apache server go to the browser and type this http://localhost
then it will be opened like “it works” so by this you can confrim that the apache working
then to test you php do like this
#sudo nano /var/www/testing.php
here a file will be created then edit this file as follows

<?php phpinfo(); ?>
then save the file
then restart the apache server

#sudo /etc/init.d/apache2 restart
after the installation go to the browser and type http://localhost/testing.php
then it will be resloved as a page in the browser
after the installationof lamp checxk for the bind address

# cat /etc/hosts | grep localhost
here it will show the local hosts

#cat /etc/mysql/my.cnf | grep bind-address
in the configuration file file you can see the bind address as 127.0.0.1. it will be as default if not means cange the bind address of the my.cnf file

Friday, July 20, 2012

why to upgrade server from small to medium in amazon

Upgradation of servers from m1.small to m1.medium or large instances :

We are using the small instance. But it is not capable to run more apps. It is capable to run upto 15 to 20 apps. So we have to upgrade the hardware of small instance. So after small instances there is medium instances are there. So we have to upgrade m1.small to m1.medium instance.
2xm1.small = 1 m1.medium . so we can deploy up to 40 to 45 apps in medium instance.
Upgradation :
  • If we upgrade from current small instance to medium instance, there is chances to data loss. So avoid data loss first save the entire server as image and save that image in s3 bucket. Then boot the new m1.medium instance from the saved image.
  • At the time of saving image we have to stop all the services and then save the image.
  • It takes nearly 1 to 2 hours for saving the image. (down time)
  • From that image we can boot the new instance.
  • New instance having the new ip.
  • So After launching the new instance we can make some changes in proxy, firewall, mail relay, name resolution, monitoring and maybe something else, I don't remember-- they need to get the new ip.
  • And then shut down the old small instance.
Billing for medium instance :
Small instance $0.090 Per/Hour
Medium instance $0.180 Per/Hour
For 1 small instance monthly bill is $64.8 per/month
For 1 medium instance monthly bill is $129.6 per/month

usb bootable pen drive in windows


                          USB BOOTABLE DRIVE

for quick installation of o.s we would like to go for usb bootable drive by this we can save buying a dvd
here down we'll show to create a usb drive with windows 7, for this you require 4gb pendrive or more than that and windows 7 cd which is genuine

  1. in windows 7 go to start button in acces Click Start -> All Programs -> Accessories and right-click on Command Prompt and run it as administrator then in the command promot type like this
    DISKPART
  2. Then afteer type like this
    LIST DISK
  3. Then after you can see disk 0 and disk 1 in the bottom
    then type like this one after the other you will get like this
    SELECT DISK 1
    CLEAN
    CREATE PARTITION PRIMARY
    SELECT PARTITION 1
    ACTIVE
    FORMAT FS=NTFS
    ASSIGN
    EXIT















  4. after this the formatting of the pendrive will take about 30 mintues, sfter this open the mycomputer you will find the pendrive as the F: drive and the cd inserted in the cd tray will be as E: drive then after this type the command as below
    E:/BOOT/BOOTSECT.EXE /NT60 F:
  5. Successfully installed NFTS file system bootcode
    after this you insert the windows 7 cd in the cd drive
    then open the the cd and copy all the files into the pendrive
    this will takle time after this your pen drive will be ready to use as a usb bootable drive

Tuesday, July 10, 2012

creating and appending files in ubuntu


How to create files in ubuntu, and view the content of files using editors

there are different types of editors in ubuntu, you can use nano, vi, vim these editors to view the content of the file
to install vim do like this
#apt-get install vim
then this will be installed


  1. to create an empty file
    #touch sunny
    here an empty file will be created with 0 bytes
  2. to create a file with some matter in it
    #cat > mom
    hi mom how are you
    then ctrl+d to save
  3. to view the connect of the file
    # cat mom
    hi mom how are you
  4. to append the matter in already present file
    # cat >> mom
    hi mom how are you
    hi mom this is your son
    ctrl+d to save
  5. to view the content you can use these
    #vim mom
    after this to save w!
    To save and quit wq
    To save and quit forcefully wq!
    To quit forcefully q!
    and other like this
    #vi mom
    and also can use
    #nano mom
    here click x to save
    and Y for yes

how to log into root account in ubuntu after installing

 how to log into root account in ubuntu after installing


after installation of the ubuntu you are asked to log in as root for this you do like this
when you install ubuntu with a user name then do like this
# sudo passwd root
after this you will ask for the normal user password and then
you will promtted with the new password then create the password after this you log in to root
like this


# su root


here give the new password for the root


then you can log in as root