Cleanup apache config for Lion Server

You can restore the web server to factory settings.

  1. Turn off the Web Server service
  2. Open Terminal and run sudo serveradmin command web:command=restoreFactorySettings
  3. Enter your administrator password
  4. Restart Web Server service.

If that didn't do the trick,

  1. turn off everything which uses Apache (Wiki, iCal-Server ...)
  2. run the following command

    sudo /System/Library/PrivateFrameworks/ServerFoundation.framework/Resources/xswebconfig restorefactorysettings
    

The answer using serveradmin to reset factory defaults calls the xswebconfig and sometimes you need to force the lower level reset and consider other web based services that may lock and prevent a shutdown of the service.