Apache Today [Your Apache News Source]
Your Daily Source for Apache News and Information  
Breaking News Preferences Contribute Triggers Link Us Search About
To internet.com

Apache HTTPD Links
The Apache Software Foundation
Apache XML Project
Apache Module Registry
PHP Server Side Scripting
The Apache FAQ
Apache Project
Apache-Perl Integration Project
Apache-Related Projects
The Jakarta Project
The Java Apache Project
ApacheCon

  internet.com

Internet News
Internet Investing
Internet Technology
Windows Internet Tech.
Linux/Open Source
Web Developer
ECommerce/Marketing
ISP Resources
ASP Resources
Wireless Internet
Downloads
Internet Resources
Internet Lists
International
EarthWeb
Career Resources

Search internet.com
Advertising Info
Corporate Info
Apache Guide: The Newbie's Guide to Installing Apache
Jul 3, 2000, 06 :16 UTC (27 Talkback[s]) (9093 reads) (Other stories by Rich Bowen)

In this week's article, I'll take you through installing an Apache server. I'm assuming you've never done this before, but that you know a few things about your operating system.

If you're beyond this stage, come back in a few weeks, as we'll move on to more advanced things from here.


Acquiring Apache

Apache is free software. That is, it is Open Source, and can be downloaded, and redistributed, without any cost. You can read the full text of the Apache license (it's very short) on the Apache web site at http://www.apache.org/LICENSE.txt. But basically what it says is that you are free to use the product, as well as to redistribute it, without charge.

You can download Apache from the Apache Server web site, at http://www.apache.org/httpd.html There you'll find the Apache source code, as well as binary (precompiled) distributions for a large number of platforms.


Build it yourself

Unless there is some overwhelming reason not to do so, you really should get the source code and compile it yourself. There are a number of reasons for this.

  • Get the right combination of modules. When you install a binary distribution, that means that someone else compiled it, and made a decision on what modules to build into that binary distribution. They tried to make what seemed like the more reasonable choice, for the purposes of making the distribition usable by as many people as possible. This will invariably mean that there will be some modules in it that you really don't want, and there might be some left out that you would like to have.

  • Get is exactly right for your system. You may have something strange set up on your system that does not match the system of the individual that built the binary distribution. Perhaps a different version of some important libraries, Perhaps a newer version of some file that was used in the build process. And this may cause some problems when you try to use the file on your system.

  • The right file locations. Some binary distributions put files in very strange places. A notable culprit here is Red Hat. The RPM (Redhat Package Manager) installation of Apache puts files all over the place in the most obscure places. Of course, that's just my opinion. Apparently it made sense to somebody, because they keep doing it. Anyway, if you expect files to be in some reasonable place, and expect to be ablet to find them when you need them, don't install with the Red Hat RPM.

  • The right configuration. When you install the file yourself, it will end up with the configuration file that you expect. Binary distributions might have default configuration settings that are unexpected.

By building yourself from the source code, you'll make sure you have the Apache server that is right for you, rather than something that someone else thought might be best for you.


Quick form (guide for the impatient)

If you look at the file INSTALL, after unpacking the .tar.gz file that you downloaded, you will find the following instructions:

  1. Overview for the impatient
     --------------------------

     $ ./configure --prefix=PREFIX
     $ make
     $ make install
     $ PREFIX/bin/apachectl start

     NOTE: PREFIX is not the string "PREFIX". Instead use the Unix
           filesystem path under which Apache should be installed. For
           instance use "/usr/local/apache" for PREFIX above.

You'll find that the Apache documentation is very complete, and very helpful, if you know where to look. Following the above instructions will give you a usable installation of Apache to get you started, and this is probably the way that you want to install it the first time.

For example, if you wanted to install Apache in /home/httpd (not that you would, but if you did ...) you would type:

        ./configure --prefix=/home/httpd
        make
        make install
        /home/httpd/bin/apachectl start

configure will tell you that it is creating some makefiles. Both make and make install produce a great deal of output, describing what they are doing to build Apache. And at the end of the process, you will see a short message from the Apache Software Foundation thanking you for using Apache server.


Longer form - using configure

The command above - configure - takes a look at your system, and figures out how things are set up, so that it knows how the compilation process will need to be done. This ranges from figuring out how long a long integer is on your particular system to determining what compiler you are using.

As you saw in the above example, you can pass certain parameters to configure to influence the way that it will install Apache. For a complete list of what parameters you can specify, you should again see the file INSTALL, located in the top directory of wherever you unpacked the tar file. For a more indepth discussion of using configure, see the file README.configure


Enabling DSO support

One configure trick that is worth mentioning specially is enabling DSO support. DSOs (Dynamic Shared Objects) are a way to compile Apache modules (and other things) so that they can be loaded into the server at run time, rather than building them directly into the Apache executable. This lets you decide to load, or not load, particular modules, without having to recompile Apache.

To build Apache with DSO support, and make most of the available Apache modules ready to use, type the following command:

        ./configure --prefix=/path/to/apache \
                --enable-module=most \
                --enable-shared=max

(Note: You can type that all on one line. The \ indicates that the command line is continued on the next line. This syntax is supported on most Unix operating systems.)

In this case ``most'' means all of the modules that are shipped with Apache, leaving out those that are considered experimental, or which don't run on all platforms.

You will then need to enable, or disable, various module, by uncommenting, or commenting out, LoadModule lines in httpd.conf - the main Apache configuration file.


mod_perl, mod_php, and other stuff

README.configure contains instructions for configuring a lot of other useful things too, such as mod_perl and mod_php. These are modules that are not included in the Apache distribution, and so you will need to download separately.


Really long form - using Configure

Using configure to configure the Apache installation is the new way to do things. It makes life a lot easier, and lets someone with a little less experience get a server running without having to peer into the Apache source code. The ``old-fashioned'' way to do things is with the Configure script. That's Configure with a big C, as opposed to configure with a small c. Configure is located in the src subdirectory of wherever you unpacked the Apache distribution.

Configure reads in a files called Configuration, which contains settings that determine details about your installation. In the src directory you will find a sample Configuration file called Configuration.tmpl, which you can copy to Configuration to get started.

After running ``little-c'' configure, you will find a file called Configration.apaci, which is then used by Configure. So configure is really just a user-friendly wrapper on top of Configure

To configure your installation with Configure, edit Configuration and specify how you want things to be done. The most important part of this file is the section specifying what modules you want installed. This portion of the file should be fairly self-explanatory - just comment out the modules you don't want, and uncomment the ones that you want.


make, make install

Whichever way you configure the installation, you will then need to compile the code by typing make, and then install it by typing make install.


Starting your new server

One of the things that will be built is a handy utility called apachectl, which helps you to start, stop, and restart your Apache server, as well as performing a variety of other tasks. To start your Apache server, just type:

        /usr/local/apache/bin/apachectl start

(This assumes that you installed Apache in /usr/local/apache, which is the default location.)


In future articles

In upcoming articles, I'll discuss in more detail what you can do with configure to make your Apache server exactly like you want. And I'll talk about what the configuration process will be like in Apache 2.0.

And, in a future article, I'll talk about apachectl, and what you can do with it, other than just starting your server.

  Current Newswire:
Apache Module Registration: mod_xmlrpc

ApacheCon 2001 Europe cancelled

Apache Week issue 254 (13th July 2001) released

Great Bridge PostgreSQL 7.1 package announced

ApacheCon Dublin sessions listed

Apache Week issue 253 is out

ServerWatch: June 2001 Security Space Survey Results

zez.org: Security flaws in PHP

SECURITY: Bugtraq: Java servlet cross-site scripting vulnerability

mnoGoSearch 3.1.17 released

 Talkback(s) Name  Date
psst...don't put typos in tutorials.it causes the newbies' heads to spin ...   mean to the newbies   
  Jul 3, 2000, 11:07:52
This is a great document for configuring the server and it works... that is, it ...   gcc or c compiler problems   
  Jul 4, 2000, 06:31:12
I submitted a question earier concerning GCC Compiler problems for LINUX... Her ...   FOUND - EASY GCC COMPILER FOUND   
  Jul 4, 2000, 06:54:36
Hi !This article is really very usefull for newbies.And I'd just like to add ...   Read the manuals, guys !   
  Jul 4, 2000, 09:29:54
For beginners using LINUX Mandrake, there are some some key things that need to ...   Apache Install - There's More to it!   
  Jul 4, 2000, 21:39:31
I think that Apache Today's recommendation to stay away from RPM packages is ...   Bad RPM advise   
  Jul 5, 2000, 06:36:44
I'vew just started using Apache and wondered if you could answer a couple of ...   Apache + ASP   
  Jul 5, 2000, 10:05:32
Rich-I have administered many LINUX systems, but have always installed Apache fr ...   Package advice   
  Jul 5, 2000, 13:50:48
I believe that a summary of your post would simply be that this is a matter of p ...   Re: Bad RPM advise   
  Jul 5, 2000, 15:40:35
OK, thanks. I'll do this in a future article.http://www.apacheunleashed.com/ ...   Re: Package advice   
  Jul 5, 2000, 15:41:53
You're right. I'm a newbie and can tell you from experience that typos, ...   Re: mean to the newbies   
  Jul 5, 2000, 17:14:31
I really like the way RedHat installs apache! it actually makes lot of sense, to ...   Apache & Redhat   
  Jul 5, 2000, 22:38:29
 I really like the way RedHat installs apache! it actually makes lot of sense, t ...   Re: Apache & Redhat   
  Jul 6, 2000, 16:30:28
ummm, that should be advice, not advise. ...   not advise   
  Jul 7, 2000, 03:26:34
It would be nice to have articles such as Apache Guide store in the archeive tha ...   Useful Articles in Apache Today   
  Jul 7, 2000, 17:57:22
On Jul 6, 2000, 16:30:28, Rich Bowen wrote: Something to stress here is that NOT ...   Re: Apache & Redhat   
  Jul 9, 2000, 23:35:37
Hi,Can anyone helpme in setting up virtual host in few simple steps.Thanks in ad ...   Virtual Hosting   
  Jul 13, 2000, 11:27:06
This realy help newbie like me to get a fast track start without really greying ...   Thanks for the add-on step by step instruction   
  Aug 3, 2000, 19:25:53
I am having horrible difficulties installing Apache on a win98 machine. I have i ...   Win Apache Install Help!   
  Aug 20, 2000, 08:44:50
In C:\Program Files\Apache Group\Apache\conf, edit httpd.confLook for the follow ...   Re: Win Apache Install Help!   
  Aug 28, 2000, 06:03:40
I have installed apache in linux but could not configure my server to acceptuser ...   user configuration   
  Nov 16, 2000, 08:03:06
If you figure this out, will you please tell me? I have the same problem under ...   Re: user configuration   
  Nov 19, 2000, 17:38:43
 This is a great document for configuring the server and it works... that is, it ...   Re: gcc or c compiler problems   
  Nov 28, 2000, 06:38:06
./configure --prefix=/www...Make ...DULE proxy_util.c && mv proxy_util.o proxy_u ...   Apache make problem!   
  Dec 18, 2000, 09:24:42
StephenCheck this link for Apache & ASP:http://www.chillisoft.com/Regards,webmei ...   Re: Apache + ASP   
  Jan 12, 2001, 14:40:17
while installing apache on solaris its looking for c compiler path cannot be fou ...   c compiler for sun   
  Feb 8, 2001, 15:22:54
Maybe yur rich enough to afford it...As yu can understand, the SUN C Compiler fo ...   Re: c compiler for sun   
  Mar 8, 2001, 17:09:39
Enter your comments below.
Your Name: Your Email Address:


Subject: CC: [will also send this talkback to an E-Mail address]
Comments:

See our talkback-policy for or guidelines on talkback content.

About Triggers Newsletters Media Kit Security Triggers Login


All times are recorded in UTC.
Linux is a trademark of Linus Torvalds.
Powered by Linux 2.2.12, Apache 1.3.9. and PHP 3.14
Copyright INT Media Group, Incorporated All Rights Reserved.
Legal Notices,  Licensing, Reprints, & Permissions,  Privacy Policy.
http://www.internet.com/