Installing Apache2 With PHP5 And MySQL Support On Fedora 14 (LAMP)

Version 1.0
Author: Falko Timme
Follow me on Twitter
Last edited 11/09/2010

LAMP is short for Linux, Apache, MySQL, PHP. This tutorial shows how you can install an Apache2 webserver on a Fedora 14 server with PHP5 support (mod_php) and MySQL support.

I do not issue any guarantee that this will work for you!


1 Preliminary Note

In this tutorial I use the hostname with the IP address These settings might differ for you, so you have to replace them where appropriate.


2 Installing MySQL 5

To install MySQL, we do this:

yum install mysql mysql-server

Then we create the system startup links for MySQL (so that MySQL starts automatically whenever the system boots) and start the MySQL server:

chkconfig --levels 235 mysqld on
/etc/init.d/mysqld start



to set a password for the user root (otherwise anybody can access your MySQL database!):

[root@server1 ~]# mysql_secure_installation


In order to log into MySQL to secure it, we'll need the current
password for the root user.  If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
 <-- ENTER
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.

Set root password? [Y/n]
 <-- ENTER
New password: <-- yourrootsqlpassword
Re-enter new password: <-- yourrootsqlpassword
Password updated successfully!
Reloading privilege tables..
 ... Success!

By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n]
 <-- ENTER
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n]
 <-- ENTER
 ... Success!

By default, MySQL comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n]
 <-- ENTER
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n]
 <-- ENTER
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MySQL
installation should now be secure.

Thanks for using MySQL!

[root@server1 ~]#


3 Installing Apache2

Apache2 is available as a Fedora package, therefore we can install it like this:

yum install httpd

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

chkconfig --levels 235 httpd on

... and start Apache:

/etc/init.d/httpd start

Now direct your browser to, and you should see the Apache2 placeholder page:

Apache's default document root is /var/www/html on Fedora, and the configuration file is /etc/httpd/conf/httpd.conf. Additional configurations are stored in the /etc/httpd/conf.d/ directory.


4 Installing PHP5

We can install PHP5 and the Apache PHP5 module as follows:

yum install php

We must restart Apache afterwards:

/etc/init.d/httpd restart

Share this page:

6 Comment(s)

Add comment


From: Simon Thomas at: 2011-03-03 07:51:16

I'm sure I read somewhere that operating a service via

/etc/init.d/<service name> <command>


/etc/init.d/httpd start

 has been deprecated and should no longer been used.


service <service name> <command>


service httpd restart

 as root does the same thing in a non-deprecated way.

From: Marios Zindilis at: 2011-03-24 17:46:20

Those who might want to get an idea on what the numbers mean in the command:

chkconfig --levels 235 httpd on

 can take a look at the Wikipedia article on runlevels. You might even discover that you need less runlevels there. See the section for your distribution specifically.

From: raju at: 2011-02-21 10:46:13

I follow the steps as given above.
After configuring phpmyadmin.conf file,i restart httpd server and
browse http://localhost/phpmyadmin then i got following error:



How can solve this ??

From: Anonymous at: 2012-03-24 10:15:44

 you have the answer in this link , and it work.

From: Yam-Joyous at: 2011-02-23 02:34:53

You rock! I just love when it works right off the bat. Clear and easy to follow, and it works! ITS ALIVE!!!

From: Thane Smith at: 2011-04-07 23:52:59

No problem!!! As mentioned before...It just works. I installed everything without a catch. The only thing I noticed is that I had to preface most of the commands with sudo so that I could install software and make required mods as outlined in the instructions.

I'm running on a TYAN-Tiger motherboard with 2 Pentium IIIs at 866 MHz and 1G of RAM. I had issues getting UBUNTU 10 to install and boot. I didn't feel like spending days making mods so that CentOS would work with my ATI Rage video card. I took a chance with Fedora and was pleasantly surprised.

This OS is easy to install and so far has proven to be rock solid. I run UBUNTU on my laptop which is only a year old, but Fedora rocks on this older hardware. I will be using this Fedora for my other machines; new and old.