title: localhost refused to connect - MAMP Pro
body: <p>There seem to be a few questions that are similar but could not find the answer.</p>
  
  <p>An hour ago (and the months before that :-)) everything was working fine. It looks like after updating to XCode 9.2 things stopped working.</p>
  
  <p>I've justed updated to MacOS High Sierra 10.13.2 as there were some Apache updates included, but it didn't solve the issue. Maybe the XCode update changed something to the httpd.conf file? I'm not too familiar with the settings in there, so I'm unable to determine if something changed in that file.</p>
  
  <p><strong>Error in Chrome:</strong></p>
  
  <p>This site can’t be reached</p>
  
  <p>www.example.dev refused to connect.</p>
  
  <p>ERR_CONNECTION_REFUSED</p>
  
  <p><strong>My setup:</strong></p>
  
  <p>MacOS High Sierra 10.13.2</p>
  
  <p>MAMP Pro 4.2 (latest version)</p>
  
  <p>Ports are Apache: 80 and MySQL: 3306</p>
  
  <p>VPN is off</p>
  
  <p>If I run <code>sudo nano /private/etc/hosts</code> it has the following entries (I run my local website on www.example.dev)</p>
  
  <pre><code>127.0.0.1       localhost
  255.255.255.255 broadcasthost
  ::1             localhost
  127.0.0.1       www.example.dev # Note; I added this myself a long time ago as else the URL including www doesn't work
  127.0.0.1       example.dev       # MAMP PRO - Do NOT remove this entry!
  ::1             example.dev       # MAMP PRO - Do NOT remove this entry!
  </code></pre>
  
  <p><strong>What I tried:</strong></p>
  
  <ul>
  <li>Changing ports to default MAMP ports (Apache: 8888 and MySQL: 8889). No luck</li>
  <li>If I run <code>apachectl configtest</code> in terminal it returns <code>Syntax OK</code></li>
  </ul>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Just saw that if MAMP Pro is off:</p>
  
  <ul>
  <li>It still gives the same error in Chrome</li>
  <li>It still returns <code>Syntax OK</code> with <code>apachectl configtest</code></li>
  </ul>
  
  <p>When I run <code>sudo apachectl stop</code> it returns <code>/System/Library/LaunchDaemons/org.apache.httpd.plist: Could not find specified service</code></p>
  
  <p><strong>UPDATE 2</strong></p>
  
  <p>Out of frustration I downloaded Firefox to check and... all my local dev sites work there! In Chrome I still get the same error, even after clearing browsing data.</p>