title: Setting up a local host and getting a connection refused error
body: <p>After following the instructions to set up a personal server with the native Apache software on a OS X 10.6.8 (SnowLeopard), and After modifying the apache2.config file as per the directions, typing the following in a browser:  </p>
  
  <pre><code>     http:// localhost 
  </code></pre>
  
  <p>(either Chrome or Safari) returns a connection refused error. </p>
  
  <p>What is to be done?  Taking the firewall up or down doesn't change the localhost connection error.  </p>
  
  <p>telnet returns this: </p>
  
  <pre><code>    Trying 127.0.0.1...
      telnet: connect to address 127.0.0.1: Connection refused
      Trying ::1...
      telnet: connect to address ::1: Connection refused
      Trying fe80::1...
      telnet: connect to address fe80::1: Connection refused
      telnet: Unable to connect to remote host  
  </code></pre>
  
  <p>netstat among a host of other data returned:  </p>
  
  <pre><code>    udp4       0      0  localhost.64790        *.*   
  </code></pre>
  
  <p>typing netstat -i in the terminal returns:  </p>
  
  <pre><code>    Name  Mtu   Network       Address            Ipkts Ierrs    Opkts Oerrs  Coll
      lo0   16384 &lt;Link#1&gt;                           954     0      954     0     0  
      lo0   16384 localhost   ::1                    954     -      954     -     -  
      lo0   16384 localhost   fe80:1::1              954     -      954     -     -  
      lo0   16384 127           localhost            954     -      954     -     -  
  </code></pre>
  
  <p>The curious thing is that the browsers read local HTML and other local files normally.  For example entering:  </p>
  
  <pre><code>file:///Library/Webserver/Documents/index.html.en  
  </code></pre>
  
  <p>returns <strong>"It works!"</strong> </p>
  
  <p>But this doesn't resolve the problem of the browsers not responding to the local host.  </p>
  
  <p>Any help would be appreciated.</p>
  
  <p>UPDATE</p>
  
  <p>So I got the localhost to work but the links were broken when I moved the files to the correct directory.<br>
  Once I got the links fixed, typing <code>localhost</code> in Safari caused the compass to fly out of the browser!  </p>
  
  <p>Network Utility returns</p>
  
  <pre><code>Port Scanning host:  127.0.0.1
      Open TCP Port 80:    http
  </code></pre>
  
  <p>The error_log has this warning:</p>
  
  <pre><code>Init: Session Cache is not configured [hint: SSlSessionCache]
  </code></pre>
  
  <p>The ssl_module is included in the LoadModule section.</p>
  
  <p>typing <code>/usr/sbin/httpd</code> in the Terminal gives me the following error:</p>
  
  <pre><code>(13)Permission denied: make_sock: could not bind to address 127.0.0.1:80  
  no listening sockets available, shutting down
  Unable to open logs
  </code></pre>
  
  <p>and after modifying the configuration file to listen to 8080 the computer returns another error:</p>
  
  <pre><code>(13)Permission denied: httpd: could not open error log file /private/var/log/apache2/error_log.  
  Unable to open logs  
  </code></pre>
  
  <p>A manuel by Julie Meloni states:</p>
  
  <pre><code>This problem can arise if the user who built and installed  
  Apache is different from the user trying to run it.
  </code></pre>
  
  <p>However that is not the case in this instance.  The manual offers no explanation as how to solve this problem. </p>
  
  <p>After checking the permissions with <code>ls -l /etc/apache2/httpd.conf</code> The terminal returns:</p>
  
  <pre><code>-rw-r--r-- 1 root wheel 18973 Dec 7 22:49 /etc/apache2/httpd.conf
  </code></pre>
  
  <p>As far as I can tell this suggests the file doesn't have permission to execute.  After running a <code>chmod 755</code> the computer reported that this operation was not permitted. </p>
  
  <p>I have the Internet sharing preferences turned on so that isn't the issue.</p>
  
  <p>using <code>curl http://127.0.0.1</code> in the Terminal returns the HTML code for shorter files, but with longer files it only returns the HTML file selectively and a strange error where it repeats the MacBook owner's first name multiple times across the screen.</p>
  
  <p>Typing <code>tail /var/log/apache2/error_log</code> in the terminal returns:</p>
  
  <pre><code>[warn] Init: Session Cache is not configured [hint: SSLSessionCache]
  Warning: DocumentRoot [/usr/docs/dummy-host.example.com] does not exist  
  Warning: DocumentRoot [/usr/docs/dummy-host2.example.com] does not exist  
  Warning: DocumentRoot [/usr/docs/dummy-host.example.com] does not exist  
  Warning: DocumentRoot [/usr/docs/dummy-host2.example.com] does not exist 
  [warn] NameVirtualHost *:80 has no VirtualHosts
  [notice] Digest: generating secret for digest authentication ...
  [notice] Digest: done
  [notice] Apache/2.2.29 (Unix) PHP/5.4.45 DAV/2 mod_ssl/2.2.29 OpenSSL/0.9.8zg mod_perl/2.0.7 Perl/v5.16.2 configured -- resuming normal operations.
  </code></pre>
  
  <p>Could someone please point me in the right direction?</p>