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-serverIf you want MySQL server with graphical user interface, use the following command instead
yum install mysql mysql-server mysql-administrator mysql-gui-commonThen 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 PASSWORDReplace the PASSWORD with your password.
Step 2. Installing Apache
Type the following command
yum install httpdThis 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-mysqlNow 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-xmlrpcThats it, next post I will show how to setup the phpMyAdmin to manage mysql database.

