Install Apache HTTP Server

  1. Install the dependent packages for Apache HTTP server.

# dnf install apr apr-devel apr-util apr-util-devel expat pcre pcre-devel make gcc perl -y 
  1. Download the Apache Open-Source Library files from Apache Website.

# wget https://dlcdn.apache.org/httpd/httpd-2.4.56.tar.gz 

If you are installing through dnf install httpd command, then skip step 3 and 4.

  1. Extract the downloaded packages.

# tar -xzvf httpd-2.4.54.tar.gz
  1. Go to httpd-2.4.54 directory, build and install Apache HTTP using the following commands.

# cd httpd-2.4.54.tar.gz 

#./configure  --prefix=/usr/local/apache --enable-ssl --withssl=/usr/local/openssl 

# make 

# make install 
  1. Start the Apache HTTP Service with below command. If you have installed from source code:

# /usr/bin/apache/bin/apachectl -k start 

If you have installed from dnf:

# systemctl start httpd.service


  1. Open any browser and run the http://<apache_server_ip> to verify that apache service is running successfully.

image-20260322-222053.png


Apache web page