How to switch from mac server App to Apache

apache

I want to use Apache on macOS 10.13.
I issued "sudo apachectl start" command then it enabled.
I confirmed to display "It works" on the browser by http://localhost/ and I could know Apache worked properly.

But recently after I load Server app.
Then when I enter http://localhost/, "Welcome MacOS server" display. It means web server is used for App server instead Apache.
"Welcome MacOS server" continues to display even when I disabled MacOS web server. How can I switch to Apache?

Regards
Simon

Best Answer

How to deactivate MacOS server apache

This command deactivates web services

$ sudo serveradmin stop web

These commands should unload the launch daemons inside Server app. Following my experience Server Apache takes over as soon as you install server app. Stopping web services in some cases is not sufficient. By unloading the Apache daemon server app is unable to start its Apache.

$ sudo launchctl unload -w /Applications/Server.app/Contents/ServerRoot/System/Library/LaunchDaemons/com.apple.server.httpd.plist
$ sudo launchctl unload -w /Applications/Server.app/Contents/ServerRoot/System/Library/LaunchDaemons/com.apple.serviceproxy.plist

When configuring Server’s Apache the following configuration files are used. By uncommenting any listen section Server Apache will not be able to run.

$ nano /Library/Server/Web/Config/Proxy/apache_serviceproxy.conf
$ nano /Library/Server/Web/Config/apache2/services/ACSServer.conf

When Server Apache does not know which ports it has to listen to, it does not run.

Depending from your system some steps or all of them might be necessary to stop Server Apache from running and for your Apache installation to take over. All these steps will only affect your server web services.

With the next Server App web service will be gone.