0

How can I reliably find the location of httpd.conf?

I am looking for a solution, or if necessary a combination of things that will find the location of httpd.conf quickly and reliably on as many Operating Systems as possible.

Thanks!

7
  • 1
    find / -name "httpd.conf" ? or apache2 -V that gives something like SERVER_CONFIG_FILE="/etc/apache2/apache2.conf"? Nov 18, 2015 at 1:11
  • That's not bad, but could be very slow in a big filesystem. Perhaps there are very common places for httpd.conf that could limit where we look? Or perhaps httpd.conf location is always somewhere relative to some other apache thing?
    – mareoraft
    Nov 18, 2015 at 1:16
  • I was hoping there was an apache2 command that just told you where it was.
    – mareoraft
    Nov 18, 2015 at 1:18
  • I installed apache24 on FreeBSD via pkg, but both "apache2" and "apache24" are not commands. Now I'm trying to find that.
    – mareoraft
    Nov 18, 2015 at 1:21
  • It looks like apachectl -V is working for me on both OSX and FreeBSD.
    – mareoraft
    Nov 18, 2015 at 1:31

1 Answer 1

1

For me,

apachectl -V

works on both OSX and FreeBSD.

If anybody has a better answer or a continuation of this answer for other operating systems, feel free to share.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .