Setting up a LAMP Server

This post is to help the people who is willing to try out web technologies using LAMP. I think it will be more helpful to do a brief on ‘what is LAMP?’

LAMP represents the open source web platform. Its a portion of 4 resources
L – Linux (any distribution of gnu/linux).
A – Apache ( web server).
M – MySQL (relational database management system).
P – either Perl,Python or PHP (OO scripting language).
In this tutorial I’m using Linux Mint 7 Gloria, Apache2, MySQL and PHP5.

Step 01 → update your system’s package repository. So you can get the latest versions of available resources.

apt-get update

Step 02 → download and install Apache web server

apt-get install apache2

To check what the web server is running without any problems type ‘http://localhost‘ on your browser. If no problems, then it will give a test output as follows,

http://localhost

http://localhost

Step 03 → get PHP and its dependencies.

apt-get install php5 libapache2-mod-php5

after installing php you have to restart apache web server as follows,

/etc/init.d/apache2 restart

Step 04 → Now you need to make sure that PHP and Apache is working fine together. To do that use the following test php scrip and save it as phpinfo.php in server root(/var/www/).

phpinfo.php

phpinfo.php

Then call the script through the web browser. The URL should be like this, http://localhost/phpinfo.php . Then it should show all PHP configuration settings in a coloured table.

Step 05 →  get MySQL

apt-get install mysql-server

During the installation you will get a package configuration screen. Set root password for MySQl carefully. If you didn’t get that screen set password for MySQl manually,

mysql -u root
mysql> SET PASSWORD FOR ‘root’@'localhost’ = PASSWORD(‘user_pass_word’);

Step 06 → PhpMyAdmin installation

PhpMyAdmin is a web based free graphical database management and MySQL administration tool. This tool  makes all the MySQL database operations easy. Such as creating tables, creating databases inserting values, deleting values and lot more.

apt-get install phpmyadmin

during its installation it will ask what server to use. Apache or apache2 ? Select apache2 . Then it will prompt you to set a password for phpmyadmin. Done! To use Phpmyadmin type http://localhost/phpmyadmin on your browser.

PhpMyAdmin

PhpMyAdmin

Congrats! Your LAMP system is ready to do extraordinary things for you. :D

Note: all the command line actions above are held as ‘root’.

My Crazy Idea of Future Web

Hell of work I’m doing these days. But this funny and freaking idea of future web started to ghost through my mind! May be I’m overloaded with work and started to see things. Whatever..
The future web. What would it be like? It keeps developing and developing 24 hours nonstop. Millions and billions of geeks/freaks/nerds and hackers are trying to make a new change. Speed is optimized by software+hardware and reliability is Secured by firewalls  but on other hand its not a safe place anymore to visit.

This is my crazy idea (please don’t get freaked out :D ).The future web may not have any browsers to browse or computer screens. Users may wear handy looking high tech “browsing goggles” . There will be nice comfortable “browsing chars” to give you those fancy vibrating and shaking real life effects. And your DTS surround system may serve as the noise of world wide web.

Then you power on your high power PC which definitely runs GNU/Linux. Then you turn on the browsing goggles…

First you will feel the empty 3D cyberspace around you, dark and silent. Then you may notice billions of tiny little particles of web sites. You may able to touch them,move them or throw them away in to the deep cyberspace as you wanted. Yeah they may Emmit beautiful colors too. I guess my favorite networks like google, youtube and wordpress will appear as giant colorful,glorious galaxies. Suddenly you wants to find something.. System takes 0.5mses to reads your brain signals and identify what you wanted and send a virtual character in front of you . Mostly it will be a kind looking lady in a pure white dress(mostly with the google logo). She identifies her self to you and asks your requirement. Then she may grab the the missing particle and give it to you…

Wow just think how it would be like! Freakingly awesome huh. I think Its better to stop now. Because you may already thinking that Dushi has gone crazy! Who knows this comic may be a prediction of the future web! What do you think of the future web? Will it be something like I mentioned ? Or is it just another freakish idea? What ever it is feel free to comment..

adios

Cyberspace in Future

Cyberspace in Future

Note : The technology mentioned above is never been built and I’m not doing cocaine or weed :D

Compressing and Archiving

‘.tar’, ‘.gz’, ‘.tar.gz’, ‘.bz2′, ‘tar.bz2′, ‘.zip’. What are these strange extensions? Mostly you ll think these are all compressed files. But its better to understand exactly what these are. And why do we need them.

According to above extensions some are for compressed and some tells that they are archived.

Compressing

In linux/unix environment there are 2 main compression algorithms. They are ‘gzip’ and ‘bzip’. The difference of ‘bzip’ from ‘gzip’ is that ‘bzip’ is more capable of making smaller files than ‘gzip’. But ‘bzip’ consumes much more memory and takes time.

Howto bzip:

as usual open up your favorite terminal/konsole :D . Then follow the commands. I m having 4 files inside /home/dushi/test directory.

ls

ls

now im gona compress file1.txt using bzip2.

bzip2

bzip2

Thats all. Now ‘file1.txt’ is replaced by ‘file1.txt.bz2′ :D

Lets decompress that newly compressed file back to ‘file1.txt’.

bzip2 -d

bzip2 -d

it will decompress the ‘.bz2′ file into its originals.

Howto gzip:

gzip

gzip

same as above its really simple. I’m gona compress ‘file2.txt’ using ‘gzip’. it gives ‘file2.txt.gz’.

gzip -d

gzip -d

use -d to decompress.

Archiving

The ‘.tar’ format is the most common archive format in linux/unix environment. They are mostly called as tarballs. Archives are not compressed files. It combines one or more files into a single file. The idea is to achieve easier storage and transportation. Specially in web.

Howto archive:

lets go back into my /home/dushi/test/ directory again.

ls

ls

There are 4 files. Two compressed files and two normal text files. Lets archive them all into ‘MyArchive.tar’ .

tar -cf

tar -cf

from about cmd makes a tarball as ‘MyArchive.tar’ :D . To extract files from it ,

tar -xf

tar -xf

Thats all u should know :)   for more options refer,

$man tar

$man gzip

adios

Follow

Get every new post delivered to your Inbox.