2004-04-02, 08:43 AM
although the guide below is OLD, it still works (as of December 2007.
I've tested it with the following versions in Fedora 8
apache_1.3.39.tar.gz
mysql-5.0.51.tar.gz
php-5.2.5.tar
and apart from a small hiccup while configuring php, all was ok.
ok, on with the show...
Quote:PLEASE NOTE: THIS HOWTO WAS WRITTEN BEFORE THE VULNERABILITIES WERE FOUND IN APACHE 1.3.x - MAKE SURE TO USE APACHE 1.3.31 OR NEWER FOR THIS HOWTO. FOR DETAILS OF THE VULNERABILITIES AND TO DOWNLOAD THE APACHE 1.3.31 SOURCE PLEASE SEE <a href="http://httpd.apache.org/download.cgi" target="_blank"><a href="http://httpd.apache.org/download.cgi" target="_blank">http://httpd.apache.org/download.cgi</a></a>
TO REPEAT, PLEASE SUBSTITUE ALL REFERENCES BELOW TO APACHE 1.3.29 with APACHE 1.3.31 or newer !
This document was inspired by this HOW-TO written by forum member [strabo]. I followed his document and with lots of help on IRC (irc://efnet.demon.co.uk/redhat) from many people, I got things up and running eventually, however there were lots of problems along the way so i'd like to clear things up a bit here and make this document more 'noob' friendly.
First off, I am assuming you are running either Redhat 8/9 or Fedora, if so then this should work well for you, if you already have your linux distro installed then you might be in for some problems, for example, during Redhat setup (and fedora) you have the chance to install apache and mysql amongst other things, however, if you go this root you may find that things just don't work later on.
Step ONE - Prepare your linux installation:-
I would suggest that you start with a clean slate and install Redhat/Fedora by choosing the CUSTOM option, making sure NOT to install apache (httpd), mysql or php, once done we will get the source for these components and compile them. If you have not compiled before don't worry, it's not that bad, I'll guide you through it. After I did my clean install, I installed apt-get and did the following to get my system up to date:
Code:
apt-get update && apt-get upgrade
if you don't want to use apt-get, then you can simply use yum
Code:
yum -y update
It took a while, but once done my system was more in tune with todays packages. Now all i needed was the latest kernel:
Code:
apt-get install kernel
doing the above will display an error telling you that you must specify a kernel to retrieve, so follow the instructions and install the latest kernel, I did by doing this
Code:
apt-get install kernel#2.4.22-1.2174.nptl
Once done I rebooted and was ready for the next step.
Step TWO - Get the source for apache/mysql/php:-
I downloaded the three source files to the following directory
/home/anyweb/downloads/website
Apache:
I wanted to compile and install Apache 1.3.29 from source. I downloaded it from this mirror but you can go to apache's download page and take your pick.
MySQL:
I picked mysql 4.0.18 and picked the mirror from here
PHP:
Get over to php.net and download the latest php package, I downloaded php 4.3.5 from here
Step THREE:- uncompress the source and move it to /usr/local/src/
Now that you have the source lets start uncompressing it and copying it.
You should have three files similar to these ones below
apache_1.3.29.tar.gz
mysql-4.0.18.tar.gz
php-4.3.5.tar.gz
to uncompress the files do as follows:-
Code:
tar zxvf apache_1.3.29.tar.gz
tar zxvf mysql-4.0.18.tar.gz
tar zxvf php-4.3.5.tar.gz
Once done, you will now have three new directories with the source within. Now let's move those directories to their destination.
login as su - (root) and do as follows
cd to the directory where you saved and uncompressed your source (above)
Code:
cd /home/anyweb/downloads/website
mv apache_1.3.29 /usr/local/src/
mv mysql-4.0.18 /usr/local/src/
mv php-4.3.5 /usr/local/src/
Step FOUR - Compile MySQL
Be warned, compiling MySQL does take time, so be prepared to take a few coffee breaks.
Login as su - (root).
lets add the user/group mysql by doing this
Code:
groupadd mysql
useradd -g mysql mysql
Ok, now let's cd to the directory where we have the MySQL source,
Code:
cd /usr/local/src/mysql-4.0.18/
once there do as follows:-
Code:
./configure --prefix=/usr/local/mysql \--localstatedir=/usr/local/mysql/data \--disable-maintainer-mode \--with-mysqld-user=mysql \--enable-large-files \--without-comment \--without-debug \--without-docs \--without-bench
after a while.... and some scrolling you should finally see this:-
Quote:MySQL has a Web site at <a href="http://www.mysql.com/" target="_blank"><a href="http://www.mysql.com/" target="_blank">http://www.mysql.com/</a></a> which carries details on thelatest release, upcoming features, and other information to make your
work or play with MySQL more productive. There you can also find
information about mailing lists for MySQL discussion.
Remember to check the platform specific part of the reference manual for
hints about installing MySQL on your platform. Also have a look at the
files in the Docs directory.
Thank you for choosing MySQL!
Now let's continue !
type
Code:
make
(now is a good time to go and take a break, it takes time....)
ok once that is finished (it took a while didn't it !) you can do this
Code:
make install
./scripts/mysql_install_db
chown -R root:mysql /usr/local/mysql
chown -R mysql:mysql /usr/local/mysql/data
If the above command fails (cant find the data dir) chances are you have had mysql installed already via rpm..., if so you could try removing it with apt-get remove mysql and start the whole compiling process again, or, start fresh at step ONE (preferred) or create the data directory manually and hope that nothing else fails...
Code:
echo "/usr/local/mysql/lib/mysql" >> /etc/ld.so.conf
ldconfig -v | grep libmysqlclient
echo "/usr/local/mysql/bin/mysqld_safe --user=mysql &" >> /etc/rc.d/rc.local
cd /usr/local/mysql/bin
./mysqld_safe --user=mysql &
If the above starts MYSQL and then abrubtly ends it like the following
Quote:Starting mysqld daemon with databases from /var/lib/mysql040527 14:33:45 mysqld endedthen check the owner of /var/lib/mysql
if its root, then change it to mysql as follows
Code:
[root@localhost bin]# chown -R mysql:mysql /var/lib/mysql
at this point, you'll probably need to open a new console and login again as su - because the other console is running mysql...
Code:
cd /usr/local/mysql/bin
./mysqladmin version
doing the above should show you something like the following if all went ok:
Quote:[root@localhost bin]# ./mysqladmin version./mysqladmin Ver 8.40 Distrib 4.0.18, for pc-linux on i686
Copyright