0

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 associated 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_PIDLOG="logs/httpd.pid"
    -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!

3
  • RHEL has Apache 2.4 available as a package. Why not use that? Commented Jun 29, 2021 at 7:20
  • 1
    @roaima apache 2.4.6 has a few common features missing. Eg it requires a separate option to tell where to use the intermediate TLS certificate instead of bundling it to the server certificate. BUT, there's RHEL Software Collections providing httpd (2.4.34 afaik). As it's RHEL (and not CentOS) it's a bit more difficult: access.redhat.com/solutions/472793 . That way one wouldn't have to figure out how to get SELinux to work with a local installation etc. Commented Jun 29, 2021 at 12:29
  • OK. Does ./configure --help give you any suggestions for a suitable flag. Failing that do the installation instructions offer any suggestions? Commented Jun 29, 2021 at 12:41

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.