title: Apache on Amazon EC2 Not Connecting To My Django Site
body: <p>I have an Amazon EC2 instance running Ubuntu and I'm trying to get it to display my Django site. The dev server works (i.e. if I run the dev server on the instance and go to <a href="http://ec2-XX-XXX-XX-XX.us-west-2.compute.amazonaws.com/:8000" rel="nofollow">http://ec2-XX-XXX-XX-XX.us-west-2.compute.amazonaws.com/:8000</a>, my site works fine) but I can't get it to run properly via apache.</p>
  
  <p>I've read about a thousand tutorials and so far none have been successful. Here is my most recent attempt - my Django site is stored in /home/ubuntu/Amazon/repo/my_site/.</p>
  
  <p>I've tried creating a virtual host file in /etc/apache2/sites-available/ec2.conf with the following:</p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
  ServerName ec2-XX-XXX-XX-XX.us-west-2.compute.amazonaws.com
  ServerAlias *.compute.amazonaws.com
  WSGIScriptAlias / /home/ubuntu/Amazon/repo/my_site/my_site/apache/apache.wsgi
       &lt;Directory /&gt;
              Require all granted
       &lt;/Directory&gt;       
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>After that, I ran <code>sudo a2ensite ec2</code> to add the conf file to sites-enabled but going to ec2-XX-XXX-XX-XX.us-west-2.compute.amazonaws.com in my browser still returns to the default page.</p>
  
  <p>Any guidance would be great, I'm sure I'm missing several steps, but I'm completely lost at the moment. There are a lot of things I don't understand at the moment such as:</p>
  
  <ul>
  <li>Do I need a /var/www/html/ directory somewhere? Or does Django handle that?</li>
  <li>Do I need to use virtual hosts at all? Or is that only for subdomains?</li>
  <li>Do I need to register a domain name prior to getting it working? All the examples I see use something like "example.com" where I have "ec2-XX-XXX-XX-XX.us-west-2.compute.amazonaws.com". I have the domain name registered but I haven't pointed it at my amazon instance yet - I was hoping to first get it working.</li>
  </ul>
  
  <p>Edit: Apache error.log output:</p>
  
  <pre><code>[Tue Jul 08 16:07:47.983174 2014] [mpm_event:notice] [pid 5054:tid 140062636054400] AH00491: caught SIGTERM, shutting down
  [Tue Jul 08 16:07:49.046666 2014] [mpm_event:notice] [pid 5211:tid 139882510350208] AH00489: Apache/2.4.7 (Ubuntu) mod_wsgi/3.4 Python/2.7.6 configured -- resuming normal operations
  [Tue Jul 08 16:07:49.046735 2014] [core:notice] [pid 5211:tid 139882510350208] AH00094: Command line: '/usr/sbin/apache2'
  </code></pre>