Macos Apachectl binded to the wrong executable

1

Macos 10.12.4

The command apachectl is not binded to the running apache I use on localhost.

apachectl -V
Server version: Apache/2.4.25 (Unix)
(...)
-D SERVER_CONFIG_FILE="/usr/local/etc/apache2/2.4/httpd.conf"

if I check where apachectl is :

whereis apachectl
/usr/sbin/apachectl

Then if I do

/usr/sbin/apachectl -V
Server version: Apache/2.4.25 (Unix)
(...)
-D SERVER_CONFIG_FILE="/private/etc/apache2/httpd.conf"

Which is strange, because this is the apache server I use in localhost and it's not controlled by the global apachectl command.

How to I bind apachectl to /usr/sbin/apachectl ?

How can I locate the executable binded to apachectl in order to remove it ?

Vincent Tschanz

Posted 2017-04-10T12:30:02.877

Reputation: 63

Did you ever figure out what do with this? I noticed on my box that I had another instance of apachectl that was installed by homebrew. And that's what was bound to the apachectl command on my mac, even though it was serving files with the /usr/sbin version. I'm curious to understand more how to switch between the two. – joelliusp – 2018-02-13T02:08:20.237

I made a clean install of 10.13 and followed this guide (installing Xcode is not mandatory despite what they are saying) https://getgrav.org/blog/macos-sierra-apache-multiple-php-versions

– Vincent Tschanz – 2018-02-20T14:25:13.370

No answers