(Answer) (Category) Linux on PowerPC FAQ-O-Matic : (Category) Languages and Compilers :
NEWBIE HELP! Compiling Apache from source
NEWBIE-MINI-HOW-TO compile and install Apache from source.

Here's a good confidence builder for PPC linux newbies.  Step by step
command-line instructions for installing binaries using RPM files, downloading,
expanding, and un-taring source code, and compiling the latest version of
Apache*.  Please excuse the long, detailed descriptions -- us newbies
occasionally need some hand-holding :) 

[For simplicity (and danger), perform all steps detailed below as root.]


1. We will need to get the Apache source code from the www.  Do you have "lynx"
(a text-based www browser) installed?  If you don't know, try to run it:

        lynx www.linuxppc.org
        
If it works then quit ("Q") and skip to step 2.  If it doesn't work, you will
need to install Lynx using RPM (Red-Hat Package Manager) binaries.  This is
very easy.  We will get them via ftp from linuxppc.org (or your favorite
mirror):

        ftp ftp.linuxppc.org
        
Once connected, log in anonymously.  You can enter either "ftp" or "anonymous"
as your username, and your full email address as your password.

At the ftp> prompt you will need to navigate the directory structure to find
the appropriate files.  Commands like "ls" and "cd" work here.  The following
sequence of commands should get you what you want.  To see more commands type
"help" at the prompt.

        ftp> ls
        ftp> cd linuxppc-stable
        ftp> ls
        ftp> cd software
        ftp> ls
        
All those files that flash by are PPC-binary RPM files.  They are the easiest
way to install additional software on your system.  We are looking for "lynx"
in particular, so type:

        ftp> ls lynx*
        
And you should see the following line:

        -rw-rw-r--   1 root     200        932609 Sep 27  2000 lynx-2.8.4-2.ppc.rpm
        
That's the file we want.  To download it to your working directory type:

        ftp> get lynx-2.8.4-2.ppc.rpm
        
And something like "150 Opening BINARY mode data connection for
lynx-2.8.4-2.ppc.rpm (932609 bytes)." should display.  Just wait a minute and
it will tell you when the download is complete.  To end your ftp session type:

        ftp> bye
        
The lynx rpm file should now be in your working directory.  Type "ll" to check. 
To install an rpm file you use the "rpm" command with at least the "-i" option
(the example below uses the "v" and "h" options - see "man rpm" for more info):

        rpm -ivh lynx-2.8.4-2.ppc.rpm
        
You may get the following error:
        
        error: failed dependencies:
        indexhtml is needed by lynx-2.8.4-2
        
Which illustrates a strength of the rpm system -- when packages are dependent
on other packages, rpm will let you know.  It seems we need to install the
"indexhtml" package before we can install lynx.  Simple enough.  Repeat the ftp
session above and download "indexhtml-2000-1.noarch.rpm" file.  Then from the
command line type:
        
        rpm -ivh indexhtml-2000-1.noarch.rpm   (and then...)
        rpm -ivh lynx-2.8.4-2.ppc.rpm
        
And lynx should be ready to go.


2.  Install the software you will need to compile the source code.  Here is a
(hopefully correct and complete) list of the packages you will need to compile
the source code:

        cpp
        gcc
        kernel-headers
        glibc-devel
        make
        
You can check to see if a package has been installed by using the rpm -q
(query) option.  For example:

        rpm -q cpp 

If not installed, you will need to download and install missing packages (see
step 1 for an exhaustive example of downloading and installing RPM's).


3. Download the current Apache source code:

        lynx www.apache.org
        
Follow the links:
        
        Apache Server --> Download! --> httpd/ --> apache_1.3.19.tar.gz
        
Type "D" to download and note the progress.  When prompted select "Save to
disk" and enter the following path/filename:

        /usr/src/apache_1.3.19.tar.gz
        
And type "Q" to quit lynx.


4. Expand and un-tar the source file.

        cd /usr/src
        gunzip apache_1.3.19.tar.gz
        tar -xvf apache_1.3.19.tar
        

5. Prepare for building Apache:

        cd apache_1.3.19
        ./configure --enable-module=so 
        
The --enable-module=so option allows Apache to accept modules (like PHP) -
which may interest you at some point.  It is, of course, optional.  As always,
check the README file and other documentation for more info.


6. Build/compile Apache:

        make
        
During which the Makefile runs through its paces (lots of text).  Then:

        make install

to create the final set of directories and files.  And if everything works, you
get a nice message from the Apache group.


7. Update your Apache config file (using "pico" or "vi" or the text editor of
your choice):

        cd /usr/local/apache/conf
        pico httpd.conf
        
Change the defaults on the line starting with "ServerAdmin" to real values (if
needed - mine was automagically correct):

        ServerAdmin lemonds@hawaii.edu
        
Change the defaults on the line starting with "ServerName" to real values (if
you have a real machine name -- otherwise leave it as "localhost").

        ServerName monkey.nuts.org
        

8. Fire up Apache for the first time:

        /usr/local/apache/bin/apachectl start
        
Check it by running:

        lynx localhost
        
To replace the default www pages, add your personal www site/pages to
"/usr/local/apache/htdocs/".  


Congratulations!  Your newbie status is already starting to fade...

*Note -- you don't have to build Apache from the source.  You can quite easily
install the binary RPM for Apache just like any other package.

*********
Thanks: Calum Selkirk, Keary Suska, & Julie Meloni
lemonds@hawaii.edu
[Append to This Answer]
Previous: (Answer) Jserv and jdk
This document is: http://www.jonh.net/cgi-bin/lppcfom/fom?file=1040
[Search] [Appearance]
This is a Faq-O-Matic 2.717d.
Hosted by anduin.org and SourceForge Logo