Skip navigation

reinstall apache2

2901 Views 3 Replies Latest reply: Nov 7, 2013 2:15 AM by Tony.Law RSS
JeffSharps Calculating status...
Currently Being Moderated
Jan 28, 2013 7:02 PM

Hey, I was trying to set up apache to test web work on localhost, and now apache will not connect to localhost at all. Is there any way to restore apache to factory new to start over? I don't have time machine, and I would rather not reinstall all of OS X.


Also, what is the difference between /etc/apache2 and /private/etc/apache2? Googling how to set up apache on Mountain Lion, there is some info that references one, some the other. None helped me get apache running he way I wanted, just got it to where it won't connect to localhost at all, must less localhost/~myusername

MacBook Pro, OS X Mountain Lion (10.8.2)
  • gracoat Level 3 Level 3 (645 points)
    Currently Being Moderated
    Jan 29, 2013 11:40 AM (in response to JeffSharps)

    The /private/etc folder is the same folder.  /etc is an alias or a symbolic link to /private/etc.


    You just need to restore the contents of /etc/apache2/httpd.conf and /etc/apache2/extra/ with the contents of /etc/apache2/originals/


    In terminal, like this.  (4 commands)


    sudo serveradmin stop web

    sudo cp /etc/apache2/originals/httpd.conf /etc/apache2/

    sudo cp /etc/apache2/originals/extra /etc/apache2/

    sudo serveradmin start web


    If this doesn't work, the likely there's other issues at play.







    Oh!  Don't mess with the config files.  The GUI doesn't like it!  If you have to use the terminal you should make as many changes as possible in the GUI first.  ONLY THEN change the config files.  Abandon the GUI completely after that.  Changes made here will mess up your command line work.

  • Tony.Law Calculating status...
    Currently Being Moderated
    Nov 7, 2013 2:15 AM (in response to gracoat)

    This solved my problem but the backup folder in Lion is /etc/apache2/original/ (not /originals/)




More Like This

  • Retrieving data ...

Bookmarked By (0)


  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.