Friday, February 25, 2011

Setting up LAMP server

From this post you are going to learn how to set up LAMP server on your linux operating system. I'm using GNU/Linux Debian 6.0 distro. You can directly apply these methods for DEB based Linux systems (Ubuntu). For the RPM based systems (Redhat, Fedora, Suse ...... ) you need to apply different commands.
Ex: for DEB
      #apt-get install package-name
      for RPM
      $ yum install package-name
      $ zypper install package-name

LAMP again.........

First of all you need to install few packages, you can't find a package called LAMP, LAMP is a collection of packages which belongs to PHP and MySQL.

1.you need to update your source list.
     #apt-get update
   then install apache2 and php5 or any php version which is compatible to your distro.
    #apt-get install apache2 php5 libapache2-mod-php5

2. Run a php script

<?php
        echo "Hello World\n";
?> 

save this code in to the test.php file and you should place it /var/www/. (you can give any name with php extinction)
interpret the code by using php command
# php /var/www/test.php
 

3. MySQL and phpMyAdmin
   
    To do database stuff you need to install MySQL (complete package with most of the utilities) and for the php database stuff you need to install phpMyAdmin.

    #apt-get install mysql-server mysql-client php5-mysql
    #apt-get install phpmyadmin

4. Using MySQL

    To use MySQL, you need to have a user name and password. In order to add a new user ....................

   #mysql
  you will get a prompt like this
   mysql>
   mysql> CREATE DATABASE myData
   mysql> GRANT ALL ON myData.* TO name@localhost IDENTIFIED BY 'password';
   mysql> exit
  
   test your user name
   # mysql -u name -p myData

5. Dealing with phpMyAdmin

    phpMyAdmin a web based SQL database handler. In order to use phpMyAdmin open your favorite web browser and use this URL ( if you haven't set a domain name )

    http://localhost/phpmyadmin/

    and give your user name and password there. ( which you have created for the SQL database )


6. Run php in your web browser

   We have already done with the basic LAMP configuration. Still we haven't check apache web server   (you don't need to configure apache2.conf file for the basic LAMP configuration).
        I.  Create a php script file (as I explained before ) in the /var/www/ directory.
        II. Just open a web browser again and type
             http://localhost/test.php

Note: red color - user define names (not keywords)

Thatz it. Enjoy the LAMP server.
  


Wednesday, February 16, 2011

Install tar.bz2 in linux

If you want to install an application which is not listed in your linux distro sources you need to find an installable file which suitable to your distro.
example:
                for debian/ubuntu, you need to download .deb files
                for fedora/suse/redhat you need to download .rpm files

If you can find .bin file, that would be the easiest way to install the application.
In this post I'm going to show how to install the application from the hardest way. (only use this method if you fail to find above files, and this method can be use for any linux distro)
Ok, now I'm going to install seamonkey. (a web browser based on firefox)

1. Download tar.bz2 file.

2. Make a directory and move the downloaded tar.bz2 file to that directory.

To make a directory ( "seamonkey" is the name I have used)

mkdir seamonkey

To move tar.bz2 file ( "seamonkey-2.0.11.tar.bz2" is the name of tar.bz2 )

mv seamonkey-2.0.11.tar.bz2 ./seamonkey/
cd seamonkey/
 
3. Extract .tar.bz2 file ( you can use full name without using * )

tar jxvf sea*.tar.bz2

4. Change the directory to seamonkey which has been extracted.

cd seamonkey/


5. Finally run the application by using

./seamonkey

6. Configure the application launcher ( the way is depends on the desktop environment )
for GDM


FYI: This method is for seamonkey, for the other applications, open the .tar.bz2 file then you can find the README.txt. You will find a similar method as above.

Saturday, February 12, 2011

Live HTTP headers for Firefox

From this post you are going to learn how to install Live HTTP headers tool.
What is Live HTTP headers tool?
                       It's a tool which gives all the information about the site you are visiting. That is the simplest answer by the way.
Follow these easy and dirty steps.

1. Install Live HTTP headers tool.
    You need to download firefox addons. click here
 or for direct download ( other browsers ) click here
 

2. Allow to install



3. Hit on Install Now






4. Restart Firefox by clicking Restart Firefox



5. To run Live HTTP headers tool
    tools > Live HTTP headers

 
 6. Now you can see the meta data of the site you are visiting. enjoy !!!