How to Install Apache HTTPD
Apache HTTPD server is a free-open source web server software which is widely used in Linux/Unix kind of operating systems.
The Goal of this server is to provide secure, efficient and extensible way by which it provides all HTTP Standards & Services.
The latest version of Apache HTTPD Server in market is HTTPD 2.4.
To Install using YUM package:-
We can install apache httpd server using yum command for Redhat / CentOS oFedora Linux. Also using below command for other flavours of Linux, Below command will install httpd2.0.* version which ever is yum repository configured.
#yum install httpd -y
Note that -y will force proceed with the installation without user’s signal.
Install or Build Apache From Source :-
Download the required version of tar file – either httpd 2.2 or httpd 2.4 version which are currently available in the Apache site.
lets download httpd-2.2.31.tar.gz in the /opt drive, login as root or administrative account,
1. Extract the gz file using tar command
# tar -xvzf httpd-2.2.31.tar.gz
# cd httpd-2.2.31
2. Configure the files
#./configure --prefix=PREFIX [ Include what ever the configuration or specs needed]
for example –enable-rewrite=shared –enable-speling=shared, -q for quiet , –srcdir = source directory.
Compile the package using make command
# make install
finally install using make install command
Start the Apache:-
To Start the httpd server we can use both the following ways
# /etc/init.d/httpd start
#apachetl -k start
Once webserver is started, we can hit the browser by http://localhost/ or http://www.<domainName>/
To Stop :-
Similarly for stopping the apache server, we can use the stop command
# /etc/init.d/httpd stop
#apachetl -k stop
Permanent chkconfig Configuration:-
# chkconfig httpd on
To check whether Apache is running or not:-
Below command will check for the port 80 which is the default configured port for Apache HTTPD.
# netstat -tulpn | grep :80
If apache is running we will see the response like below
tcp 0 0 :::80 ::* LISTEN 0 2710371 7760/httpd
That’s All the steps needed for installation of Apache http web server.