so i got the hello world to work

first issue is that i had multiple instances of the loadmodule in the
httpd.conf

second issue the my documentRoot was looking into the httpdocs folder

so when you go to my site it automatically goes to the httpdocs folder

my final apache configuration looked like this

LoadModule wsgi_module modules/mod_wsgi.so

WSGIScriptAlias /python_projects/ /var/www/vhosts/zevenwolf.com/
httpdocs/python_projects/

<Directory /var/www/vhosts/zevenwolf.com/httpdocs/python_projects>
Order deny,allow
Allow from all
</Directory>

thanks graham

zeven

On Aug 23, 9:51 pm, Graham Dumpleton <[email protected]>
wrote:
> On 24 August 2010 11:28, zevenwolf <[email protected]> wrote:
>
> > thanks for your help graham
>
> > do you think updating will fix anything
>
> Updating will not fix this issue as it is a configuration/user problem.
>
> Whether later versions address bugs that may affect you, have no idea
> as don't even know what version of mod_wsgi you are using.
>
> > do you or anyone have any extra advice
>
> If you still haven't got it to work, can only suggest you read my
> email message properly as I have already pointed out what the problem
> was.
>
> Wrong URL used in browser based on what you had WSGIScriptAlias set
> to. Plus, discrepancy over what you called the WSGI script file and
> where you put it. You keep saying hello.py but the WSGIScriptAlias is
> referring to a file with different path.
>
> So, get things to match properly.
>
> > i am flying blind
>
> There is a lot of documentation there, much more than other WSGI
> hosting mechanisms provide, so would disagree with that. :-)
>
> BTW, where are you hoping to end up with this? If you are wanting to
> learn how to do web programming with Python, I wouldn't be starting
> with Apache/mod_wsgi. Instead grab down one of the Python frameworks
> and use the inbuilt development server they provide.
>
> For a lightweight solution as far as learning curve and simplicity see
> Flask (flask.pocoo.org). For a more heavyweight solution, see Django
> (www.djangoproject.com) or even Web2Py (www.web2py.com). I wouldn't
> normally recommend the latter as have some concerns about it, but
> newbies seem to find it easy enough to learn.
>
> Graham
>
>
>
> > thanks again
>
> > zeven
>
> > On Aug 23, 9:05 pm, Graham Dumpleton <[email protected]>
> > wrote:
> >> On 24 August 2010 10:34, zevenwolf <[email protected]> wrote:
>
> >> > I am following this configuration guide
> >> >  http://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide
>
> >> > I ran httpd -M and indeed it says wsgi_module(shared)
>
> >> > I changed the my apache host settings to look like this:
>
> >> > <VirtualHost *:80>
> >> >    DocumentRoot /var/www/vhosts/zevenwolf.com/httpdocs
> >> >    ServerNamewww.zevenwolf.com
> >> >    ServerAlias zevenwolf.com zevenrodriguez.comwww.zevenrodriguez.com
> >> > zevenwithaz.comwww.zevenwithaz.com
> >> >    ErrorLog logs/zevenwolf.com-error_log
> >> >    CustomLog logs/zevenwolf.com-access_log common
> >> > <Directory /var/www/vhosts/zevenwolf.com/httpdocs>
> >> > AllowOverride All
> >> > </Directory>
> >> > ScriptAlias  /cgi-bin/ /var/www/vhosts/zevenwolf.com/cgi-bin/
>
> >> > LoadModule wsgi_module modules/mod_wsgi.so
>
> >> > WSGIScriptAlias /python_projects /var/www/vhosts/zevenwolf.com/
> >> > python_projects.wsgi
>
> >> > <Directory /var/www/vhosts/zevenwolf.com/python_projects>
> >> > Order deny,allow
> >> > Allow  from all
> >> > </Directory>
>
> >> > </VirtualHost>
>
> >> > Once i did the change i ran
>
> >> > service httpd restart
> >> > this is what i got
> >> > Stopping httpd:                                            [  OK  ]
> >> > Starting httpd: [Mon Aug 23 20:15:26 2010] [warn] module wsgi_module
> >> > is already loaded, skipping
>
> >> You have a LoadModule like for mod_wsgi twice, or a snippet file is
> >> being include twice that loads it.
>
> >> >                                                           [  OK  ]
>
> >> > this is the general apache error log from this time
>
> >> > [Mon Aug 23 20:15:26 2010] [error] Exception KeyError:
> >> > KeyError(-1216358640,) in <module 'threading' from '/opt/python2.6.5/
> >> > lib/python2.6/threading.pyc'> ignored
> >> > [Mon Aug 23 20:15:26 2010] [error] Exception KeyError:
> >> > KeyError(-1216358640,) in <module 'threading' from '/opt/python2.6.5/
> >> > lib/python2.6/threading.pyc'> ignored
> >> > [Mon Aug 23 20:15:26 2010] [error] Exception KeyError:
> >> > KeyError(-1216358640,) in <module 'threading' from '/opt/python2.6.5/
> >> > lib/python2.6/threading.pyc'> ignored
> >> > [Mon Aug 23 20:15:26 2010] [error] Exception KeyError:
> >> > KeyError(-1216358640,) in <module 'threading' from '/opt/python2.6.5/
> >> > lib/python2.6/threading.pyc'> ignored
>
> >> You aren't using mod_wsgi 3.3. Warning can otherwise be ignored.
>
> >> > [Mon Aug 23 20:15:26 2010] [notice] caught SIGTERM, shutting down
> >> > [Mon Aug 23 20:15:26 2010] [warn] module wsgi_module is already
> >> > loaded, skipping
> >> > [Mon Aug 23 20:15:26 2010] [notice] Digest: generating secret for
> >> > digest authentication ...
> >> > [Mon Aug 23 20:15:26 2010] [notice] Digest: done
> >> > [Mon Aug 23 20:15:26 2010] [notice] Apache configured -- resuming
> >> > normal operations
>
> >> > the error log from zevenwolf.com from apache gave me this
>
> >> > [Mon Aug 23 20:19:47 2010] [error] [client 173.63.156.204] File does
> >> > not exist: /var/www/vhosts/zevenwolf.com/httpdocs/python_project
> >> > [Mon Aug 23 20:19:54 2010] [error] [client 173.63.156.204] File does
> >> > not exist: /var/www/vhosts/zevenwolf.com/httpdocs/python_project
>
> >> > there is no file in this   /var/www/vhosts/zevenwolf.com/httpdocs/
> >> > python_project
>
> >> > the server path where hello.py is located:
> >> > /var/www/vhosts/zevenwolf.com/python_projects
>
> >> > The code i am trying to run is located here
> >> >http://www.zevenwolf.com/python_project/hello.py
>
> >> You are using the wrong URL, or have got the configuration wrong. You have:
>
> >>   WSGIScriptAlias /python_projects
> >> /var/www/vhosts/zevenwolf.com/python_projects.wsgi
>
> >> This means the URL you would use in the browser is:
>
> >>  http://www.zevenwolf.com/python_projects
>
> >> The hello world code should be in file:
>
> >>   /var/www/vhosts/zevenwolf.com/python_projects.wsgi
>
> >> So, you are accessing wrong URL based on your configuration, and
> >> potentially have code file in wrong place and with wrong name as well.
>
> >> Graham
>
> >> > the code use in the hello.py is
>
> >> > def application(environ, start_response):
> >> >    status = '200 OK'
> >> >    output = 'Hello World!'
>
> >> >    response_headers = [('Content-type', 'text/plain'),
> >> >                        ('Content-Length', str(len(output)))]
> >> >    start_response(status, response_headers)
>
> >> >    return [output]
>
> >> > i hope that is enough information
>
> >> > thanks all
>
> >> > zeven
>
> >> > On Aug 23, 7:10 pm, Graham Dumpleton <[email protected]>
> >> > wrote:
> >> >> Define not run.
>
> >> >> What documentation are you following?
>
> >> >> Are you using:
>
> >> >>  http://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide
>
> >> >> Use that documentation if you aren't. Also suggest watching the talk:
>
> >> >>  http://code.google.com/p/modwsgi/wiki/WhereToGetHelp?tm=6#Conference_...
>
> >> >> Few more comments below.
>
> >> >> On 24 August 2010 07:48, zevenwolf <[email protected]> wrote:
>
> >> >> > Hi Everyone,
>
> >> >> > so I presume I have installed mod_wsgi correctly
>
> >> >> > I am running apache2.2 and the module is appearing in the modules
> >> >> > folder
>
> >> >> > when i run the hello world app it will not run
>
> >> >> > <VirtualHost *:80>
> >> >> >    DocumentRoot /var/www/vhosts/zevenwolf.com/httpdocs
> >> >> >    ServerNamewww.zevenwolf.com
> >> >> >    ServerAlias zevenwolf.com zevenrodriguez.comwww.zevenrodriguez.com
> >> >> > zevenwithaz.com ww$
> >> >> >    ErrorLog logs/zevenwolf.com-error_log
> >> >> >    CustomLog logs/zevenwolf.com-access_log common
> >> >> > <Directory /var/www/vhosts/zevenwolf.com/httpdocs>
> >> >> > AllowOverride All
> >> >> > </Directory>
> >> >> > ScriptAlias  /cgi-bin/ /var/www/vhosts/zevenwolf.com/cgi-bin/
>
> >> >> > LoadModule wsgi_module modules/mod_wsgi.so
>
> >> >> > WSGIScriptAlias /python_projects /var/www/vhosts/zevenwolf.com/
> >> >> > python_projects.wsgi
>
> >> >> Does the file '/var/www/vhosts/zevenwolf.com/python_projects.wsgi'
> >> >> exist and have the hello world code in it? Down below you mention a
> >> >> hello.py file, so not even sure you have put code in right place.
>
> >> >> What URL are you using to try and access the WSGI application?
>
> >> >> > Alias /python_projects/static /var/www/vhosts/zevenwolf.com/
> >> >> > python_projects/static
> >> >> > AddType text/html .py
>
> >> >> Why do you have the AddType. Not needed for mod_wsgi and bad practice
> >> >> in general for WSGI applications to not set content type and rely on
> >> >> Apache to set it.
>
> >> >> > <Directory /var/www/vhosts/zevenwolf.com/python_projects>
> >> >> >    Order deny,allow
> >> >> >    Allow from all
> >> >> > </Directory>
>
> >> >> > </VirtualHost>
>
> >> >> > and this is the code i am running in the hello.py with in the
> >> >> > directory
> >> >> > def application(environ, start_response):
> >> >> >    status = '200 OK'
> >> >> >    output = 'Hello World!'
>
> >> >> >    response_headers = [('Content-type', 'text/plain'),
> >> >> >                        ('Content-Length', str(len(output)))]
> >> >> >    start_response(status, response_headers)
>
> >> >> >    return [output]
>
> >> >> Is this really called 'hello.py'? Where did you put this file?
>
> >> >> > what could i look at that will tell me that this is installed
> >> >> > correctly
>
> >> >> Did you compile from source code or are you trying to use a
> >> >> precompiled binary package from somewhere?
>
> >> >> Instructions at:
>
> >> >>  http://code.google.com/p/modwsgi/wiki/QuickInstallationGuide
>
> >> >> say how to tell if module loaded, presuming that Apache hasn't been
> >> >> modified not to show module startup strings in Apache error log.
>
> >> >> You can also run:
>
> >> >>   httpd -M
>
> >> >> Ie., -M option to Apache, and it should list:
>
> >> >>  wsgi_module (shared)
>
> >> >> Most important thing is to check your Apache error log.
>
> >> >> Also don't just say it doesn't work. Post what the error is in browser
> >> >> and for what URL that occurred, plus what the Apache error log said at
> >> >> same time.
>
> >> >> Graham
>
> >> > --
> >> > You received this message because you are subscribed to the Google 
> >> > Groups "modwsgi" group.
> >> > To post to this group, send email to
>
> ...
>
> read more »

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/modwsgi?hl=en.

Reply via email to