How to setup a local webserver (LAMP) in fedora 9

In this post I am going to write how I was setting up my local webserver in Fedora 9. The server was build up with Apache, MySQL and PHP. Generally known as LAMP.

I am not going to write articles with hundred of lines for each command rather going to show the steps what I did. I believe it will help to many like me.

Important : Before starting to use the command, change the user to root (eg: type su at the command-line and enter the password for the root account)

Step 1. Installig MySQL

First install the MySQL. Use the yum command as follows.

yum install mysql mysql-server

If you want MySQL server with graphical user interface, use the following command instead

yum install mysql mysql-server mysql-administrator mysql-gui-common

Then we need to add the service to auto start and start the MySQL service.

1
2
3
chkconfig --add mysqld
chkconfig mysqld on
/etc/init.d/mysqld start

Now need to setup password for root account

mysqladmin -u root password PASSWORD

Replace the PASSWORD with your password.

Step 2. Installing Apache

Type the following command

yum install httpd

This will install the Apache webserver in the system. After installation, the service must be set to start automatically and start it.

1
2
chkconfig httpd on
service httpd start

Step 3. Installing PHP

Following command will install the PHP and the necessary component to work with MySQL database.

yum install php php-mysql

Now we successfully setup the LAMP in local system. To ensure the installation, restart httpd

service httpd restart

and then create a PHP script under /var/www/html/index.php and enter this ( <?php phpinfo(); ?> ). Open up the web browser and type http://localhost/

Additional Packages

yum install php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc

Thats it, next post I will show how to setup the phpMyAdmin to manage mysql database.

delicious digg reddit facebook technorati stumbleupon savetheurl

5 Responses to “How to setup a local webserver (LAMP) in fedora 9”

  1. Zamaan says:

    Hai,

    I landed here after a google search for “setup a local webserver in fedora” and i found this article was really helpfull.

    Thank you to the author.

    cheers!

  2. HASHIM says:

    This is great job i was looking for something like this , I dint try this but it looks it will work out . I will write when Iam done .Thank you great job.

  3. Muneer says:

    Welcome Hashim.
    I was setting up to my fedora 9 and thought it would be helpful to some one. I am happy to share my experiences with everybody. Please do not forget to comment once you have setup successfully. It might help some others as well.

  4. sapanaryal says:

    Nice post,Thank you.I was searching for this for some time now.hope it works in fedora 11

  5. maple story mesos says:

    Wonderful article. I been looking for one on a similar note. I guess you always have something up your sleeve.

Leave a Reply

Please wrap all source codes with [code][/code] tags.