Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Just got a MacBook Pro 15" so I'm unfamiliar with how the filesystem is laid out. I noticed when in my filesystem that I've got a few paths specifying httpd.conf:

/etc/apache2/httpd.conf
/opt/local/apache2/conf/httpd.conf
/private/etc/apache2/httpd.conf

The config files are different in lots of ways (user, group, server_root, modules that are loaded, etc.) The apache2 folders themselves also greatly differ.

It seems that the one getting used is either /etc/apache2/httpd.conf or /private/etc/apache2/httpd.conf

I'm wondering if I might have messed up my system after installing some packages (php5, django, etc) via macports and maybe ended up with 2 apache2 instances.

My questions are hence:

  • which httpd.conf is the one being used ?
  • what are the other files for?

thanks

--update--
To clarify, I didn't explicitly install apache2 via macports. I'm wondering if it was installed because it was a dependency. After more hunting around I'm learning I never should've installed php to begin with because Snow Leopard already includes php 5.3 from the get go.
http://serverfault.com/questions/82410/apache-2-and-php-5-3-via-macports

I'll need to open another question that asks about how the Mac filesystem works.
Thanks all for replies.

share|improve this question

1 Answer 1

up vote 6 down vote accepted

The /etc/apache2/httpd.conf file is just a symbolic link pointing to the /private/etc/apache2/httpd.conf file (so their contents should be identical).

The one in /opt/local/apache2 was probably loaded by you when you installed macports.

One relatively easy way to see which one is being used is to check the last access times of the files:

ls -lutrd /opt/local/apache2/conf/httpd.conf /private/etc/apache2/httpd.conf

Check the time stamps to see which one was last used. If you have opened/looked-at the files, then that could change the date, so in that case you could reboot your machine and then check the access date/times of those files.

share|improve this answer
    
hey marnix, thanks for replying. couple things: - how would i know that /etc/apache2/httpd.conf is a symlink? when i do ls -al in /etc/apache2 it shows up as a normal file? same thing for the one in private. - if macports installed apache2, how do i remove it? - is it normal for macports to install apache2 to /opt/local/ even tho there is an apache2 on my system already? thanks –  w-- Apr 10 '10 at 0:25
    
The entire /etc directory is a symlink. –  Hasaan Chop Apr 10 '10 at 1:52
    
I should have stated that /etc is a symbolic link to /private/etc . –  Marnix A. van Ammers Apr 12 '10 at 3:42
    
I'm not sure what the proper procedure is to remove macports files. I do believe it is normal for macports to go into /opt/local . –  Marnix A. van Ammers Apr 12 '10 at 3:45
    
see above update pls. Marnix's answer does answer my original questions (and replies in comments were also helpful) so i've marked it as accepted answer. Thx. –  w-- Apr 12 '10 at 18:22

Your Answer

 
discard

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.