Need help about apache 2.4.46 configuration on rhel 7.2!!! (HTTPD_ROOT)

Latest response

The first time I installed apache 2.4.46 from source downloaded on the Internet , I just run "./configure && make && make install", so the default directories for this are :
ServerRoot :: /usr/local/apache2
DocumentRoot :: /usr/local/apache2/htdocs

However, my team-lead need to install with "ServerRoot=/etc/httpd" and "DocumentRoot=/var/www/html'
Thus, I remove /usr/local/apace2 folder and reinstall with command
"./configure --prefix=/etc/httpd --docdir=/var/www/html" and then, make && make install.
The problem is when I start apache, it has an error that "httpd: Could not open configuration file /usr/local/apache2/conf/httpd.conf: No such file or directory".

I then run "/etc/httpd/bin/apachectl -V" command and found out that the HTTP_ROOT is still associtated with /usr/local/apache.
[root@localhost ~]# /etc/httpd/bin/apachectl -V
-D HTTPD_ROOT="/usr/local/apache2"
-D SUEXEC_BIN="/usr/local/apache2/bin/suexec"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"

Hence, my question is, how can I change this PATH for HTTPD_ROOT like this "HTTPD_ROOT=/etc/httpd".?
Thanks a lot for all your support, guys and I'll appreciate it


If you run ./configure --help it shows you all the options. You might need to run make clean before running make again.

You also might want to look in the official package SRPM specfile to understand all the options passed to the configure script (line 547), because what you're trying will place the executables in /etc/ which is generally not a good idea. SELinux might even deny that from running.

Besides compiling from source, you could consider what actual features of 2.4.46 that you need.

As our package version 2.4.6-97 implies, that's Apache 2.4.6 with 97 other changes, where each change pulls in at least one (often more) fixes from later Apache versions. You can look in the changelog to see exactly what those are.

So if you actually need Apache 2.4 with some recent CVEs fixed, our package might meet your needs and would be fully supported, which is better for you and for Red Hat.

If that's still no good, we also offer Apache 2.4.34 in the latest Red Hat Software Collections 3.7 package called httpd24. If you need a newer feature which isn't in RHEL 7's httpd package, maybe the RHSCL package has it and provides you another supported option.

Thanks a lot!!! It helps me so much! Finally I accomplished my task after running "make clean" command. It removed all the previous setting on my rhel system. Then, I could "make && make install" again without any error.