ApacheApache

  Main Menu

Home: Linux: Apache: Compile_apache
PHP Apache Home:

There are a billion pages like this one, so I'm going to keep this brief, but hopefully focus on the things that killed me. First, you have to get apache source. Go to www.apache.org and download it from a mirror near you.

Once you have downloaded the source code, (which will be named someting like httpd-x.x.xx, where x.x.xx is the version) do this:

The file is compressed, so you have to unzip it:
gunzip apache.tar.gz;

That gives us a tar archive, so we untar it:
tar -xf apache.tar

That should give us a directory to cd into:
cd apache;

Here is the chunky goodness:
./configure --prefix=/usr/local/apache\
--enable-so\
--with-mysql\
--with-apxs2\
--with-gd\
--enable-gd-native-ttf<br>

The first directive we hand to configure is the prefix (start directory) that we want apache to live in. Mine is in almost the default location. (default is /usr/local/apache2).
--prefix=/usr/local/apache

Next, we enable shared objects. This is cool, becuase we want to be able to add on to apache without having to recompile every time.
--enable-so

I want mysql support in there, so I'm not going Shared Object with it, I'm compiling it in.
--with-mysql

Honestly, I'm not sure what apxs is good for, but I know apache likes it and won't compile right without it. Note that previous versions of apache used a different version of apxs.
--with-apxs2

I want to have gd compiled in, so I do --with-gd. My gd is installed in /usr/lib/.
--with-gd

The reason I need gd is to render fonts for certain applications, so I enable native ttf support so I can use windows TrueType Fonts to draw words on generated images. Php probably can do this without apache being able to, but why not be sure?
--enable-gd-native-ttf

One last bit of post-installational goodness is to add the new apache man pages to the manpath, by adding the apache man pages to the man path. Look in /etc/man.config for the MANPATH lines, and add:

MANPATH /usr/local/apache/man

Now, you'll want to read up on how to compile and install php.

 

Thus spake the master programmer:

``You can demonstrate a program for a corporate executive, but you can't make him computer literate.''