To check the ports enter:
sudo lsof -i :80
sudo lsof -i :443
The commands will yield something like this:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
httpd 316 root 5u IPv6 0xec3d90f272a0383d 0t0 TCP *:http (LISTEN)
httpd 378 _www 5u IPv6 0xec3d90f272a0383d 0t0 TCP *:http (LISTEN)
httpd 379 _www 5u IPv6 0xec3d90f272a0383d 0t0 TCP *:http (LISTEN)
httpd 380 _www 5u IPv6 0xec3d90f272a0383d 0t0 TCP *:http (LISTEN)
httpd 381 _www 5u IPv6 0xec3d90f272a0383d 0t0 TCP *:http (LISTEN)
httpd 382 _www 5u IPv6 0xec3d90f272a0383d 0t0 TCP *:http (LISTEN)
httpd 59259 _www 5u IPv6 0xec3d90f272a0383d 0t0 TCP *:http (LISTEN)
and
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
httpd 316 root 7u IPv6 0xec3d90f272a01d5d 0t0 TCP *:https (LISTEN)
httpd 378 _www 7u IPv6 0xec3d90f272a01d5d 0t0 TCP *:https (LISTEN)
httpd 379 _www 7u IPv6 0xec3d90f272a01d5d 0t0 TCP *:https (LISTEN)
httpd 380 _www 7u IPv6 0xec3d90f272a01d5d 0t0 TCP *:https (LISTEN)
httpd 381 _www 7u IPv6 0xec3d90f272a01d5d 0t0 TCP *:https (LISTEN)
httpd 382 _www 7u IPv6 0xec3d90f272a01d5d 0t0 TCP *:https (LISTEN)
httpd 59259 _www 7u IPv6 0xec3d90f272a01d5d 0t0 TCP *:https (LISTEN)
Now check one or all of the pids with e.g.:
ps u 59259
with the result:
_www 59259 0,0 0,1 2448556 2360 ?? S 4:00pm 0:00.01 /usr/sbin/httpd -D FOREGROUND -f /Library/Server/Web/Config/Proxy
Obviously it's related with apache/httpd but the webserver isn't loaded. So check /Library/Server/Web/Config/Proxy. The relevant file here is /Library/Server/Web/Config/Proxy/apache_serviceproxy.conf. Comment out or modify the annoying listening ports at the beginning of the file. Reboot. This will break some OS X Server.app functionality.
Alternatively you may simply uncheck Enable PHP and Enable Python in the Server.app > Websites (even if Websites are Off!). There is a delay of up to 31 seconds until the new settings become operative.