Information here is valid for Apache 2.2.4, PHP 5.2.3, MySQL 5.0.45 and maybe later (Linux).

Apache

Go here: http://httpd.apache.org/download.cgi and download Unix Source, prefferably the B-Zip one (since they're usually at a smaller file size). File name is similar to httpd-2.2.4.tar.bz2.

CD into the folder that you've downloaded the file to or if your DE supports it, right-click > Actions > Open Terminal Here (KDE) or right-click > Open Terminal Here (GNOME or XFCE).

Replace httpd-2.2.4.tar.bz2, if need be, with the name of the file that you downloaded.

Note: If your system supports 'sudo', then replace su -c "make install" with sudo make install, likewise for the rest of this tutorial wherever you see 'su -c "[whatever]"' with 'sudo [whatever]'. Also note that the rest of this tutorial assumes that you've downloaded the files into the same directory as you did with the Apache source.

MySQL

Go here: http://dev.mysql.com/downloads/mysql/ and hit "End" on your keyboard, located above the arrow keys, to scroll all the way down. Download the one titled "Compressed GNU TAR archive (tar.gz)."

After it says that the daemon has started, hit CTRL+D on your keyboard to enter a "clean" prompt. Then

Replace '123456' with a password of your choice. After initiating that command, hit CTRL+D on your keyboard.
Replace mysql-5.0.45.tar.gz, if need be, with the name of the file that you downloaded.

PHP

Go here: http://www.php.net/downloads.php and download the one titled "PHP 5.2.3 (tar.bz2)."

I hear PHP 5 requires libxml2. Although i'm not entirely sure about this, installing it did help solve a start-up problem when Apache couldn't start up due to PHP. Therefore, go here: ftp://ftp.gnome.org/pub/GNOME/sources/libxml2/ and download the latest version. The latest version since this tutorial was written is libxml2-2.6.27. Download the B-zip version.

Replace libxml2-2.6.27.tar.bz2 with the name of the version of the file that you downloaded. Likewise for php-5.2.3.tar.bz2.

/usr/local/apache2/conf/httpd.conf

Open /usr/local/apache2/conf/httpd.conf in a text editor as root. If you have XFCE, you can

Or GNOME

Or KDE

Search for AddType. Under the last one add:

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

Then start up Apache: