Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to set up apache virtual hosts on my local machine. Since my file system is kind of a mess, I have several hosts files hanging around. Is there a way to determine which hosts file my apache installation is using?

share|improve this question

Use apachectl -S to determine which virtual hosts (and their location in files) are in your configuration.

share|improve this answer
I guess I'm not explaining myself well enough. I'm looking for the hosts file, not the .conf files. – symlynk Feb 3 '13 at 7:06
That doesn't really have anything to do with the virtual hosts. /etc/hosts..? – Shane Madden Feb 3 '13 at 7:10
nevermind, I think I found it /private/etc/hosts. I had a hosts file manager that was confusing things. – symlynk Feb 3 '13 at 7:16
Hosts file manager? That certainly could confuse things. Why not use DNS instead? – Shane Madden Feb 3 '13 at 7:18
It was an old setup that a friend at work setup for me. Not sure why he chose it. – symlynk Feb 3 '13 at 7:21
ps aux | grep catalina

Should show the conf files which are being used by the currently running catalina instance.

share|improve this answer
Is that just for apache Tomcat? I tried the command and didn't get back any info about my hosts file. – symlynk Feb 3 '13 at 7:01
I am afraid its only for tomcat. – Gaurav Agarwal Feb 3 '13 at 7:05

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.