Alternative Linux Apache-MySQL-PHP System

Notes

This is not a distro specific guide. However it can be used with any Linux of the RedHat family. You should replace RPM (RedHat Package Manager) with the installer application of your distro, for example, apt-get for Debian.

What alternative?

The alternative installation method of using RPM is in fact the way preferred by many Linux users. The disadvantage is that you do not get the latest package. Quite often, packages are incomplete.

Although Package Manager usually gets the job done regardless of the order of installation, installation should be done in the order of MySQL, Apache and PHP. You should not see anything unusual if your distro comes with all the packages. Remember to install MySQL development library too.

Get Webmin

When it is done, install Webmin as well and log in to check your installation, particularly httpd.conf to ensure that PHP directives are in place. You should also change MySQL root password. Important: Take note of all the directories of Apache, MySQL and PHP. You will be using those directories instead of the directories stated in this guide.

What to look out for

  • For Webmin: On some versions of Apache, httpd.conf is called httpd2.conf.
  • Development library of zlib is sometimes left out even if you have chosen the development (programming) packages. Search your installation media for zlib-devel-something.something and install it.
  • Development library of MySQL is usually not installed. Search for mysql-devel-something.something and install it.
  • In some cases, libmysqlclient is installed but includes files are not. There is no easy fix here. Download the source tarball of the exact version and compile the library yourself. A proven way is the "--without-server" method described in MySQL Library for Cygwin guide. Warning: If the "--without-server" switch is left out, you will get another MySQL server but the rpm-installed one will continue to run as the default server. Symlinking lib and include directories of precompiled MySQL package theoretically will work.
  • Not directly related to this LAMP guide: Berkeley database (BDB, sometimes known as SleepyCat DB) and library, needed by subversion, are sometimes not installed. Subversion will compile without it. However, the author did not test that or performance of the resulting subversion client. BDB is also used in other applications, such as Cyrus SASL authentication. It will be better to have that installed.




Q&A

Why is this not the default guide?

Packages which comes with a distro might not be up to date. That is usually not a problem with a LAMP system however. Problem might arise from ROCP which somehow insists on MySQL 4.0 and PHP4. (It is known to work with MySQL 4.1 and PHP5.) Upgrading or downgrading one of those also involves a change to the other. In some cases, it might even involve making changes to Apache. When that stage is reached, it is about the same as doing tarball installation of all three applications.

Can I use this instead of that compile way?

Definitely. If you choose this route, make installation of Webmin a must. Webmin can detect rpm-installed servers and present their configurations to you in a friendly manner. You should also be familiar with paths to those servers.

What is LAMP?

It is an abbreviation for Linux Apahce-MySQL-PHP system, also known as Linux AMP. Some Linux users argue that the P stands for Python. That is another story.