title: Django and Apache configuration, page not loading
body: <p>Disclaimer: I know this issue has been addressed multiple times but I'm experiencing different errors than the other posted questions. </p>
  
  <p>I have a Django app which I am trying to get configured with Apache running on the web. I go to load some.example.com and absolutely nothing shows up in the browser. Whenever I restart the Apache server the following appears in the error log</p>
  
  <pre><code>RSA server certificate CommonName (CN) `example.com' does NOT match server name!?
  </code></pre>
  
  <p><strong>Edit</strong>: looking at the error logs in my other working Django apps I am seeing the same <code>RSA server...</code> error, so I don't think this is what is causing the error.</p>
  
  <p>I've done this before multiple times, I even documented my process so I wouldn't run into the same errors. My documented process has worked in the past and I currently have multiple Django apps running on my server. In the past I've received errors like "can't write to database" or "can't server static files", but I've never seen a blank screen before. I even have <code>DEBUG = True</code> in my Django settings file.</p>
  
  <p>I mostly follow <a href="https://www.digitalocean.com/community/tutorials/how-to-serve-django-applications-with-apache-and-mod_wsgi-on-ubuntu-14-04" rel="nofollow" title="tutorial">this</a> and <a href="http://16bpp.net/pages/how-to-deploy-a-django-app-with-apache" rel="nofollow">this</a> tutorial. Steps:</p>
  
  <ol>
  <li>Create Django app (running built-in server works, everything loads perfectly)</li>
  <li>Create virtual environment, install Django inside</li>
  <li>create /etc/apache2/sites-available/some.example.com</li>
  <li>Create symlink to /etc/apache2/sites-enabled/some.example.com</li>
  <li>Edit /etc/apache2/sites-available/some.example.com as below</li>
  <li><p>Run the following commands</p>
  
  <pre><code>chown -R username:www-data some.example.com
  chmod 775 some.example.com
  chmod 664 some.example.com/db.sqlite3
  </code></pre></li>
  </ol>
  
  <p>I am using Django 1.7 and Apache 2.2.22.</p>
  
  <p>wsgi.py</p>
  
  <pre><code>import site
  site.addsitedir('/srv/www/some.example.com/heartstudyenv/lib/python2.7/site-packages')
  import os
  os.environ.setdefault("DJANGO_SETTINGS_MODULE", "heartstudy.settings")
  
  from django.core.wsgi import get_wsgi_application
  application = get_wsgi_application()
  </code></pre>
  
  <p>/etc/apache2/sites-available/some.example.com</p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
      ServerAdmin webmaster@localhost
      ServerName some.example.com
      ServerAlias some.example.com
      DocumentRoot /srv/www/some.example.com
  
      Alias /static /srv/www/some.example.com/static
      &lt;Directory /srv/www/some.example.com/static&gt;
          Order allow,deny
          Allow from all
      &lt;/Directory&gt;
  
      &lt;Directory /srv/www/some.example.com/heartstudy&gt;
          &lt;Files wsgi.py&gt;
              Order deny,allow
          &lt;/Files&gt;
      &lt;/Directory&gt;
  
      WSGIDaemonProcess heartstudy python-path=/srv/www/some.example.com:/srv/www/some.example.com/heartstudyenv/lib/python2.7/site-packages
      WSGIProcessGroup heartstudy
      WSGIScriptAlias / /srv/www/wwwsomeexample.com/heartstudy/wsgi.py
   &lt;/VirtualHost&gt;
  
   NameVirtualHost *:443
   &lt;VirtualHost *:443&gt;
      SSLEngine on
      SSLCertificateFile    /etc/apache2/sslkey/_.example.com/_.example.com.crt
      SSLCertificateKeyFile /etc/apache2/sslkey/_.example.com/_.example.com.key
  
      ServerAdmin webmaster@localhost
      ServerName some.example.com
      ServerAlias some.example.com
      DocumentRoot /srv/www/some.example.com
  
      WSGIProcessGroup heartstudy
      WSGIScriptAlias / /srv/www/some.example.com/heartstudy/wsgi.py
  
      Alias /static /srv/www/some.example.com/static
      &lt;Directory /srv/www/some.example.com/static&gt;
          Order allow,deny
          Allow from all
      &lt;/Directory&gt;
  
      &lt;Directory /srv/www/some.example.com/heartstudy&gt;
          &lt;Files wsgi.py&gt;
              Allow from all
          &lt;/Files&gt;
      &lt;/Directory&gt;
      ErrorLog /srv/www/some.example.com/apache_error.log
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>settings.py </p>
  
  <pre><code>import os
  BASE_DIR = os.path.dirname(os.path.dirname(__file__))
  
  TEMPLATE_PATH = os.path.join(BASE_DIR, 'templates')
  STATIC_PATH = os.path.join(BASE_DIR, 'static')
  STATIC_ROOT = '/srv/www/some.example.com'
  MEDIA_PATH = os.path.join(BASE_DIR, 'media')
  
  SECRET_KEY = 'some_key'
  
  DEBUG = True
  TEMPLATE_DEBUG = True
  ALLOWED_HOSTS = ['some.example.com']
  
  INSTALLED_APPS = (
      'django.contrib.admin',
      'django.contrib.auth',
      'django.contrib.contenttypes',
      'django.contrib.sessions',
      'django.contrib.messages',
      'django.contrib.staticfiles',
      'django.contrib.sites',
      'tweets',
  )
  
  MIDDLEWARE_CLASSES = (
      'django.contrib.sessions.middleware.SessionMiddleware',
      'django.middleware.common.CommonMiddleware',
      'django.middleware.csrf.CsrfViewMiddleware',
      'django.contrib.auth.middleware.AuthenticationMiddleware',
      'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
      'django.contrib.messages.middleware.MessageMiddleware',
      'django.middleware.clickjacking.XFrameOptionsMiddleware',
  )
  
  ROOT_URLCONF = 'heartstudy.urls'
  WSGI_APPLICATION = 'heartstudy.wsgi.application'
  
  LOGIN_URL = '/tweets/login/'
  SITE_ID = 3
  
  DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.sqlite3',
          'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
      }
  }
  
  LANGUAGE_CODE = 'en-us'
  TIME_ZONE = 'America/New_York'
  USE_I18N = True
  USE_L10N = True
  USE_TZ = True
  
  STATIC_URL = '/static/'
  STATICFILES_DIRS = (
      STATIC_PATH,
  )
  
  MEDIA_URL = '/media/'
  MEDIAFILES_DIRS = (
      MEDIA_PATH,
  )
  
  TEMPLATE_DIRS = (
      TEMPLATE_PATH,
  )
  </code></pre>