The following steps will show you how to install the Apache web server on GNU/Linux. This install also includes installing mod_ssl, MySQL and PHP4.You may encounter problems compiling any one of these tarballs.It is up to you to fix the problems. This install assumes that you have everything you need to do all of the compiles. The x's in each file name stands for what ever the version number is at the time you download it.
The following are links to the sites you will need to download the source files. Go to each sites download section and download the latest version of each piece of software. After you have downloaded them all to the same directory we are going to unzip and untar them.
Apache.org
Openssl.org
ModSSL.org
Php.net
MySQL.com (Download the Linux binary version)
tar -xvzf apache_1.3.xx.tar.gz
tar -xvzf openssl-0.9.Xx
tar -xvzf mod_ssl-2.X.xx-1.3.xx
tar -xvzf php-4.X.x.tar.gz
groupadd mysql
useradd -g mysql mysql
cd /usr/local
gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf -
ln -s full-path-to-mysql-VERSION-OS mysql
cd mysql
scripts/mysql_install_db
chown -R root .
chown -R mysql data
chgrp -R mysql .
bin/safe_mysqld --user=mysql &
or
bin/mysqld_safe --user=mysql &
## if you are running MySQL 4.x
cd openssl-0.9.Xx
./config
make
make test
make install
cd ..
cd mod_ssl-2.X.xx-1.3.xx
./configure --with-apache=../apache_1.3.xx
cd ..
cd apache_1.3.xx
./configure --prefix=/usr/local/apache
cd ..
cd php-4.x.x
CFLAGS='-O2 -I../openssl-0.9.Xx'
./configure \
--with-apache=../apache_1.3.xx \
--with-mysql
make
make install
cd ..
or
You can configure and compile a ton of other things into PHP. I usually compile in the following: GD,JPEG,PNG,libcrypt,MySQL,Freetype,and zlib. Make sure if you compile these other things in that you scan back thru the configure output to make sure all of the things you tried to compile in were found. If you install the libjpeg,freetype,libpng,and zlib on RedHat you just need to put /usr in for the directory.Other paths refer to the areas the library's were installed and compiled. Type: ./configure --help to see all of the things you can configure PHP with. My config line looks like this:
./configure \
--with-gd=/usr \
--with-mysql \
--with-png-dir=/usr \
--with-zlib-dir=/usr \
--with-ttf=/tmp/freetype-2.0.5/ \
--with-freetype-dir=/tmp/freetype-2.0.x \
--with-jpeg-dir=/usr \
--with-mcrypt=/tmp/libmcrypt \
--with-apache=../apache_1.3.xx
make
make install
cd ..
cd apache_1.3.xx
SSL_BASE=../openssl-0.9.Xx \
./configure \
--prefix=/usr/local/apache \
--enable-module=ssl \
--activate-module=src/modules/php4/libphp4.a \
--enable-module=php4
make
make certificate <--Optional step.
make install
cd ..
vi /usr/local/apache/conf/httpd.conf
See the Apache documentation on how to configure your Apache httpd.conf.
/usr/local/apache/bin/apachectl startssl