Note that there are some explanatory texts on larger screens.

plurals
  1. POfailing miserably to run a wsgi application with mod_wsgi
    primarykey
    data
    text
    <p>In order to debugg a bottle.py application I'm trying to deploy to openshift (with a problem I suspect is connected to mod_wsgi - this <a href="https://stackoverflow.com/questions/9814632/running-a-bottle-app-from-mod-wsgi-handle-results-in-maximum-recursion-depth-exc">open question</a>) I'm trying to run mod_wsgi on my linux station. as the title states - I'm failing miserably.</p> <p>I downloaded and installed mod_wsgi compiled to python2.6 according to the instructions in the mod_wsgi wiki.</p> <p>running apache2ctl -M I verified that mod_wsgi(shared) is in the resulting list so I guess I've got that part right</p> <p>I wrote an <strong>appname</strong> file in the /etc/apache2/sites-availble containing:</p> <pre><code>&lt;VirtualHost *:8051&gt; #also tried with * or *:80 or myappname # ServerName 127.0.0.1:8051 #also tried to uncomment ServerAlias wikimen #also tried without # WSGIDaemonProcess wikimen user=myusername group=myusername threads=5 #also tried to uncomment WSGIScriptAlias / /home/myusername/workspace/myapp/wsgi/application DocumentRoot /home/myusername/workspace/myapp/wsgi &lt;Directory /home/myusername/workspace/myapp/wsgi&gt; # WSGIProcessGroup myapp # WSGIApplicationGroup %{GLOBAL} Order deny,allow Allow from all &lt;/Directory&gt; &lt;/VirtualHost&gt; </code></pre> <p>and after running:</p> <pre><code>sudo a2ensite </code></pre> <p>checked that it was created accordingly in sites-enabled dir and run:</p> <pre><code>sudo service apacha2 reload </code></pre> <p>when I go to the browser and try: localhost:8051 or localhost/appname/routename or localhost:8051/routename or localhost:8051/appname or any other combination between them I just get (also when changing localhost to 127.0.0.1) :</p> <pre><code>unable to connect </code></pre> <p>the wsgi handle file (named "application") contains:</p> <pre><code>#!/usr/bin/python import os here = os.path.dirname(os.path.abspath(__file__)) try: os.environ['PYTHON_EGG_CACHE'] = os.path.join(os.environ['OPENSHIFT_APP_DIR'],'virtenv/lib/python2.6/site-packages') except: os.environ['PYTHON_EGG_CACHE'] = os.path.join(here,'..','data/virtenv/lib/python2.6/site-packages') print ('python egg cache set to: %s' % os.environ['PYTHON_EGG_CACHE']) try: virtualenv = os.path.join(os.environ['OPENSHIFT_APP_DIR'],"virtenv/bin/activate_this.py") except: virtualenv = os.path.join(here,'..',"data/virtenv/bin/activate_this.py") print ('virtualenv is in:%s' % virtualenv) try: execfile(virtualenv, dict(__file__=virtualenv)) print ('executed') except IOError: pass from myappname import application </code></pre> <p>but as I said It does work (also invokes some strange bottle.py mistake) in the openshift server so I guess this isn't the problem also I'll be glad to be refuted</p> <p>maybe I should mention that the wsgi "application" file as the rest of the app are in a virtualenv directory</p> <p>I'm not really good with apache (our production server is cherokee using reverse proxy and native python servers and not mod_wsgi) so maybe I'm missing something basic</p> <p>the basic bottle.py runs if I run it directly withput the wsgi handle I'll be glad for any help</p> <p>using: ubunto 11, apache2.2, the current mod_wsgi version, python 2.6 (I also have python 2.7 but the app runs in a virtualenv of python2.6 in according to the openshift server)</p> <p>tailing the apache2 error log doesn't show anything usefull (also killing it and starting again):</p> <pre><code>&gt; [Sat Mar 24 15:45:10 2012] [notice] Apache/2.2.20 (Ubuntu) &gt; PHP/5.3.6-13ubuntu3.6 with Suhosin-Patch mod_wsgi/3.3 Python/2.6.7 &gt; configured -- resuming normal operations [Sat Mar 24 21:19:24 2012] &gt; [notice] caught SIGTERM, shutting down [Sat Mar 24 21:19:54 2012] &gt; [notice] Apache/2.2.20 (Ubuntu) PHP/5.3.6-13ubuntu3.6 with &gt; Suhosin-Patch mod_wsgi/3.3 Python/2.6.7 configured -- resuming normal &gt; operations [Sat Mar 24 21:36:30 2012] [notice] Apache/2.2.20 (Ubuntu) &gt; PHP/5.3.6-13ubuntu3.6 with Suhosin-Patch mod_wsgi/3.3 Python/2.6.7 &gt; configured -- resuming normal operations [Sat Mar 24 21:40:48 2012] &gt; [notice] caught SIGTERM, shutting down [Sat Mar 24 21:41:18 2012] &gt; [notice] Apache/2.2.20 (Ubuntu) PHP/5.3.6-13ubuntu3.6 with &gt; Suhosin-Patch mod_wsgi/3.3 Python/2.6.7 configured -- resuming normal &gt; operations [Sat Mar 24 23:47:11 2012] [notice] Apache/2.2.20 (Ubuntu) &gt; PHP/5.3.6-13ubuntu3.6 with Suhosin-Patch mod_wsgi/3.3 Python/2.6.7 &gt; configured -- resuming normal operations [Sun Mar 25 22:20:22 2012] &gt; [notice] Apache/2.2.20 (Ubuntu) PHP/5.3.6-13ubuntu3.6 with &gt; Suhosin-Patch mod_wsgi/3.3 Python/2.6.7 configured -- resuming normal &gt; operations [Sun Mar 25 22:34:12 2012] [notice] caught SIGTERM, &gt; shutting down [Sun Mar 25 22:34:24 2012] [notice] Apache/2.2.20 &gt; (Ubuntu) PHP/5.3.6-13ubuntu3.6 with Suhosin-Patch mod_wsgi/3.3 &gt; Python/2.6.7 configured -- resuming normal operations </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload