Coolestguideontheplanet.com always has been my go-to spot for macOS upgrades and I'll be borrowing for some of the steps as it'll get you about halfway to enabling localhosts.
You'll need to either use a CLI utility like Nano or BBEdit. If using BBEdit, you will need to click the "Show Everything" box to view invisible files.
Step 1: Modify the httpd.conf
Open the httpd.conf
Uncomment the following lines by removing the
# in front of the line
Step 2: Modify the Vhosts.conf
Open the vhost.conf (Note if you've upgraded, macOS should have the httpd-vhosts.conf~previous in the same directy) configuration
Entries are added by using the following pattern.
Here's an example of a working entry ported from macOS (OS X) 10.12.x
Step 3: Map Localhost to hosts
Open the hosts file:
Important, this next step can vary quite a bit based on how you've mapped your vhosts URLs. I decided I want all instances of localhost AND lvh.me (lvh being the acrnynom many developers use for local virtual host and the dot me suffix to reinforce that it is local). This is super common.
Step 4: Restart Apache
Regardless if you were using a GUI editor like BBEdit, you'll need to restart Apache via the command line