To stop the built-in Apache server in Mac OS X, use this command:
sudo apachectl -k stop
Then just enter your administrator password. And to prevent Apache from coming up again on if your system reboots/restarts just run this launchctl unload command; you’ll need your administrator password again:
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist
When that’s all done, check the output of
sudo lsof -i:80 and the built-in Apache web server in Mac OS X should be completely stopped and disabled.