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).
- tar xjf httpd-2.2.4.tar.bz2
- cd httpd-2.2.4
- ./configure --enable-modules=so --enable-rewrite --enable-speling
- make && su -c "make install"
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)."
- cd ../
- tar xzf mysql-5.0.45.tar.gz
- cd mysql-5.0.45
- su -c "groupadd mysql"
- su -c "useradd -g mysql mysql"
- ./configure --prefix=/usr/local/mysql
- make && su -c "make install"
- su
- cp support-files/my-medium.cnf /etc/my.cnf
- cd /usr/local/mysql
- chown -R mysql .
- chgrp -R mysql .
- bin/mysql_install_db --user=mysql
- chown -R root .
- chown -R mysql var
- bin/mysqld_safe --user=mysql &
After it says that the daemon has started, hit CTRL+D on your keyboard to enter a "clean" prompt. Then
- su
- /usr/local/mysql/bin/mysqladmin -u root password 123456
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.
- cd ../
- tar xjf libxml2-2.6.27.tar.bz2
- ./configure && make && su -c "make install"
- cd ../
- tar xjf php-5.2.3.tar.bz2
- cd php-5.2.3
- ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-gd
- make && su -c "make install"
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
- gksu mousepad /usr/local/apache2/conf/httpd.conf
Or GNOME
- gksu gedit /usr/local/apache2/conf/httpd.conf
Or KDE
- kdesu kedit /usr/local/apache2/conf/httpd.conf
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:
- su -c "/usr/local/apache2/bin/apachectl start"
