Please remember that you should only be doing a source-based installation if you need to alter settings in one or more components of the Java LAMP (e.g., you need a feature in PHP or MySQL that isn't in the default RPM build). If you are just getting started with a LAMP-style system, use the binaries provided by your RPM distribution because it is a lot easier to upgrade later using tools like YellowDog Updater (YUM) with RPM's. Going the source route is more complex, so take notes during you implementation and create a README file for yourself so you can review it a couple months or years from now - especially if you memory is like mine.
Most out-of-the-box Red Hat Linux installations will have one or more of the Jave LAMP components installed via RPM files. Installing certain applications from source provides the most control over which features are compiled into the application. Source code installations will undoubtably cause un-predictable behavior - if they work at all - if overlaid on top of RPM installs. RPM's will most likely not share the same directories as a source intstallation unless you are painstakingly explicit in the configuration options. So lets avoid all that hassle.
If you have not yet installed your Linux OS, or just for future reference, do not choose to install Apache, PHP, or MySQL during the system installation. Then you can immediately proceed with the source-based install listed here.
Log in as rootBecause we will be installing software to directories that regular users don't have write access to, and also possibly uninstalling RPM versions of some applications, we will log in as the root user. The only steps that need root access are the actual installation steps, but by doing the configure and make steps as root, the source code will also be inaccessible to regular users.
If you do not have direct access (via keyboard) to the server, PLEASE use Secure Shell (SSH) to access the server and not telnet! Whenever you use telnet (or plain FTP for that matter), you are transmitting your username, password, and all session information in plain text. This means that anyone who can access a machine someplace between your PC and your server can snoop your session and get your info. Use encryption wherever possible!
|
|
rpm -qa |
in conjunction with grep to filter your results:
|
rpm -qa | grep -i apache rpm -qa | grep -i httpd rpm -qa | grep -i php rpm -qa | grep -i mysql |
The 'httpd' search is included just in case you have Apache2 installed via RPM. I mentioned earlier to avoid installing the applications altogether during your Linux installation, but double check! You might be surprised at how pervasive your distribution is.
For any of the previous commands that generate a result on the command line, remove their associated RPMs with this command...
|
rpm -e filename |
| Tech Note: If you have any content in your MySQL database already, the RPM removal step should not delete the database files. When you reinstall MySQL, you should be able to move all those files to your new MySQL data directory and have access to them all again. In some cases an RPM module may have dependencies and if you remove it the dependant module may fail. Record any such dependencies. In our case we had a dependency upon the mysql-client module. Be sure any dependants are tested and any dependencies are accomodated for. |
Get the Source Code for all Applications
We want to put all our source code someplace central, so it's not getting mixed up in someone's home directory, etc.
|
cd /usr/local/src |
One way application source code is distributed is in what are known as "tarballs." The tar command is usually associated with making tape backups - tar stands for Tape ARchive. It's also a handy way to pack up multiple files for easy distribution. Use the man tar command to learn more about how to use this very flexible tool.
When I wrote this document, I had a specific requirement for MySQL version 4.1.xx and not 5.x, so these are the versions of all the components I am using in this How-To:
MySQL - 4.1.21
Apache - 2.0.59
PHP - 5.1.4
Please note: these are the only versions I have verified these steps against. If you use another version of any component, especially a newer version, this HOWTO may not be totally accurate, and I can't provide free support under any circumstances. These are the names of the source packages I used in this example. Please visit apache.org, mysql.org and php.net (respectively) in order to download these versions or the versions of your choice:
httpd-2.0.59.tar.gz
mysql-4.1.21.tar
php-5.1.4.tar.tar
mysql-4.1.21.tar
php-5.1.4.tar.tar
Unpack the Source Code
|
tar xf php-5.1.4.tar.tar tar zxf httpd-2.0.59.tar.gz tar xf mysql-4.1.21.tar |
This should leave you with the following directories:
/usr/local/src/php-5.1.4
/usr/local/src/apache_2.0.59
/usr/local/src/mysql-4.1.21
/usr/local/src/apache_2.0.59
/usr/local/src/mysql-4.1.21
Click here to advertise!
|
|

