
Apache 2.4.6 Installation on Unix


A quick guide to learn how to install Apache HTTP Server on Linux environment
Apache is the most popular web servers and if you are working as System Administrator then it’s very likely that you will not cross the path to Apache HTTP.
This is not typical yum installation instead download the source code and compile on your Linux environment.
Let’s get it started with the download and installation procedure.
Download Apache HTTP
- We will use the latest Apache Web Server stable available version 2.4.6 on Centos 6.3 OS in this article.
- Download Apache 2.4.6 version fromย https://httpd.apache.org/download.cgi
- Letโs download to /opt/apache folder
- Once downloaded, you should have httpd-2.4.6.tar.gz
Installing Apache HTTP
We will install Apache under /opt/apache directory with mod_ssl enabled.
Requirements
- ANSI-C compiler and Build system โ ensure you have GCC or CC compiler installed on your server and set in PATH. You can install GCC with yum as following.
# yum install gcc
- Apr/apr-util โ ensure you have apr/apr-util 1.2 installed on your server.
- OpenSSL โ ensure you have the latest OpenSSL version on your server. You can install OpenSSL with yum as following.
# yum install openssl
- Letโs extract the downloaded file under /opt/apache by executing the command
# gunzip โc httpd-2.4.6.tar.gz | tar xvf โ
- Now you could see it has extracted everything into new folder httpd-2.4.6
- Go to httpd-2.4.6 folder
- Letโs compile and install the Apache source code
# ./configure --with-apr=/usr/local/apr/bin/apr-1-config --prefix=/opt/apache/ --enable-ssl --enable-so
# make
# make install
Letโs understand the configured syntax in a better way.
- –with-apr=ย instructs to use a specified apr configuration file
- –prefix=ย Provide the location where you wish to install, in this example Apache, will be installed under /opt/apache
- –enable-sslย this will compile apache with SSL enabled so can secure Apache web server with SSL cert.
- –enable-so toย enable shared modules
Upon successful compilation, you could see Apache is installed under /opt/apache as following.
Now, we can delete httpd-2.4.6.tar.gz and httpd-2.4.6 folder from this location, as these are no longer required.
# rm โrf httpd-2.4.6.tar.gz httpd-2.4.6
Next, you may be interested in securing them.
More great readings on Apache HTTP
-
How to Redirect AMP Page to Non-AMP in Nginx, Apache, Cloudflare?Abhishek Nair on September 27, 2021
-
How to Install Apache and Secure with Let’s Encrypt Certtificate?Aghilan Baskar on April 5, 2021
-
How to Block .git in Apache, Nginx and Cloudflare?Chandan Kumar on October 27, 2020
-
How to Protect Page with Password in Apache, Nginx, WordPress, Hosting?Chandan Kumar on September 11, 2020
-
How to Implement ZeroSSL Certificate in Apache and Nginx?Asad Ali on May 24, 2020
-
How to Enable CORS in Apache and Nginx?Chandan Kumar on October 18, 2019
Join Geekflare Newsletter
Every week we shareย trending articlesย andย toolsย in our newsletter. More than 10,000 people enjoy reading, and you will love it too.