title: Installing Yaws server on Ubuntu 12.04 (Using a cloud service)
body: <p>I'm trying to get a Yaws web server working on a cloud service (Amazon AWS). I've compilled and installed a local copy on the server. My problem is that I can't get Yaws to run while running on either port 8000 or port 80.</p>
  
  <p>I have the following configuration in yaws.conf:</p>
  
  <blockquote>
  <pre><code>   port = 8000
     listen = 0.0.0.0
     docroot = /home/ubuntu/yaws/www/test
     dir_listings = true
  </code></pre>
  </blockquote>
  
  <p>This produces the following successful launch/result:</p>
  
  <blockquote>
    <p>Eshell V5.8.5  (abort with ^G)</p>
    
    <p>=INFO REPORT==== 16-Sep-2012::17:21:06 ===
       Yaws: Using config file /home/ubuntu/yaws.conf</p>
    
    <p>=INFO REPORT==== 16-Sep-2012::17:21:06 ===
       Ctlfile : /home/ubuntu/.yaws/yaws/default/CTL</p>
    
    <p>=INFO REPORT==== 16-Sep-2012::17:21:06 ===
       Yaws: Listening to 0.0.0.0:8000 for &lt;3> virtual servers:
       - http://domU-12-31-39-0B-1A-F6:8000 under /home/ubuntu/yaws/www/trial
       - 
    
    <p>=INFO REPORT==== 16-Sep-2012::17:21:06 ===
       Yaws: Listening to 0.0.0.0:4443 for &lt;1> virtual servers:
       - 
  </blockquote>
  
  <p>When I try to access the the url (http://ec2-72-44-47-235.compute-1.amazonaws.com), it never connects. I've tried using paping to check if port 80 or 8000 is open(http://code.google.com/p/paping/) and I get a "Host can not be resolved" error, so obviously something isn't working.</p>
  
  <p>I've also tried setting the yaws.conf so its at Port 80, appearing like this:</p>
  
  <blockquote>
  <pre><code>   port = 8000
     listen = 0.0.0.0
     docroot = /home/ubuntu/yaws/www/test
     dir_listings = true
  </code></pre>
  </blockquote>
  
  <p>and I get the following error:</p>
  
  <blockquote>
    <p>=ERROR REPORT==== 16-Sep-2012::17:24:47 ===
       Yaws: Failed to listen 0.0.0.0:80  : {error,eacces}</p>
    
    <p>=ERROR REPORT==== 16-Sep-2012::17:24:47 ===
       Can't listen to socket: {error,eacces} 
       =ERROR REPORT==== 16-Sep-2012::17:24:47 ===
       Top proc died, terminate gserv
       =ERROR REPORT==== 16-Sep-2012::17:24:47 ===
       Top proc died, terminate gserv
       =INFO REPORT==== 16-Sep-2012::17:24:47 ===
       application: yaws
       exited: {shutdown,{yaws_app,start,[normal,[]]}}
       type: permanent
       {"Kernel pid terminated",application_controller,"
       {application_start_failure,yaws,>>>>>>{shutdown,>{yaws_app,start,[normal,[]]}}}"}</p>
  </blockquote>
  
  <p>I've also opened up the port 80 using iptables. Running sudo iptables -L gives this output:</p>
  
  <blockquote>
    <p>Chain INPUT (policy ACCEPT)
       target     prot opt source               destination<br>
       ACCEPT     tcp  --  ip-192-168-2-0.ec2.internal  ip-192-168-2-16.ec2.internal  tcp dpt:http
       ACCEPT     tcp  --  0.0.0.0              anywhere             tcp dpt:http
       ACCEPT     all  --  anywhere             anywhere             ctstate RELATED,ESTABLISHED
       ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:http
       ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:http</p>
    
    <p>Chain FORWARD (policy ACCEPT)
       target     prot opt source               destination         </p>
    
    <p>Chain OUTPUT (policy ACCEPT)
    target     prot opt source               destination  </p>
  </blockquote>
  
  <p>Thanks for the patience</p>