Going back to your original mail to explain some more.
On 01/12/2014, at 6:50 PM, r van dam <[email protected]> wrote:
> On my old server with apache2.2 I use mod_wsgi in daemon mode without
> problems. I use this configuration in the virtual host part of httpd.conf:
> WSGIDaemonProcess stacaravan user=stacaravan group=stacaravan threads=25
> WSGIProcessGroup stacaravan
> WSGIScriptAlias / /home/stacaravan/stacaravan/stacaravan/wsgi.py
>
> On my new server I use Apache2.4 with mod_wsgi-4.3.2
Do you know what Apache MPM the Apache 2.4 installation is set up with? It
should matter, but will be interested to know.
You should be able to work it out if you don't know by running:
httpd -V
> Without daemon mode everything works fine, but with daemon mode I got this
> error:
> [wsgi:error] [pid 13199] (13)Permission denied: [client 81.58.150.99:58714]
> mod_wsgi (pid=13199): Unable to connect to WSGI daemon process 'stacaravan'
> on '/tmp.13194.0.2.sock'., referer:
What is troubling about this value is that if you hadn't already set
WSGISocketPrefix then it should be of the form:
/some/path/wsgi.13194.0.2.sock
That is, the 'wsgi' part in the name has gone.
This suggests that WSGISocketPrefix may have already been set in the
configuration and possibly with it set to '/tmp'. That would be the only thing
that could account for it being set the way it is.
So check the Apache configuration to make sure WSGISocketPrefix isn't set
somewhere already by mistake.
FWIW, one should never attempt to put the socket in /tmp anyway as that
provides questionable security.
> I solved this by making a /var/run/apache2 directory with 755 permission, and
> use the WSGISocketPrefix run/apache2 directive (Is this the right way to
> solve?)
Using 'run/apache2' as argument to WSGISocketPrefix doesn't see correct. Did
you mean 'var/run/apache2'?
> When I add "WSGIProcessGroup stacaravan" to the httpd.conf of the virtual
> server I get the following error:
> [wsgi:error] [pid 13915] [client 81.58.150.99:58850] No WSGI daemon process
> called 'stacaravan' has been configured:
> /home/stacaravan/stacaravan/stacaravan/wsgi.py
That error would suggest there was no WSGIDaemonProcess directive for
stacaravan defined. Or not one in a context where the WSGIProcessGroup was
allowed to use it.
Where was the WSGIDaemonProcess directive set in the configuration?
Where was the WSGIProcessGroup directive set in the configuration?
For a WSGIProcessGroup to be able to always set the same named
WSGIDaemonProcess, the WSGIDaemonProcess would have to be at global scope
outside of any VirtualHost.
Otherwise, the WSGIDaemonProcess directive for the same named group must be
inside of the same VirtualHost, or if the VirtualHost for port 80 or 443,
inside of the VirtualHost for the alternate port with same ServerName.
In the latter case of a 80/443 pair, the WSGIDaemonprocess must be in the
VirtualHost which was first seen by Apache when the configuration was being
read in.
IOW, this is wrong:
<VirtualHost *:80>
ServerName xxx
WSGIProcessGroup yyy
</VirtualHost>
<VirtualHost *443>
ServerName xxx
WSGIDaemonProcess yyy
WSGIProcessGroup yyy
</VirtualHost>
but this is right:
<VirtualHost *:80>
ServerName xxx
WSGIDaemonProcess yyy
WSGIProcessGroup yyy
</VirtualHost>
<VirtualHost *443>
ServerName xxx
WSGIProcessGroup yyy
</VirtualHost>
Graham
> Any help is highly appreciated.
>
> - OS debian 7.7
> - Custombuild apache 2.4 (Directadmin)
> - Mod_wsgi version: 4.3.2 (compiled)
> - used with Django 1.7
>
> --
> You received this message because you are subscribed to the Google Groups
> "modwsgi" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/modwsgi.
> For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.