How to Install Apache HTTP Servecr on Linux

What is Apache HTTP?

Apache HTTP Server, colloquially called Apache (/əˈpætʃiː/ ə-PA-chee), is free and open-source cross-platform web server software,
released under the terms of Apache License 2.0. Apache is developed and maintained by an open community of developers under the auspices of the Apache Software Foundation.
commonly used on a Unix-like system (usually Linux), the program is available for Microsoft Windows as well.
Version 2.0 improved support for non-Unix, e.g. Windows and OS/2 (and eComStation). Old versions of Apache were ported to run on e.g. OpenVMS, and NetWare.

Apache HTTP Server can be compiled or downloaded from specific OS enviroments.

Install Apache and PHP on CentOS 6
Last updated on: 2016-06-21 Authored by: Rackspace Support
This article demonstrates how to install Apache and PHP on CentOS 6.
CentOS 6 comes with Apache 2.2.3 and PHP 5.1.6, and
you can install them by using the default CentOS Package Manager, yum. The advantages of using yum (as opposed to installing by using source code)
are that you get any security updates (when they are distributed) and dependencies are automatically handled.

Install Apache
Run the following command:
#sudo yum install httpd mod_ssl

The Apache2 web server is available in Ubuntu Linux. To install Apache2:
At a terminal prompt enter the following command:

#sudo apt install apache2

The Apache web server can be installed by using zypper. Open a terminal and become root. Type the below command:
# zypper in apache2

root account on the server machine.

Binaries Download Apache
Apache HTTP Server download site. Download the source files appropriate to your system.
Binary releases for some operating systems are available as well.
Extract the Apache Files

uncompress file after complete download

#$gunzip -d httpd-2_0_NN.tar.gz
#tar xvf httpd-2_0_NN.tar

This creates a new directory under the current directory with the source files.

Configuring Your Server for Apache

Once you have the files, you need to tell your machine where to find everything by configuring the source files.
The easiest way is to accept all the defaults and just type:

Apache Standards Option is the prefix=PREFIX option.
This specifies the directory where the Apache files will be installed.

Specific environment variables and modules.

1.mod_alias – to map different parts of the URL tree
2.mod_include – to parse Server Side Includes
3.mod_mime – to associate file extensions with its MIME-type
4.mod_rewrite – to rewrite URLs on the fly

5.mod_speling (sic) – to help your readers who might misspell URLs
6.mod_ssl – to allow for strong cryptography using SSL
7.mod_userdir – to allow system users to have their own web page directories

For details about the modules go Apache homepage

Overview for the impatient

Download Download the latest release from
Extract $ gzip -d httpd-NN.tar.gz
$ tar xvf httpd-NN.tar
$ cd httpd-NN
Configure $ ./configure --prefix=PREFIX
Compile $ make
Install $ make install
Customize $ vi PREFIX/conf/httpd.conf
Test $ PREFIX/bin/apachectl -k start

Build Apache source installation, you’ll then need to build the installation:

Perform make Command

make install

Customize Apache

Assuming that there were no problems, you are ready to customize your Apache configuration. This really just amounts to editing the httpd.conf file.
This file is located in the PREFIX/conf directory. I generally edit it with text editor.
vi PREFIX/conf/httpd.conf

Note: you’ll need to be root to edit this file.
Follow the instructions in this file to edit your configuration the way you want it. More help is available on the Apache website.

Test Your Apache Server
Open a web browser on the same machine and type http://localhost/ in the address box.

You should see a page similar to the one in the partial screen shot above. It will say in big letters “Seeing this instead of the website you expected?”

This is good news, as it means your server is installed correctly.
Start Editing/Uploading Pages to Your Newly Installed Apache Web Server

Once your server is up and running you can start posting pages. Have fun building your website!

Apache HTTP Apache

Apache HTTP Server Version 2.4

Apache HTTP Serer Download Binaries

Apache on Ubuntu

Apache on Centos/RHEL

Apache on SLES

Video Tutorial
How to install and run Apache web server in Ubuntu Linux

How Install LAMP on Ubuntu Web Server


Leave a Reply

Your email address will not be published. Required fields are marked *