Skip navigation

restarted apache from terminal, now it's broken

1907 Views 11 Replies Latest reply: May 2, 2012 3:06 AM by Riquez RSS
daneover Calculating status...
Currently Being Moderated
Apr 29, 2012 6:52 PM

Doing some local developement and was tired of restarting apache through System Preferences > Sharing, so used

sudo usr/sbin/apachectl restart

via terminal, and after 3 or so restarts, it's broke. I'm not even able to enable Web Sharing in System Prefs. Wadidido?

MacBook Pro, Mac OS X (10.7.3)
  • Frank Caggiano Level 7 Level 7 (22,760 points)
    Currently Being Moderated
    Apr 29, 2012 7:10 PM (in response to daneover)

    Try a reboot and see if it comes back.

     

    If not post back

  • Barney-15E Level 7 Level 7 (33,270 points)
    Currently Being Moderated
    Apr 30, 2012 4:19 AM (in response to daneover)

    What does apachectl configtest return?

  • Frank Caggiano Level 7 Level 7 (22,760 points)
    Currently Being Moderated
    Apr 30, 2012 4:55 AM (in response to daneover)

    Also look in the Console for any errors. Open Console, clear the screen and try to start apache.

     

    What if anything is logged?

  • Barney-15E Level 7 Level 7 (33,270 points)
    Currently Being Moderated
    May 1, 2012 4:16 AM (in response to daneover)

    The second is just a note, and unless you have a domain name and set it in the config, then you'll get that message but nothing is wrong.

     

    However, the first one is causing the problem. The config is set to use /usr/docs/dummy-host.example.com as the root directory for the server. Since it doesn't exist, there is nothing to serve out. You need to edit the config file and set DocumentRoot to what it should be: DocumentRoot "/Library/WebServer/Documents"

     

    However, the path that lists in the errors isn't part of the default OS X apache configs. So, did you install another version of Apache?

  • Riquez Level 1 Level 1 (45 points)
    Currently Being Moderated
    May 1, 2012 8:38 PM (in response to daneover)

    httpd-vhosts.conf isnt enabled by default, so I assume you uncommented that line in httpd.conf

    Once you did that, the default example "dummy-host" became active, but doesnt exist - thus the error.

     

    Edit the dummy-host example to be a real site or comment out vhosts in httpd.conf

     

    Web Sharing is no longer used in Lion, so being OFF is ok.

  • Riquez Level 1 Level 1 (45 points)
    Currently Being Moderated
    May 2, 2012 3:06 AM (in response to daneover)

    After I upgraded to Lion I noticed the web sharing option in sys prefs is OFF. I have not touched it because my Apache is running normally after restarts.

    I suspect yours should automatically be running after a restart without doing anything, but if not then I am not sure how to proceed as I have never come across that issue.

     

    To test it just make sure apache is running 'sudo apachectl start' is fine to use, & then restart - just dont touch the system prefs panel at all.

    If you are needing to issue apachectl command after every restart then need to look into that further, its a new one to me.

Actions

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • 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.