[modwsgi] I use WSGIDaemonProcess server user=demon group=demon but it still use www-data user

2011-11-24 Thread Chunlin Zhang
I user ubuntu 10.04 Apache/2.2.14 mod_wsgi 2.8.
I use WSGIDaemonProcess server user=demon group=demon ,but when I
print  sys.stderr,os.environ,I see the result:
'''
[Fri Nov 25 15:23:12 2011] [error] {'LANG': 'C', 'SHLVL': '1',
'APACHE_RUN_USER': 'www-data', 'APACHE_PID_FILE': '/var/run/
apache2.pid', 'PWD': '/', 'APACHE_RUN_GROUP': 'www-data', 'PATH': '/
usr/local/bin:/usr/bin:/bin', '_': '/usr/sbin/apache2'}
'''
How can I change the user wsgi running?
Thanks

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



Re: [modwsgi] I use WSGIDaemonProcess server user=demon group=demon but it still use www-data user

2011-11-24 Thread Graham Dumpleton
On 25 November 2011 18:28, Chunlin Zhang zhangchun...@gmail.com wrote:
 I user ubuntu 10.04 Apache/2.2.14 mod_wsgi 2.8.
 I use WSGIDaemonProcess server user=demon group=demon ,but when I
 print  sys.stderr,os.environ,I see the result:
 '''
 [Fri Nov 25 15:23:12 2011] [error] {'LANG': 'C', 'SHLVL': '1',
 'APACHE_RUN_USER': 'www-data', 'APACHE_PID_FILE': '/var/run/
 apache2.pid', 'PWD': '/', 'APACHE_RUN_GROUP': 'www-data', 'PATH': '/
 usr/local/bin:/usr/bin:/bin', '_': '/usr/sbin/apache2'}
 '''
 How can I change the user wsgi running?

You can't tell from APACHE_RUN_USER variable that will only say what
Apache child worker processes run as, not mod_wsgi daemon processes.

You need to use:

 import os
 os.geteuid()
501

Then see what the uid matches to in /etc/passwd file.

Also make sure you have a WSGIProcessGroup directive that tells your
app to run in daemon process group configured by WSGIDaemonProcess.

Graham

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