Saturday, August 20, 2011

Setting up a LAMP Stack in Fedora 14

In this post let us see how to setup a LAMP Stack. LAMP is an acronym for a solution stack of free, open source software, originally coined from the first letters of Linux (operating system), Apache HTTP Server, MySQL (database software) and Perl/PHP/Python, principal components to build a viable general purpose web server.

Setting up this LAMP stack is essential for you to design websites and test it in your local computer.


1. Installing MySQL 5

To install MySQL type the following command in the Terminal:

yum install mysql mysql-server

In order to make MySQL start automatically whenever the system boots, type

chkconfig --levels 235 mysqld on

To Start the MySQL server

/etc/init.d/mysqld start

To set password for MySQL enter,

mysql_secure_installation

The intial password for 'root' is nothing.. So just press enter..It will prompt if you want to change it. Then press 'Y', current password "blank(press enter)" and enter the new password what you want..

2. Installing Apache 2

To install Apache 2 enter the following command

yum install httpd

Now configure your system to start Apache at boot time...

chkconfig --levels 235 httpd on

To start Apache

/etc/init.d/httpd start

To check if it has been installed,

Go to the browser and enter http://localhost

You must see a Fedora Test Page.


3. Installing PHP 5

Enter the following command

yum install php

Then restart apache,

/etc/init.d/httpd restart

The default directory for all PHP files is /var/www/html.

So place any .php file there and then test it as http://localhost/YourFileName.php.

4. Installing MySQL (to be used with PHP)

Enter the following command

yum install php-mysql 

Restart the apache as mentioned in the previous step. 

5. Installing PhpMyAdmin

phpMyAdmin is a free software tool written in PHP intended to handle the administration of MySQL over the World Wide Web. phpMyAdmin supports a wide range of operations with MySQL. The most frequently used operations are supported by the user interface (managing databases, tables, fields, relations, indexes, users, permissions, etc), while you still have the ability to directly execute any SQL statement.

To install PhpMyAdmin enter the following:


yum install phpmyadmin 

Restart Apache.  

Thats it!!! Its done. Now you are ready to use LAMP...:)