There is nothing wrong with that message, it is an informational
message only and indicates that mod_wsgi has merely done its
initialisation to grab a handle to the Python main interpreter within
that process.
> interpreter is httpd, not what I want - and the app fails
>
> Could somebody shed some light on this issue?
> Thank you!
> Evgeny. (more info is below)
>
> in my httpd.conf i got:
> -------------------------------------
> User apache
> Group apache
>
> <VirtualHost...>
>
> DocumentRoot /var/www/vhosts/default/htdocs/wsgi/web2py
Why have you changed DocumentRoot to that value?
I hope you aren't just copying what the web2py book and web2py people
are telling you. Practically every configuration I have seen from the
web2py people in regard to using web2py with Apache/mod_wsgi has been
wrong in some way. The main example they tell people to use is
actually a bit dangerous and makes your Apache web server less secure
than it could be due to using what would be regarded as being bad
practice. They seem not to have much idea of how to use Apache
properly. However, because they got upset at me at one point and asked
me not to answer questions on the web2py lists, I haven't bothered to
try and correct all the wrong posts on their list.
> WSGIScriptAlias / /var/www/vhosts/default/htdocs/wsgi/web2py/
Why are you aliasing the whole directory? Why aren't you just mounting
the specific script on the root of the web server?
With the way you have it, your URL will need to have the name of the
WSGI script in the URL, ie.,
/web2py.py
Is that way you really want?
From what I have seen, web2py doesn't necessarily always work properly
when it isn't mounted at the root of the web server. At the least you
possibly need to do some manual configuration or fiddles in URL
mapping to get it to work. Seems it may not honour SCRIPT_NAME in WSGI
environment as mount point properly. Whether this is all still true
for latest web2py versions am not sure, but do keep seeing people
having problems with mounting web2py at a sub URL.
> WSGIDaemonProcess web2py.py
> WSGIProcessGroup web2py
Your WSGIProcessGroup argument for name of process group, should match
the name you gave it in WSGIDaemonProcess directive. In your case that
isn't happening. This at least is the absolute minimum change you need
to make if you don't care about the other issues I am raising.
You also shouldn't need the WSGIProcessGroup directive here anyway, as
you have it within the Directory directive container below.
> </VirtualHost>
>
> #Below I have
>
> <Directory "/var/www/vhosts/default/htdocs/wsgi/web2py/">
> Order allow,deny
> Allow from all
> WSGIProcessGroup web2py
> </Directory>
Note that that Directory directive container would still normally be
within the VirtualHost as you likely only want to open up access to
that directory to that VirtualHost and not inadvertently some other
virtual host. Opening it up to all virtual hosts may have security
implications if this is a shared system and specific users virtual
hosts are setup with option to allow Apache to follow symbolic links
when resolving URLs.
> ----------------------------------------
> if I type
> ls -l /var/www/vhosts/default/htdocs/wsgi/web2py/web2py.py
>
> I get:
> -rwxr-xr-x 1 root root 379 May 31 03:02 /var/www/vhosts/default/htdocs/
> wsgi/web2py/web2py.py
Unless you are happy to make the one change to WSGIProcessGroup and
just get on with trying to make it all work regardless, perhaps you
should start over and answer the following questions for me. Then I'll
tell you what you should be using.
1. Where do you want the web2py application mounted, at the root of
the web server, ie., '/', or a sub URL of the site? Is the reason for
aliasing a whole directory because you will have multiple WSGI
applications hosted at different sub URLs?
2. You appear to want to use daemon mode, but do you want to use a
multi threaded or single threaded process?
Once upon a time the default configuration of web2py was such that it
wasn't technically safe to use in a multithreaded process which was
shared with code which wanted to independently fiddle with the current
working directory. This is because web2py used the bad practice of
changing the working directory on each request. A change was
apparently made to it to allow it to use absolute paths and not rely
on changing the working directory, but this was optional and not the
default behaviour. Anyway, not sure what it is you may have to do to
make web2py completely safe to use in a multi threaded process, or
whether proper thread safety is now the default, or the problems
otherwise addressed.
3. What requirements does web2py have for the web server to serve
static files on its behalf? If there are static files the web server
needs to serve up, what URL are they served from and where in the file
system are they located?
Graham