title: 404 error with python on apache2
body: <p>I have a file <code>test.py</code> at <code>/var/www</code> and I am using <code>apache2</code> on ubuntu 10.10. I have <code>mod_python</code> installed and <code>/etc/apache2/sites-available/default</code> configured as </p>
  
  <pre><code>&lt;Directory /var/www/&gt;
      Options Indexes FollowSymLinks MultiViews
      AllowOverride AuthConfig
      Order allow,deny
      allow from all
  
      AddHandler mod_python .py
      PythonHandler mod_python.publisher
      PythonDebug On
  
      # Uncomment this directive is you want to see apache2's
      # default start page (in /apache2-default) when you go to /
      #RedirectMatch ^/$ /apache2-default/
  &lt;/Directory&gt;
  </code></pre>
  
  <p>If it put </p>
  
  <pre><code>def index(req):
    return "Test successful";
  </code></pre>
  
  <p>Then i get <code>Test successful</code></p>
  
  <p>And if i put</p>
  
  <pre><code>#!/usr/bin/env python
  print "Content-Type: text/html"
  print
  print """\
  &lt;html&gt;
  &lt;body&gt;
  &lt;h2&gt;Hello World!&lt;/h2&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  """
  </code></pre>
  
  <p>I get <code>404: Not found</code> error</p>
  
  <p>More can be found <a href="https://askubuntu.com/questions/34338/error-while-configuring-python-in-apache2">here</a></p>
  
  <p>Anyone any ideas ??</p>
  
  <p>Regards,</p>
  
  <p>experimentX</p>