title: Django Based framework virtual host setup https on Apache
body: <p>I am using a django based framework and have successfully figured Apache settings for http mode. Basically I have done the setting correctly on <code>&lt;VirtualHost *:80&gt; ... &lt;/VirtualHost&gt;</code> and when I do, <a href="http://mysite.domain.com" rel="nofollow">http://mysite.domain.com</a> I get routed correctly to my site and the site pages and the skins get render correctly.</p>
  
  <p>I have setup <a href="https://mysite.domain.com" rel="nofollow">https://mysite.domain.com</a> to work with shibboleth, shibboleth is working and when  use the https I get routed to login credential page via shibboleth server, and after successful login I get redirect to <a href="https://mysite.domain.com" rel="nofollow">https://mysite.domain.com</a> but site doesn't get rendered correctly and skins don't show up as same as <a href="http://mysite.domain.com" rel="nofollow">http://mysite.domain.com</a>.</p>
  
  <p>Here is my Apache settings, I am trying to understand what I am doing wrong here</p>
  
  <pre><code>&lt;VirtualHost *:443&gt;
       ServerAdmin myname@mydomain.com
       DocumentRoot /code/vEnviornment/mysite
       ServerName mydomain.com
       #&lt;LocationMatch "^(?!/admin)"&gt;
       #&lt;LocationMatch "^(?!/m)"&gt;
       #    RewriteEngine on
       #    RewriteRule django.wsgi(.*)$ https://mydomain.com:443$1 [L,R=301]
       #&lt;/LocationMatch&gt;
       SSLEngine on
       #your SSL keys
       #I have removed this wasn't comfortable putting SSL key info
       #Alias /admin/media/ /usr/local/lib/python2.6/site-packages/django/contrib/admin/media/
       Alias /admin/media/ /usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/
       WSGIScriptAlias /m/ /code/vEnviornment/mysite/django.wsgi
       &lt;Directory "/"&gt;
       AuthType shibboleth
       ShibRequestSetting requireSession 1
       Require valid-user
       &lt;/Directory&gt;
       Alias /Shibboleth.sso /tmp
       #    CustomLog /var/log/httpd/mysite/access_log common
       #    ErrorLog /var/log/httpd/mysite/error_log
      CustomLog /var/log/apache2/mysite/access_log common
      ErrorLog /var/log/apache2/mysite/error_log
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>And here is how I have hetup http:</p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
       ServerAdmin myname@mydomain.com
       DocumentRoot /code/vEnviornment/mysite
       ServerName mysite.mydomain.com
  
       #aliases to serve static media directly
       #will probably need adjustment
       Alias /m/ /code/vEnviornment/mysite/static/
       Alias /upfiles/ /code/vEnviornment/mysite/myframework/upfiles/
       &lt;DirectoryMatch "/code/vEnviornment/mysite/myframework/skins/([^/]+)/media"&gt;
          Order deny,allow
          Allow from all
       &lt;/DirectoryMatch&gt;
       &lt;Directory "/code/vEnviornment/mysite/myframework/upfiles"&gt;
          Order deny,allow
          Allow from all
       &lt;/Directory&gt;
       #must be a distinct name within your apache configuration
       WSGIDaemonProcess mysite2
       WSGIProcessGroup mysite2
       WSGIScriptAlias / /code/vEnviornment/mysite/django.wsgi
       #make all admin stuff except media go through secure connection
       &lt;LocationMatch "/admin(?!/media)"&gt;
       RewriteEngine on
           RewriteRule /admin(.*)$ https://128.101.35.71/admin$1 [L,R=301]
       &lt;/LocationMatch&gt;
      # CustomLog /var/log/httpd/mysite/access_log common
      # ErrorLog /var/log/httpd/mysite/error_log
      CustomLog /var/log/apache2/mysite/access_log common
      ErrorLog /var/log/apache2/mysite/error_log
      LogLevel debug
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>What am I doing wrong here to render the site incorrectly via <strong>https?</strong></p>