Installing apache from source on older Linux

Installing apache from source on older Linux

Disclaimer:
The information provided in this guide is for educational and informational purposes only. It is provided “as is” without any representations or warranties, express or implied. You are using this information at your own risk. The author assumes no responsibility for any loss, damage, or issues arising from the use or misuse of the content provided.


Ensure compilers are installed.

CentOS / RedHat / Fedora
1. sudo yum check-update
2. sudo yum update
3. sudo yum install gcc automake autoconf gcc-c++ make curl wget perl-core zlib-devel openssl openssl-devel libtool expat-devel pcre2-devel

NOTE, you may already some packages installed.

Ubtunu
1. sudo apt update
2. sudo apt install build-essential wget curl openssl libssl-dev libpcre2-dev

NOTE, you may already some packages installed.


Prepare source code folder/subdirectory.

NOTE, For this example, I'll keep all file archives and source code under /opt/source

1. sudo mkdir -p /opt/source
2. sudo chmod a+rwx /opt/source

NOTE, in this example, we want to build a private install of Apache to /opt/apache2.4. If you want a different location, choose one and use that.  For example, /opt/WebServer.

3. sudo mkdir -p /opt/apache2.4

Build dependency, APR

1. Get the latest source code from Apache Portable Runtime Project
For example from your Linux host you can use:  wget https://dlcdn.apache.org//apr/apr-1.7.6.tar.gz
Otherwise, download it to your desktop and transfer it to your Linux system.
As of June 10, 2025, the latest Apache source code file is apr-1.7.6.tar.gz, we'll be using this filename as the example.  If a newer version is release, the steps should work the same, just use the filename of the newer version.

2. Transfer and copy/move the file, apr-1.7.6.tar.gz, to  /opt/source,  (cp /path/to/apr-1.7.6.tar.gz /opt/source)
If your Linux system has access to Apache website, you can try to download a copy directly using 'wget':
(cd /opt/source && wget https://dlcdn.apache.org//apr/apr-1.7.6.tar.gz)

3. Unpack: 
cd /opt/source
tar -xvf apr-1.7.6.tar.gz

4. Prepare to build:
sudo mkdir -p  /opt/apache2.4/apr
cd /opt/source/apr-1.7.6
sudo ./configure --enable-static --disable-shared --prefix=/opt/apache2.4/apr

5. build APR
make -j`nproc`
make -j`nproc` test
sudo make install


Build dependency, APR-UTIL

1. Get the latest source code from Apache Portable Runtime Project
For example from your Linux host you can use:  wget https://dlcdn.apache.org//apr/apr-util-1.6.3.tar.gz
Otherwise, download it to your desktop and transfer it to your Linux system.
As of June 10, 2025, the latest Apache source code file is apr-util-1.6.3.tar.gz, we'll be using this filename as the example.  If a newer version is release, the steps should work the same, just use the filename of the newer version.

2. Transfer and copy/move the file, apr-util-1.6.3.tar.gz, to  /opt/source,  (cp /path/to/apr-util-1.6.3.tar.gz /opt/source)
If your Linux system has access to Apache website, you can try to download a copy directly using 'wget':
(cd /opt/source && wget https://dlcdn.apache.org//apr/apr-util-1.6.3.tar.gz)

3. Unpack: 
cd /opt/source
tar -xvf apr-util-1.6.3.tar.gz

4. Prepare to build:
sudo mkdir -p /opt/apache2.4/apr-util
cd /opt/source/apr-util-1.6.3
sudo ./configure --disable-static --prefix=/opt/apache2.4/apr

5. build APR
make -j`nproc`
make test
sudo make install







Build Apache

1. Get the latest source code from Apache HTTP Server Project
For example from your Linux host you can use:  wget https://dlcdn.apache.org/httpd/httpd-2.4.63.tar.gz
Otherwise, download it to your desktop and transfer it to your Linux system.
As of June 10, 2025, the latest Apache source code file is httpd-2.4.63.tar.gz, we'll be using this filename as the example.  If a newer version is release, the steps should work the same, just use the filename of the newer version.

2. Prepare source code folder/subdirectory.




2. Transfer and copy/move the file, httpd-2.4.63.tar.gz, to  /opt/source,  (cp /path/to/httpd-2.4.63.tar.gz /opt/source)
If your Linux system has access to Apache website, you can try to download a copy directly using 'wget':
(cd /opt/source && wget https://dlcdn.apache.org/httpd/httpd-2.4.63.tar.gz)
3. Unpack: 
cd /opt/source
tar -xvf httpd-2.4.63.tar.gz
4. Prepare to build:
cd /opt/source/httpd-2.4.63
./configure --enable-ssl --enable-so



    • Related Articles

    • Installing Ollama on MacOS via Homebrew

      Disclaimer: The information provided in this guide is for educational and informational purposes only. It is provided “as is” without any representations or warranties, express or implied. You are using this information at your own risk. The author ...
    • Installing Python on MacOS via Homebrew

      Disclaimer: The information provided in this guide is for educational and informational purposes only. It is provided “as is” without any representations or warranties, express or implied. You are using this information at your own risk. The author ...
    • Linux - How to setup static IP Address via nmcli (NetworkManager CLI)

      Disclaimer: The information provided in this guide is for educational and informational purposes only. It is provided “as is” without any representations or warranties, express or implied. You are using this information at your own risk. The author ...
    • Installing Homebrew (brew) on MacOS

      Disclaimer: The information provided in this guide is for educational and informational purposes only. It is provided “as is” without any representations or warranties, express or implied. You are using this information at your own risk. The author ...
    • MySQL - Installing Latest Percona mysql on Debian 12

      Disclaimer: The information provided in this guide is for educational and informational purposes only. It is provided “as is” without any representations or warranties, express or implied. You are using this information at your own risk. The author ...