title: Running mod-wsgi code (.wsgi) with Apache2
body: <p>I'm using mod_wsgi on apache2/Mac OS X by setting apache server as follows.</p>
  
  <pre><code>&lt;Directory /Library/WebServer/Documents/wsgi/scripts&gt;
    Order allow,deny
    Allow from all
  &lt;/Directory&gt;
  
  &lt;IfModule wsgi_module&gt;
    WSGIScriptAlias /test /Library/WebServer/Documents/wsgi/scripts/test.wsgi
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>With this configuration, I could call test.wsgi with <code>http://.../test</code></p>
  
  <p>Now, I need to execute it by calling as follows.</p>
  
  <p><code>http://.../wsgi/test.wsgi</code></p>
  
  <p>I have the following code.</p>
  
  <pre><code>&lt;Directory /Library/WebServer/Documents/wsgi/scripts&gt;
    Order allow,deny
    Allow from all
    AddHandler wsgi-script .wsgi
  &lt;/Directory&gt;
  
  &lt;IfModule wsgi_module&gt;
    WSGIScriptAlias /test /Library/WebServer/Documents/wsgi/scripts/test.wsgi
    Alias /wsgi/ /Library/WebServer/Documents/wsgi/scripts/
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>I thought about using <code>Alias</code> so that I could link wsgi script directory to /wsgi/, and I expect Addhandler can handle the wsgi file, but it doesn't work.</p>
  
  <p>What's wrong with my apache2 setup?</p>
  
  <h2>SOLVED</h2>
  
  <pre><code>&lt;Directory /Library/WebServer/Documents/wsgi/scripts&gt;
    Options ExecCGI Indexes
    AddHandler cgi-script .cgi
    AddHandler wsgi-script .wsgi
  
    Order allow,deny
    Allow from all
  &lt;/Directory&gt;
  
  Alias /wsgi/ /Library/WebServer/Documents/wsgi/scripts/
  </code></pre>