Introduction
I was trying to deploy some Docker containers yesterday which use ports 80 and 443. OK, I will confess that I was trying to deploy Wordpress or Bitnami Wordpress and MySQL to containers to see if I could migrate my personal blog to Wordpress. Eventually, I am hoping to migrate all of my blogs to a new blogging environment.Problem
Well the containers would not deploy because the ports 80 and 443 were being used. A quick connection to localhost confirmed that the Apple Server.app was using these ports for running its processes. So I logged into the Server.app only to discover no way to turn it off.Solution
Apple Server.app service is simply that... a service. Thelaunchctl
command will allow us to stop and start services. So I tried to stop the service only to discover it will automatically restart on a new PID. The only solution apparently is to unload the service temporarily.
The following commands will allow you to unload and load the com.apple.serviceproxy
service, and check its status. This will allow
you to use Docker containers on those ports while doing your development and testing.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Unload the Service Service | |
sudo launchctl unload -w /Applications/Server.app/Contents/ServerRoot/System/Library/LaunchDaemons/com.apple.serviceproxy.plist | |
# Load the Service Service | |
sudo launchctl load -w /Applications/Server.app/Contents/ServerRoot/System/Library/LaunchDaemons/com.apple.serviceproxy.plist | |
# Check the status of the Server Service | |
sudo launchctl list com.apple.serviceproxy |