Install Apache on CentOS/RHEL

Brief Introduction About Apache

To describe Apache HTTP Server, I prefare to use exact phrases from it’s Wikipedia page:

The Apache HTTP Server, commonly referred to as Apache (/əˈpætʃiː/), is web server software notable for playing a key role in the initial growth of the World Wide Web.
Apache was the first viable alternative to the Netscape Communications Corporation web server (currently named Oracle iPlanet Web Server)
As of March 2012 Apache was estimated to serve 57.46% of all active websites and 65.24% of the top servers across all domains.
Apache supports a variety of features, many implemented as compiled modules which extend the core functionality.
Some common language interfaces support Perl, Python, Tcl, and PHP.
Although the main design goal of Apache is not to be the “fastest” web server, Apache does have performance similar to other “high-performance” web servers.

So it would be a good choice to use Apache for your server.

Apache Installation Ways

There are two ways you can get Apache installed on your server which I know:

  • Compile Apache from it’s binary files
  • Install via Yum command

 

Compiling Apache (with DSO support)

To compile the source, you should download the .tar.gz file from one of the mirrors in official Apache website download section or from the Apache site itself:

wget http://mirror.cc.columbia.edu/pub/software/apache//httpd/httpd-2.4.1.tar.gz

then unpack the downloaded file:

tar -xzf httpd-2.4.1.tar.gz

After that you should go in the extracted folder and start Building and installing Apache:

cd httpd-2.5.1
make clean
./configure 
--prefix=/usr/local/apache 
--enable-shared=max 
--enable-module=rewrite 
--enable-module=so
make
make install

After the installation, you should make Apache  to run every time your server boots-up:

chkconfig httpd on

Notice: if you faced any error due to the command above, it’s probably because the Apache is not installed as service.

Installing Apache Using Yum

This is way easier that compiling, just follow the command below:

yum install httpd httpd-devel

and finaly after following the step above, you should make the Apache autostarted every time your server boots:

chkconfig httpd on

Leave a Reply

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

This is new type of CAPTCHA, make the puzzle please !WordPress CAPTCHA