Installing Apache, MySQL and PHP on Mandriva One 2009

OS: Mandriva One 2009
Date: Nov 7, 2008

A few days back I decided to change the way I do a few things and so switched to Mandriva Linux from Ubuntu. I have been using Ubuntu for about two years now. But, the shift came as I was having some serious problems like my laptop freezing while trying to open video files. So I decided its time to look out for something new. Mandriva is not new to me. I have used it once before when it was still known as Mandrake and came in 3 CDs. I liked the polish and the ease of use Mandriva had in those days when Linux meant difficult.

So much so for history. Lets get to the point. Mandriva Linux 2009 is a really polished distribution. Even though some complaints were heard about the KDE flavor the GNOME version has absolutely no such issues. I downloaded the One version of Mandriva and installed it. Installation was quick but it was a bare-bones GNOME desktop with just the things to get started. In order to get productive, I needed Apache, MySQL and PHP. I proceeded to install these. Help was always at hand from the Mandriva Forum.

You can refer to this thread on the forum. The steps to setup a LAMP stack are pretty simple. Some of the below steps are taken from this post.

Apache Installation

1. Launch Install and Remove Software
2. Provide root password if prompted
3. Select All from the first drop down
4. Search for apache-base and select it.
5. Select any dependent packages that are required. There would be a popup listing the dependent packages. Just click Yes to install them.

An alternate way to install apache is

1. Install drakwizard and drakwizard-base packages
2. Restart Mandriva Control Center
3. A new tab called Sharing would be available
4. Click on Configure Web Server.
5. Select appropriate options from the Wizard and complete the setup. The steps are mostly self explanatory.

MySQL Installation

Installation of MySQL is a bit tricky. I don't know what is wrong but MySQL cannot be installed if the hostname is set to localhost. So the below steps are required.

1. If MySQL is already installed, uninstall it by typing the commands

rpm -e mysql
rm -f /var/lib/mysql/mysql/*

2. Change the hostname to something other than loclahost. For example you can set it to This can be done from Mandriva Control Center > Network and Internet > Hosts definitions.
3. Install MySQL using installing the RPM or by issuing the command

urpmi mysql

4. Start MySQL using the command

/etc/init.d/mysqld start

5. Change the hostname back to whatever you wish to have it as.

PHP installation

PHP packages can be installed directly from the Mandriva Control Center application by searching for PHP packages. An alternate way to install PHP is to install the package dokuwiki. This would install all the related PHP packages to get a working system. Additional packages can then be installed from the MCC if required.

Thanks to Reebus who helped me out on the forum. I had a doubt how difficult it was going to get, but in the end it was all pretty simple.

Comment from Stephen Kirbach via Email on Dec 2, 2008

Rather than changing localhost in the Mandriva Control Center and then
changing it back, it's quicker and easier to do the following:

1. rpm -e mysql
2. rm -f /var/lib/mysql/mysql/*
3. /bin/hostname
4. urpmi mysql


Add a New Comment
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License