Apache not running correctly after upgrading to High Sierra I have an apache web server running on my mac.  Since upgrading to macOS High Sierra, if I connect to localhost or 10.0.0.7 in Safari (or any other web browser) I get the message "Safari can't open the page "localhost" because Safari can't connect to the server "localhost".

I can confirm apache is running.  If I run apachectl configtest I get "Syntax OK".

If I type httpd -v I get

Server version: Apache/2.4.28 (Unix)
Server built:   Oct 19 2017 09:26:34


I have tried restarting apache and this has no effect.  Does anyone have any idea how I can get it working?  All my web files are stored in /Library/WebServer/Documents.

Attached is a copy of my httpd.conf.
Take a look at your hosts file, you should have entries in there for your localhost and local configuration. The hosts file is in /etc, so the best way to open it is by using Terminal and this (read-only) command:

open -a TextEdit /etc/hosts


You should see an one or all of these for localhost there like:

127.0.0.1   localhost   
::1         localhost
fe80::1%lo0 localhost


127.0.0.1 is your machine (aka localhost).

You can add other IP addresses from your local network to route domain names to a local development folder to the hosts file. For example, mine has custom entries from old projects like:

10.0.10.111     teambox.dongguk.ac.kr


To make changes to the hosts file, you'll need to use: 

sudo open -a TextEdit /etc/hosts


Enter your user account password when prompted.

Here is a full article on making edits to your hosts file: The Mac Hosts File: How to Modify /etc/hosts in OS X with TextEdit