Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'output': 0.05; 'subject:Python': 0.06; 'output,': 0.09; 'received:151': 0.09; 'skip:/ 10': 0.09; 'cc:addr:python-list': 0.11; 'def': 0.12; 'apache': 0.15; "'200": 0.16; '00:00:00': 0.16; 'burak': 0.16; 'subject:WSGI': 0.16; 'user?': 0.16; 'wrote:': 0.18; 'import': 0.22; 'cc:addr:python.org': 0.22; 'header:User-Agent:1': 0.23; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'script': 0.25; 'define': 0.26; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'chris': 0.29; 'am,': 0.29; 'tim': 0.29; "i'm": 0.30; "skip:' 10": 0.31; 'chase': 0.31; 'running': 0.33; 'skip:# 10': 0.33; 'subject: (': 0.35; 'christian': 0.38; 'skip:[ 10': 0.38; 'skip:- 60': 0.39; 'tell': 0.60; 'issues,': 0.61; 'to:none': 0.92 X-Greylist: Passed host: 37.201.133.86 X-DKIM: Sendmail DKIM Filter v2.8.2 mail-in-03.arcor-online.net 549B5D8078 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arcor.de; s=mail-in; t=1401001579; bh=Pfmf3XSmSSx5Rg6bK3pGrqy6rMp0N45BMigQnemFoKI=; h=Message-ID:Date:From:MIME-Version:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=WbmuTm/0BrrmrEDXCx+I9ROK/MnZ1JEpczed+EKBl1ItZEgFuNDJ6tSGkGxgu4gJa Wlx03xK/DnFf7K7bxtbT6D+KpFaj3KRV/oEIqsufRf0bbEbsMigKNezJs0Ooc7SHfc MlYdimXbiYO0fBB5qfM/eyd1rqI6Ep+UtqlQh5oA= Date: Sun, 25 May 2014 09:06:18 +0200 From: Chris User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 CC: python-list@python.org Subject: WSGI (was: Re: Python CGI) References: <20140519205252.264fc764@bigbox.christie.dr> In-Reply-To: <20140519205252.264fc764@bigbox.christie.dr> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Sun, 25 May 2014 10:17:53 +0200 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 39 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1401005873 news.xs4all.nl 2876 [2001:888:2000:d::a6]:44274 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:71988 On 05/20/2014 03:52 AM, Tim Chase wrote: > While Burak addressed your (Fast-)CGI issues, once you have a > test-script successfully giving you output, you can use the > standard-library's getpass.getuser() function to tell who your script > is running as. LoadModule wsgi_module modules/mod_wsgi.so AddHandler wsgi-script .wsgi WSGIDaemonProcess myproj user=chris threads=3 [root@t-centos1 ~]# ps -ef|grep chris chris 1201 1199 0 08:47 ? 00:00:00 /usr/sbin/httpd -------------------------------------------------------8<------- #!/usr/bin/python import getpass def application(environ, start_response): status = '200 OK' output = 'Hello World!' output += getpass.getuser() response_headers = [('Content-type', 'text/plain'), ('Content-Length', str(len(output)))] start_response(status, response_headers) return [output] ------------------------------------------------------->8------- Hello World!root Hmm, why is it root? I'm using Apache and mod_userdir. Can I define WSGIDaemonProcess for each user? - Chris -- Gruß, Christian