Escolar Documentos
Profissional Documentos
Cultura Documentos
Objectives:
Learn how to install Apache Web Server from a tarball (binary package)
Familiarize the students on how web server works
Learn how to configure Apache web server according to a given specification
Familiarize on how to build a high profile web server
Concepts
The diagram shows that your browser formed a connection to a Web server, requested a page and
received it.
The browser communicated with a name server to translate the server name "hei.donbosco.net" into
an IP Address, which it uses to connect to the server machine.
The browser then formed a connection to the server at that IP address on port 80. Following the
HTTP protocol, the browser sent a GET request to the server, asking for the file
"http://hei.donbosco.net/demo.htm."
The server then sent the HTML text for the Web page to the browser.
The browser read the HTML tags and formatted the page onto your screen.
A tar ball is usually an archive file, similar to a zip file on Windows. Tar balls come in files that
end in:
.tar
.tar.gz
.tgz
The installation procedure that comes in a .tar.gz and tar.bz2 packages isn't always the same, but
usually the necessary steps are as follows:
These simple commands are used to unpack, configure, and install the software package.
<Step 1> Unpacking
As discussed in the earlier part of this activity paper, having a .tar, .tar.gz / .tgz or .bz2 means that the
files are archive/compressed files or known as a tar ball.
When you run the configure script, you don't actually compile anything yet, configure just
checks your system and assign values for system-dependent variables. These values are used for
generating a Makefile. The Makefile in turn is used for generating the actual binary.
When you run the configure script, you will see a bunch of weird messages scrolling on your screen.
This is normal. If configure finds an error, it complains about it and exits. However, if everything
works, it exits and shuts up.
To build the binary, the executable program, from the source code is accomplished by make
command.
sysadmin@AMD64~$> make
Note that the make needs the Makefile for building the program. This is why it's important to
run the configure script successfully.
To save some disk space, you have to delete the files you do not need. When you ran make it
created all sorts of files that needed during the build process that will become useless now and are just
taking up space.
Make sure you keep your Makefile. It's needed if you later decided to uninstall the program.
Apache Web Server
Apache, otherwise known as Apache HTTP Server, is an established standard in the online
distribution of website services, which gave the initial boost for the expansion of the World Wide Web.
It is an open-source web server platform, which guarantees the online availability of the majority of the
websites active today. The server is aimed at serving a great deal of widely popular modern web
platforms/operating systems such as Unix, Windows, Linux, Solaris, Novell NetWare, FreeBSD, Mac
OS X, Microsoft Windows, OS/2, etc.
There are two popular versions for the origin of the project's name. According to the more
widespread one - the web server's name was chosen out of respect for the Native American Indian
Apache tribe, well known for its resilience and military skills. The other version refers to the set of
patches attached to the codebase of NCSA HTTPd 1.3, which makes it "a patchy" server.
The Apache server has been developed by an open source community - Apache Software
Foundation, whose members are constantly adding new useful functionalities, with the sole purpose of
providing a secure and extensible server platform that ensures HTTP service delivery in accordance
with the current HTTP standards.
There is a great amount of modules created especially for the Apache server, which support
various scripts and allow dynamic content to be run on the server. Most of the modules come as part of
the Apache distribution, making the server boast a wide range of capabilities, such as support for CGI
(Common Gateway Interface), a standard protocol for communication between external application
software and a web server, and also SSI (Server Side Includes), a simple server-side scripting language.
Other Apache modules include: CGI scripts execution, user authentication, URL redirection,
anonymous user access, automatic directory listings, support for HTTP header metafiles, support for
loading modules, content negotiation, caching proxy abilities, server status display, user home
directories, etc. Users can choose to install those modules with the Apache server installation. If not,
they can install them later with the help of dynamic modules.
The Apache server has been the most popular web server on the Internet since April 1996. It is
by no means considered a platform criterion for the development and evaluation of other successful
web servers.
Procedures:
1. Download the latest Apache tarball. Latest version as of writing is 2.2.15 released(2010-03-06).
File: httpd-2.2.15.tar.gz
Location to download: /home/Dawat/donwloads
FTP server: ________________________
FTP username: _____________________
FTP password: _____________________
2. Decompress and untar the binary package you just have downloaded.
3. You need to install all of the basic software components necessary to compile your Apache
binary package. "build-essential" is required if you are trying to install a program which must
be compiled.
4. Configure the Apache source tree for your particular platform and requirements. This is done
using the configure script included in the directory of the distribution.
To configure the source tree using all the default options, simply type ./configure. To change
the default options,configure accepts a variety of variables and command line options.
The most important option is the location -- prefix where Apache is to be installed later,
because Apache has to be configured for this location to work correctly. More fine-tuned
control of the location of files is possible with additional configure options.
Also at this point, you can specify which features you want included in Apache by enabling and
disabling modules. Apache comes with a Base set of modules included by default. Other
modules are enabled using the - -enable-module option, where module is the name of the
module with the mod_ string removed and with any underscore converted to a dash. You can
also choose to compile modules as shared objects (DSOs) -- which can be loaded or unloaded at
runtime -- by using the option --enable-module=shared. Similarly, you can disable Base
modules with the --disable-module option. Be careful when using these options, since configure
cannot warn you if the module you specify does not exist; it will simply ignore the option.
In addition, it is sometimes necessary to provide the configure script with extra information
about the location of your compiler, libraries, or header files. This is done by passing either
environment variables or command line options to configure.
The configure script explores your operating system and creates the Makefile for it so you can
execute the following to start the actual compilation process, copy files into the directory set by the
prefix option and execute the apachectl script to start the Apache server.
5. Compile Apache by running make. This will compile the source code into executable.
6. Install Apache using the make install script. In this step, all binaries will be copied into the
install directory and sets up the modules.
7. Starting, Stopping and Restarting Apache. We now start/stop Apache using the apachectl script
found at the bin directory of your install directory.
sysadmin@AMD64~> /usr/local/apache2/bin/apachectl start
8. Start Apache on boot. You also need to configure your operating system to start Apache when
the computer boots.
sysadmin@AMD64~> cd /etc/rc3.d
9. Testing the installation. To verify if the installation was successful, try to access the web server
using a browser as a client.