Home > Articles

Installation of Apache

Want to install Apache, but don't know where to start? Follow this guide through both Unix and Windows installations of Apache.
This chapter is from the book

IN THIS CHAPTER

  • Introduction
  • Compiling Apache
  • Installing Apache on Unix
  • Dynamic Shared Objects
  • Binary Distributions
  • Windows Installations
  • Commercial Distributions
  • Recap

Here's how I got started with Apache. Several years ago I was employed as a Web designer at a small company (which my attorney has advised me to leave nameless). One morning my boss, a guy named Bob, rapped on the side of my cubicle. Bob was some sort of sales creature—he had a fine wardrobe and a haircut that was almost congressional, but he possessed no discernable technical skills. Of course, at the time I myself was far from a Web whiz

"Do you know anything about Apache?" Bob asked. "Was that Chief Joseph?" "Chief Joseph was Nez Percé." "Wounded knee?"

"Nope. The Web server."

"'Fraid not," I said, and turned back to the screen. At this time, the http protocol was still in its childhood. As I recall, I was trying to figure out how to pass the contents of a three-page order form to my machine through a single environment variable.

"That's a shame," Bob said. "How so?" "You're our new Webmaster." "Eh?" "Yup. Sridhar retired." "Sridhar retired? When?" "Yesterday."

"He can't be retired. He's barely old enough to drink."

"Actually, he isn't old enough to drink. He isn't even old enough to vote." Bob sighed. "Remember that stock he was telling us about a couple weeks ago?" "It took off?" "Big time. Sridhar left yesterday afternoon. The chauffeur said he was going yacht shopping. Did you buy any?" "No, I've been pouring all my investment cash into options for this company." "That's very loyal of you." "I suppose so." "Do you know anything about short selling?" I shook my head.

"Well, then, I suggest you start learning Apache."

Fortunately Apache server administration turned out to be considerably less painful than I first imagined. The first step is to get a working installation. It was easy even back then; in the years since, the process has been refined to the point where it is positively trivial. I think you'll find it an interesting and entertaining experience. Welcome.

Introduction

This chapter describes the process of obtaining and installing the Apache Web server on your system. In all likelihood, this will be a smooth and painless process, even if you are not a skilled programmer. At this writing, Apache has been downloaded hundreds of thousands of times. Most of the egregious bugs in the installation process have been worked out.

Depending on your level of expertise, you can exercise a great deal of control over the content and behavior of your Web server, up to and including wholesale modification of the source code. But if you want to keep things quick and simple, there are only three questions you need to answer:

  • What hardware and operating system platform will you install Apache on?

  • Do you want to install a source code or a binary distribution?

  • Where do you want to put the software?

Operating System

Distributions of Apache are available for almost all operating systems, including Linux, Windows, Mac OS X,1 and most of the commercial Unix distributions. In the absence of a pressing reason to do otherwise, you will be best served by installing Apache on one of the flavors of Unix. Let me stress here that the ported versions are fully functional and will work well. However, Apache was originally designed for a Unix/Linux environment, and most of the new development takes place on Unix first and trickles down to the rest of the world later.

Also, as you become more familiar with the directives, you will notice that many of them are predicated on the assumption that they are being run in a Unix environment. For example, both Windows and Unix versions of Apache have a single process serving as a parent. In a Unix environment, the parent process handles client requests by forking off a single copy of itself for each client it is serving. In Windows, the parent process has only a single child, which uses threads to service all client requests. This means that the MaxSpareServers and MinSpareServers (to name only two) are more or less meaningless in a Windows environment. This is not necessarily a bad thing, but you should be aware of it.

Source Code versus Binary Distributions

Apache is available in both source code and binary distributions. A source code distribution is a collection of the original source code files from which the Apache executable and associated modules are compiled. Source code distributions include scripts that can be used to compile the files into an executable program that can be used on your system.

The process of compiling usually is quick and painless, and it has many side benefits. When you compile your own executable program, you are able to exercise great control over which modules are included and, more significantly, which are left out. Recall that Apache forks off copies of itself to service client requests. If the individual copies are fat and bloated, they will quickly choke system performance.

Alternatively, binary distributions are available for most hardware platforms and operating systems. A binary distribution is a precompiled executable containing a default set of modules. This is the distribution that most closely resembles commercial software. If you are new to software development and nervous about compiling your own code, binary distributions probably will be your first choice. As of Apache 1.3.12, Apache binary distributions come with all standard Apache modules compiled as shared objects. This feature enables you to dynamically disable modules you are not using, thereby shrinking the size of the executable and improving performance.

Obtaining Apache

Regardless of the platform and distribution type you settle on, you will be obtaining them from the following URL:

http://www.apache.org/dist 

The downloads you find in that directory are all of the source code variety. If you are interested in binaries you can either follow the link or go directly to the following URL:

http://www.apache.org/dist/binaries 

To simplify and speed transmission, the source code distributions have been combined into a single downloadable file, and that file has been shrunk with one or another of the various compression utilities. On Unix, you will need to both uncompress and unpack the distribution before it is usable. Win32 distributions come as a self-unpacking file; all you need to do is double-click.

TIP

You may want to create a separate Unix filesystem to contain the Apache executables and, later, the servable Web documents. Providing a location in the directory tree where Apache can be segregated from the rest of the operating system is a good idea for both security and organizational purposes.

Unpacking the Distributions

UNPACKING UNIX DISTRIBUTIONS

The first step is to move the distribution file you downloaded into either its own filesystem or some location in the Unix hierarchy that is intended to contain third-party software and is large enough to contain the unpacked source code files. Currently you can get by with about 12 megabytes.

mv apache_X.Y.Z.tar.Z /apache 

Next you can begin the process of extracting files from the archive:

tar -xvzf apache_X.Y.Z.tar.Z 

WINDOWS

On Windows NT, you should first ensure that you have Service Pack 3 or better. Beyond that, installation on all Win32 platforms is just a matter of double clicking on the downloaded file.

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020