Results 1 to 4 of 4

Thread: Installing mod_python

  1. #1
    Join Date
    Dec 2008
    Beans
    49

    Installing mod_python

    Hey guys,

    I'm trying to install mod_python on my Ubuntu 9.10 32 bit apache2 server. I have the module installed (via apt-get) and I know the module is loaded because the following appears in my log when I restart apache:


    Code:
    [Fri Jul 23 15:00:51 2010] [notice] Graceful restart requested, doing restart
    PHP Deprecated: *Comments starting with '#' are deprecated in /etc/php5/apache2/conf.d/mcrypt.ini on line 1 in Unknown on line 0
    PHP Deprecated: *Comments starting with '#' are deprecated in /etc/php5/apache2/conf.d/ming.ini on line 1 in Unknown on line 0
    [Fri Jul 23 15:00:51 2010] [notice] mod_python: Creating 8 session mutexes based on 40 max processes and 0 max threads.
    [Fri Jul 23 15:00:51 2010] [notice] mod_python: using mutex_directory /tmp
    [Fri Jul 23 15:00:51 2010] [notice] Apache/2.2.14 (Ubuntu) PHP/5.3.2-1ubuntu4 with Suhosin-Patch mod_python/3.3.1 Python/2.6.5 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations

    Anyways, it's not working. I've added this into the config file for the site I want python on (/etc/apache2/sites-available/default)

    Code:
    <Directory /home/www/webroot/>
     Options Indexes FollowSymLinks MultiViews +ExecCGI
     AllowOverride ALL
     Order allow,deny
     allow from all
     AddHandler mod_python .py
     PythonDebug On
    </Directory>
    But no dice. It just download the python file. Also, http://vps.xmop.org/mpinfo

    Edit: I've also tried
    Code:
    <Files ~ "\.(py|pyc)$">
     SetHandler mod_python
     PythonDebug On
     </Files>
    Last edited by Moptop650; July 23rd, 2010 at 04:39 PM.

  2. #2
    Join Date
    Oct 2008
    Beans
    44

    Re: Installing mod_python

    I don't really understand apache configuration but this is how I did it on a site that I manage too long ago to remember the why's or the how's.

    Code:
        
    <Location ~ "xxxxxx">
    SetHandler python-program
    PythonPath "['/home/javier/django'] + sys.path"
    SetEnv DJANGO_SETTINGS_MODULE gacelaweb.settings
    PythonHandler django.core.handlers.modpython
    PythonDebug On
    </Location>
    The PythonPath, SetEnv and PythonHandler are Django specific or site specific. It's running on Hardy (8.04 LTS), so maybe something have changed.

    Hope that it's useful.

  3. #3
    Join Date
    Oct 2008
    Beans
    44

    Re: Installing mod_python

    BTW, mod_python is obsolete and deprecated. You should be using mod_wsgi for a new installation wherever it's possible.

  4. #4
    Join Date
    Dec 2008
    Beans
    49

    Re: Installing mod_python

    Would wsgi let me use python on apache the same way mod_perl does for perl? IE anything printed out goes to the client.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •