[modwsgi] Re: mod_wsgi permission error on activate file

2023-04-17 Thread Harald Fontius
Now I removed the virtual environment and change wsgi-file to this:
[image: Screenshot 2023-04-17 170647.png]
and the config file accordingly and the application starts! 
Now I am struggeling with my sqlite db. Obviously it not enough to just 
have in the document root like in the test system. If you have a hint for 
this would be highly recommended! 
Harald Fontius schrieb am Montag, 17. April 2023 um 14:42:49 UTC+2:

> Hi Graham, thank you very much for your comments and recommendations. 
>
> 1. I do not have  AppArmor enabled - at least I am not aware of
> 2. I have checked my installation implementing the suggested test 
> applicationn "myapp" described here 
> 
>  - 
> it worked fine. So the installation seems to be ok. 
> 3. I haven't  found the file *mod_wsgi.so* neither with LD_LIBRARY_PATH 
> set nor without. So I run *mod_wsgi-express module-config *and received 
> this answer:
> LoadModule wsgi_module 
> "/home/hfwds/.local/lib/python3.10/site-packages/mod_wsgi/server/
> mod_wsgi-py310.cpython-310-x86_64-linux-gnu.so"
> WSGIPythonHome "/usr"
> what bothers my is that the pyhton home is /user - actually I found 
> python3.10 here: */usr/local/lib/python3.10 *but the wsgi_module seem to 
> be under */home/hfwds/.local/lib/python3.10/*
> I seem to have 2 different python3.10 installations. Might this be a 
> problem? BTW: the one under /usr/ is the latest. 
> 4. I checked your recommendation with the virtual environments. Actually 
> it seems that I do not necessarily need a virtual environment as I do not 
> plan to have "multiple distinct Python environments for the same version 
> of Python," as described here 
> 
> . 
> So I just want to run one python application that start with __init__.py 
> load view.py that holds the logic runing a flask python project installed 
> here.  
> [image: server_installation.png]
> I still struggeling how the wsgi file would look like to  start this. Any 
> recommendation: Thank you again in advance. 
> Kind regard from Germany 
> Harald 
>
> Harald Fontius schrieb am Sonntag, 16. April 2023 um 22:50:42 UTC+2:
>
>> I am trying to run a PYTHON FLASK application created in MS Visual Studio 
>> and exported it to a directory call “conjugationgame”. 
>>
>> In the VISUAL STUDIO environment it runs without problems. Now I want to 
>> install it on a LINUX Server hosted by IONOS. 
>>
>> UBUNTU  22.04.2 LTS (GNU/Linux 5.15.0-69-generic x86_64) is installed. 
>> Apache2 is installed and shows this status:
>>
>> apache2.service - The Apache HTTP Server
>>  Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor 
>> preset: enabled)
>>  Active: active (running) since Wed 2023-04-12 15:58:48 UTC; 1 day 
>> 23h ago
>>Docs: https://httpd.apache.org/docs/2.4/
>>Main PID: 15997 (apache2)
>>   Tasks: 71 (limit: 2193)
>>  Memory: 30.1M
>> CPU: 55.237s
>>  CGroup: /system.slice/apache2.service
>>  ├─15997 /usr/sbin/apache2 -k start
>>  ├─75728 /usr/sbin/apache2 -k start
>>  ├─75729 /usr/sbin/apache2 -k start
>>  ├─75730 /usr/sbin/apache2 -k start
>>  └─75731 /usr/sbin/apache2 -k start
>>
>> I tried to install a mod_wsgi virtual environment following @Luke Peter’s 
>> very good video tutorial (183) How to Deploy a Flask App to Linux 
>> (Apache and WSGI) - YouTube 
>>
>> In installed the application like this:
>>
>> [image: server_installation.png]
>>
>> I run pipenv install according to this answer to a problem with  
>> mutablemapping python - AttributeError: module 'collections' has no 
>> attribute 'MutableMapping' - Stack Overflow 
>> 
>>
>> [image: install pipenv.png] 
>>
>> Although I got an error running  *pipenv install* after changing the 
>> directory to var/www/conjugationgame.de/conjugationgame/*:*
>>
>> [image: Permission_error_pipenv install.png]
>>
>> Hard to read:
>>
>> PermissionError: [Errno 13] Permission denied ‘var/www/
>> conjugationgame.de/conjugationgame/._atomic-writelcmrxftk’ (might be the 
>> problem but I couldn’t find anything to solve it)
>>
>> *pipenv –venv* gives the link to the virtual environment:
>>
>> [image: error_venv.png]
>>
>> With this link I created the wsgi file like this:
>>
>> [image: wsgi.png]
>>
>> and the config file like this 
>>
>> [image: config.png]
>>
>> Checked the syntax of the config and restarted apache2.
>>
>> [image: restart config.png]
>>
>> When calling https://conjugationgame.de I get this error: 
>>
>> [Fri Apr 14 15:18:59.616298 2023] [wsgi:error] [pid 75730:tid 
>> 139907032913472] [client 91.23.91.105:56927] mod_wsgi (pid=75730): 
>> Failed to exec Python script file '/var/www/
>> 

[modwsgi] Re: mod_wsgi permission error on activate file

2023-04-17 Thread Harald Fontius
Hi Graham, thank you very much for your comments and recommendations. 

1. I do not have  AppArmor enabled - at least I am not aware of
2. I have checked my installation implementing the suggested test 
applicationn "myapp" described here 

 - 
it worked fine. So the installation seems to be ok. 
3. I haven't  found the file *mod_wsgi.so* neither with LD_LIBRARY_PATH set 
nor without. So I run *mod_wsgi-express module-config *and received this 
answer:
LoadModule wsgi_module 
"/home/hfwds/.local/lib/python3.10/site-packages/mod_wsgi/server/mod_wsgi-py310.cpython-310-x86_64-linux-gnu.so"
WSGIPythonHome "/usr"
what bothers my is that the pyhton home is /user - actually I found 
python3.10 here: */usr/local/lib/python3.10 *but the wsgi_module seem to be 
under */home/hfwds/.local/lib/python3.10/*
I seem to have 2 different python3.10 installations. Might this be a 
problem? BTW: the one under /usr/ is the latest. 
4. I checked your recommendation with the virtual environments. Actually it 
seems that I do not necessarily need a virtual environment as I do not plan 
to have "multiple distinct Python environments for the same version of 
Python," as described here 

. 
So I just want to run one python application that start with __init__.py 
load view.py that holds the logic runing a flask python project installed 
here.  
[image: server_installation.png]
I still struggeling how the wsgi file would look like to  start this. Any 
recommendation: Thank you again in advance. 
Kind regard from Germany 
Harald 

Harald Fontius schrieb am Sonntag, 16. April 2023 um 22:50:42 UTC+2:

> I am trying to run a PYTHON FLASK application created in MS Visual Studio 
> and exported it to a directory call “conjugationgame”. 
>
> In the VISUAL STUDIO environment it runs without problems. Now I want to 
> install it on a LINUX Server hosted by IONOS. 
>
> UBUNTU  22.04.2 LTS (GNU/Linux 5.15.0-69-generic x86_64) is installed. 
> Apache2 is installed and shows this status:
>
> apache2.service - The Apache HTTP Server
>  Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor 
> preset: enabled)
>  Active: active (running) since Wed 2023-04-12 15:58:48 UTC; 1 day 23h 
> ago
>Docs: https://httpd.apache.org/docs/2.4/
>Main PID: 15997 (apache2)
>   Tasks: 71 (limit: 2193)
>  Memory: 30.1M
> CPU: 55.237s
>  CGroup: /system.slice/apache2.service
>  ├─15997 /usr/sbin/apache2 -k start
>  ├─75728 /usr/sbin/apache2 -k start
>  ├─75729 /usr/sbin/apache2 -k start
>  ├─75730 /usr/sbin/apache2 -k start
>  └─75731 /usr/sbin/apache2 -k start
>
> I tried to install a mod_wsgi virtual environment following @Luke Peter’s 
> very good video tutorial (183) How to Deploy a Flask App to Linux (Apache 
> and WSGI) - YouTube 
>
> In installed the application like this:
>
> [image: server_installation.png]
>
> I run pipenv install according to this answer to a problem with  
> mutablemapping python - AttributeError: module 'collections' has no 
> attribute 'MutableMapping' - Stack Overflow 
> 
>
> [image: install pipenv.png] 
>
> Although I got an error running  *pipenv install* after changing the 
> directory to var/www/conjugationgame.de/conjugationgame/*:*
>
> [image: Permission_error_pipenv install.png]
>
> Hard to read:
>
> PermissionError: [Errno 13] Permission denied ‘var/www/
> conjugationgame.de/conjugationgame/._atomic-writelcmrxftk’ (might be the 
> problem but I couldn’t find anything to solve it)
>
> *pipenv –venv* gives the link to the virtual environment:
>
> [image: error_venv.png]
>
> With this link I created the wsgi file like this:
>
> [image: wsgi.png]
>
> and the config file like this 
>
> [image: config.png]
>
> Checked the syntax of the config and restarted apache2.
>
> [image: restart config.png]
>
> When calling https://conjugationgame.de I get this error: 
>
> [Fri Apr 14 15:18:59.616298 2023] [wsgi:error] [pid 75730:tid 
> 139907032913472] [client 91.23.91.105:56927] mod_wsgi (pid=75730): Failed 
> to exec Python script file '/var/www/conjugationgame.de/__init__.wsgi'., 
> referer: https://conjugationgame.de/
>
> [Fri Apr 14 15:18:59.616378 2023] [wsgi:error] [pid 75730:tid 
> 139907032913472] [client 91.23.91.105:56927] mod_wsgi (pid=75730): 
> Exception occurred processing WSGI script '/var/www/
> conjugationgame.de/__init__.wsgi'., referer: https://conjugationgame.de/
>
> [Fri Apr 14 15:18:59.616487 2023] [wsgi:error] [pid 75730:tid 
> 139907032913472] [client 91.23.91.105:56927] Traceback (most recent call 
> last):, referer: https://conjugationgame.de/
>
> [Fri Apr 14 15:18:59.616514 2023] 

Re: [modwsgi] Re: mod_wsgi problems on freeBSD

2018-11-01 Thread Graham Dumpleton
If you are still using:

WSGIScriptAlias / /var/www/wsgi-scripts/mywebtool.wsgi

then your WSGI application will hide the original Apache document root 
directory.

If you application is responding for both / and /mywebtool, then that is going 
to be because of how your Flask routes are set up.

If you only want it at a sub URL, so you can still host static files out of the 
Apache document root, you can use:

WSGIScriptAlias /mywebtool /var/www/wsgi-scripts/mywebtool.wsgi

and adjust routes in your application if necessary. The routes should not 
include the /mywebtool mount point in them.

Also, just make sure that DocumentRoot isn't a parent to your application code 
as making that change would mean your code could then be downloaded as static 
files. This is why DocumentRoot should never be a parent directory of anything 
you don't want people to see.

Graham

> On 1 Nov 2018, at 7:52 am, wc  wrote:
> 
> I'm happy to report that I have the Flask app up and running. 
> 
> I cleaned up and double-checked my directories and made one change to the 
> script: I renamed references of "app" to "application". This got my "hello 
> world" app running, but once I did it have it running, I noticed that it 
> would run from the root of my website as well as when I entered the specific 
> URL in the browser, whereas before, just entering the root website name would 
> load the Apache default index web page displaying "It works!" or whatever. To 
> clarify:
> 
> my Flask app "mywebtool" runs from both:
> 
> my.server.edu 
> and
> my.server.edu/mywebtool 
> 
> Whereas before, the first base URL would display the Apache default 
> index.html.
> 
> I'm suspecting that has something to do with my virtual host directives in my 
> httpd.conf, thought I'm not sure why the change I made within the Flask app 
> would modify this behavior, as I haven't made any edits to httpd.conf in this 
> iteration. Possibly, when the wsgi script was failing to locate the Flask 
> application, Apache was falling back on its default page.
> 
> After getting my "hello world" Flask working, I was also able to get my 
> colleague's app running, having to add the line
> 
> server = application.server
> 
> Since, I've been studying the mod wsgi_configuration docs more and trying to 
> understand better your comments regarding the directives in the virtual host. 
> I'll keep working on those :)  
> Starting to see how powerful and flexible mod_wsgi is as a result.
> 
> Thanks again for all the help!
>  
> 
> 
> 
> On Monday, October 29, 2018 at 5:48:39 PM UTC-7, Graham Dumpleton wrote:
> You don't need to chmod +x the WSGI script file.
> 
> Ensure you still have:
> 
> from mywebtool import app as application
> 
> in the WSGi script file.
> 
> If there isn't an 'application' object you will get 404, although I think you 
> should get an error in log as well.
> 
> The 404 may be now be from the Flask application because your routes aren't 
> defined correctly.
> 
> Not sure if you can still set:
> 
> app.debug =True
> 
> in your code to have Flask generate in browser better error as to what issue 
> is.
> 
> Graham
> 
>> On 30 Oct 2018, at 11:45 am, wc ucdavis.edu 
>> > wrote:
>> 
>> Ok thanks.
>> 
>> I did chmod 755 on the mywebtool.py file (plus starting and stopping Apache 
>> with each iteration) and I still get a 404 Not Found error in the browser, 
>> but I'm not getting any errors in the Apache error log any longer:
>> 
>> [Mon Oct 29 17:30:29.609529 2018] [mpm_prefork:notice] [pid 20949] AH00163: 
>> Apache/2.4.35 (FreeBSD) mod_wsgi/4.6.4 Python/2.7 configured -- resuming 
>> normal operations
>> [Mon Oct 29 17:30:29.609818 2018] [core:notice] [pid 20949] AH00094: Command 
>> line: '/usr/local/sbin/httpd -D NOHTTPACCEPT'
>> 
>> 
>> On Monday, October 29, 2018 at 5:39:46 PM UTC-7, Graham Dumpleton wrote:
>> Nothing should be cached from old version of file, but to be safe I would 
>> suggest stopping and starting Apache, trying again and seeing what error you 
>> get.
>> 
>> Also see comments below.
>> 
>>> On 30 Oct 2018, at 11:36 am, wc ucdavis.edu 
>>> > wrote:
>>> 
>>> mywebtool.wsgi is indeed in the location you noted
>>> 
>>> my virtual host section (showing the WSGIScriptAlias) is:
>>> 
>>> 
>>> 
>>> ServerName my.server.edu 
>>> 
>>> DocumentRoot /var/www/FLASKAPPS
>> 
>> You should not set DocumentRoot to be where your application code is. If you 
>> remove the WSGIScriptAlias, people can download your source code. Leave 
>> DocumentRoot as global default, or point it at an empty directory.
>> 
>>> 
>>> 
>>> Require all granted
>>> 
>> 
>> You don't need this above.
>> 
>>> 
>>> WSGIScriptAlias / /var/www/wsgi-scripts/mywebtool.wsgi
>>> 
>>> 
>>> Require all granted
>>> 
>>> 
>>> 
>>> 
>>> On Monday, October 29, 2018 at 5:30:05 PM UTC-7, Graham 

Re: [modwsgi] Re: mod_wsgi problems on freeBSD

2018-10-31 Thread wc
I'm happy to report that I have the Flask app up and running. 

I cleaned up and double-checked my directories and made one change to the 
script: I renamed references of "app" to "application". This got my "hello 
world" app running, but once I did it have it running, I noticed that it 
would run from the root of my website as well as when I entered the 
specific URL in the browser, whereas before, just entering the root website 
name would load the Apache default index web page displaying "It works!" or 
whatever. To clarify:

my Flask app "mywebtool" runs from both:

my.server.edu

and

my.server.edu/mywebtool


Whereas before, the first base URL would display the Apache default 
index.html.

I'm suspecting that has something to do with my virtual host directives in 
my httpd.conf, thought I'm not sure why the change I made within the Flask 
app would modify this behavior, as I haven't made any edits to httpd.conf 
in this iteration. Possibly, when the wsgi script was failing to locate the 
Flask application, Apache was falling back on its default page.

After getting my "hello world" Flask working, I was also able to get my 
colleague's app running, having to add the line

server = application.server


Since, I've been studying the mod wsgi_configuration docs more and trying 
to understand better your comments regarding the directives in the virtual 
host. I'll keep working on those :)  
Starting to see how powerful and flexible mod_wsgi is as a result.

Thanks again for all the help!

 




On Monday, October 29, 2018 at 5:48:39 PM UTC-7, Graham Dumpleton wrote:
>
> You don't need to chmod +x the WSGI script file.
>
> Ensure you still have:
>
> from mywebtool import app as application
>
> in the WSGi script file.
>
> If there isn't an 'application' object you will get 404, although I think 
> you should get an error in log as well.
>
> The 404 may be now be from the Flask application because your routes 
> aren't defined correctly.
>
> Not sure if you can still set:
>
> app.debug =True
>
> in your code to have Flask generate in browser better error as to what 
> issue is.
>
> Graham
>
> On 30 Oct 2018, at 11:45 am, wc > wrote:
>
> Ok thanks.
>
> I did chmod 755 on the mywebtool.py file (plus starting and stopping 
> Apache with each iteration) and I still get a 404 Not Found error in the 
> browser, but I'm not getting any errors in the Apache error log any longer:
>
> [Mon Oct 29 17:30:29.609529 2018] [mpm_prefork:notice] [pid 20949] 
> AH00163: Apache/2.4.35 (FreeBSD) mod_wsgi/4.6.4 Python/2.7 configured -- 
> resuming normal operations
> [Mon Oct 29 17:30:29.609818 2018] [core:notice] [pid 20949] AH00094: 
> Command line: '/usr/local/sbin/httpd -D NOHTTPACCEPT'
>
>
>
> On Monday, October 29, 2018 at 5:39:46 PM UTC-7, Graham Dumpleton wrote:
>>
>> Nothing should be cached from old version of file, but to be safe I would 
>> suggest stopping and starting Apache, trying again and seeing what error 
>> you get.
>>
>> Also see comments below.
>>
>> On 30 Oct 2018, at 11:36 am, wc  wrote:
>>
>> mywebtool.wsgi is indeed in the location you noted
>>
>> my virtual host section (showing the WSGIScriptAlias) is:
>>
>> 
>>
>> ServerName my.server.edu
>>
>> DocumentRoot /var/www/FLASKAPPS
>>
>>
>> You should not set DocumentRoot to be where your application code is. If 
>> you remove the WSGIScriptAlias, people can download your source code. Leave 
>> DocumentRoot as global default, or point it at an empty directory.
>>
>>
>> 
>> Require all granted
>> 
>>
>>
>> You don't need this above.
>>
>>
>> WSGIScriptAlias / /var/www/wsgi-scripts/mywebtool.wsgi
>>
>> 
>> Require all granted
>> 
>> 
>> 
>>
>> On Monday, October 29, 2018 at 5:30:05 PM UTC-7, Graham Dumpleton wrote:
>>>
>>> Where is 'mywebtool.wsgi'.
>>>
>>> The error suggests:
>>>
>>> /var/www/wsgi-scripts/mywebtool.wsgi
>>>
>>> yet, the error also says:
>>>
>>> [Mon Oct 29 15:55:30.446084 2018] [wsgi:error] [pid 20476] [client 
>>> 60.248.94.241:50359]   File "/var/www/wsgi-scripts/mywebtool.wsgi", 
>>> line 1, in 
>>> [Mon Oct 29 15:55:30.446150 2018] [wsgi:error] [pid 20476] [client 
>>> 60.248.94.241:50359] from mywebtool import app as application
>>>
>>> so is talking about the import being on line 1, so it doesn't match what 
>>> you said was in that, which you said was:
>>>
>>> import sys
>>>
>>> sys.path.insert(0, '/var/www/FLASKAPPS')
>>>
>>> from mywebtool import app as application
>>>
>>>
>>> The import error should have said line 5, not line 1.
>>>
>>> So check path for WSGIScriptAlias and that the code file does update 
>>> sys.path.
>>>
>>> Graham
>>>
>>>
>>> On 30 Oct 2018, at 11:24 am, wc  wrote:
>>>
>>> I believe I understand what you mean for the package vs. module 
>>> structure.
>>>
>>> I get:
>>>
>>> $ ls -las /var/www/FLASKAPPS
>>> total 6
>>> 1 drwxr-xr-x  2 root  wheel3 Oct 23 17:39 .
>>> 1 drwxr-xr-x  4 root  wheel4 Oct 23 18:10 ..
>>> 5 -rw-r--r--  1 wes   

Re: [modwsgi] Re: mod_wsgi problems on freeBSD

2018-10-29 Thread wc
I will check these in the morning. Thank you for all the help.

On Monday, October 29, 2018 at 5:48:39 PM UTC-7, Graham Dumpleton wrote:
>
> You don't need to chmod +x the WSGI script file.
>
> Ensure you still have:
>
> from mywebtool import app as application
>
> in the WSGi script file.
>
> If there isn't an 'application' object you will get 404, although I think 
> you should get an error in log as well.
>
> The 404 may be now be from the Flask application because your routes 
> aren't defined correctly.
>
> Not sure if you can still set:
>
> app.debug =True
>
> in your code to have Flask generate in browser better error as to what 
> issue is.
>
> Graham
>
> On 30 Oct 2018, at 11:45 am, wc > wrote:
>
> Ok thanks.
>
> I did chmod 755 on the mywebtool.py file (plus starting and stopping 
> Apache with each iteration) and I still get a 404 Not Found error in the 
> browser, but I'm not getting any errors in the Apache error log any longer:
>
> [Mon Oct 29 17:30:29.609529 2018] [mpm_prefork:notice] [pid 20949] 
> AH00163: Apache/2.4.35 (FreeBSD) mod_wsgi/4.6.4 Python/2.7 configured -- 
> resuming normal operations
> [Mon Oct 29 17:30:29.609818 2018] [core:notice] [pid 20949] AH00094: 
> Command line: '/usr/local/sbin/httpd -D NOHTTPACCEPT'
>
>
>
> On Monday, October 29, 2018 at 5:39:46 PM UTC-7, Graham Dumpleton wrote:
>>
>> Nothing should be cached from old version of file, but to be safe I would 
>> suggest stopping and starting Apache, trying again and seeing what error 
>> you get.
>>
>> Also see comments below.
>>
>> On 30 Oct 2018, at 11:36 am, wc  wrote:
>>
>> mywebtool.wsgi is indeed in the location you noted
>>
>> my virtual host section (showing the WSGIScriptAlias) is:
>>
>> 
>>
>> ServerName my.server.edu
>>
>> DocumentRoot /var/www/FLASKAPPS
>>
>>
>> You should not set DocumentRoot to be where your application code is. If 
>> you remove the WSGIScriptAlias, people can download your source code. Leave 
>> DocumentRoot as global default, or point it at an empty directory.
>>
>>
>> 
>> Require all granted
>> 
>>
>>
>> You don't need this above.
>>
>>
>> WSGIScriptAlias / /var/www/wsgi-scripts/mywebtool.wsgi
>>
>> 
>> Require all granted
>> 
>> 
>> 
>>
>> On Monday, October 29, 2018 at 5:30:05 PM UTC-7, Graham Dumpleton wrote:
>>>
>>> Where is 'mywebtool.wsgi'.
>>>
>>> The error suggests:
>>>
>>> /var/www/wsgi-scripts/mywebtool.wsgi
>>>
>>> yet, the error also says:
>>>
>>> [Mon Oct 29 15:55:30.446084 2018] [wsgi:error] [pid 20476] [client 
>>> 60.248.94.241:50359]   File "/var/www/wsgi-scripts/mywebtool.wsgi", 
>>> line 1, in 
>>> [Mon Oct 29 15:55:30.446150 2018] [wsgi:error] [pid 20476] [client 
>>> 60.248.94.241:50359] from mywebtool import app as application
>>>
>>> so is talking about the import being on line 1, so it doesn't match what 
>>> you said was in that, which you said was:
>>>
>>> import sys
>>>
>>> sys.path.insert(0, '/var/www/FLASKAPPS')
>>>
>>> from mywebtool import app as application
>>>
>>>
>>> The import error should have said line 5, not line 1.
>>>
>>> So check path for WSGIScriptAlias and that the code file does update 
>>> sys.path.
>>>
>>> Graham
>>>
>>>
>>> On 30 Oct 2018, at 11:24 am, wc  wrote:
>>>
>>> I believe I understand what you mean for the package vs. module 
>>> structure.
>>>
>>> I get:
>>>
>>> $ ls -las /var/www/FLASKAPPS
>>> total 6
>>> 1 drwxr-xr-x  2 root  wheel3 Oct 23 17:39 .
>>> 1 drwxr-xr-x  4 root  wheel4 Oct 23 18:10 ..
>>> 5 -rw-r--r--  1 wes   wes148 Oct 23 17:33 mywebtool.py
>>>
>>>
>>> When I do the ls -las 
>>>
>>> On Monday, October 29, 2018 at 5:20:21 PM UTC-7, Graham Dumpleton wrote:



 On 30 Oct 2018, at 11:16 am, wc  wrote:

 Yes, my "mywebtool" is under 

 /var/www/FLASKAPPS


 I'm assuming that Apache is running as user www, though I should check 
 that and check the permissions on the file. As I recall, I uploaded the 
 files as root because I was unable to modify the directory /var/www as 
 myself from my ftp prog.


 Keep in mind it isn't just the files that need to be readable, the 
 directories down to where the files are also need to be accessible.

 So what do you get for:

 ls -las /var/www/FLASKAPPS

 I installed mod_wsgi with pip2.7 ... 

 No... I don't have an __init__.py file, and I'm just seeing now in the 
 tutorial that the file I am calling "mywebtool.py" they are referring to 
 as 
 __init__.py


 If you have mywebtool.py that is fine as just means you are packaging 
 your application as a module rather than a package. Later on when need to 
 split code across multiple files, better to use a package format. Because 
 using Python 2.7, must have the __init__.py in that package where as in 
 Python 3 you don't need it.

 Graham

  

 On Monday, October 29, 2018 at 5:08:44 PM 

Re: [modwsgi] Re: mod_wsgi problems on freeBSD

2018-10-29 Thread Graham Dumpleton
Nothing should be cached from old version of file, but to be safe I would 
suggest stopping and starting Apache, trying again and seeing what error you 
get.

Also see comments below.

> On 30 Oct 2018, at 11:36 am, wc  wrote:
> 
> mywebtool.wsgi is indeed in the location you noted
> 
> my virtual host section (showing the WSGIScriptAlias) is:
> 
> 
> 
> ServerName my.server.edu 
> 
> DocumentRoot /var/www/FLASKAPPS

You should not set DocumentRoot to be where your application code is. If you 
remove the WSGIScriptAlias, people can download your source code. Leave 
DocumentRoot as global default, or point it at an empty directory.

> 
> 
> Require all granted
> 

You don't need this above.

> 
> WSGIScriptAlias / /var/www/wsgi-scripts/mywebtool.wsgi
> 
> 
> Require all granted
> 
> 
> 
> 
> On Monday, October 29, 2018 at 5:30:05 PM UTC-7, Graham Dumpleton wrote:
> Where is 'mywebtool.wsgi'.
> 
> The error suggests:
> 
> /var/www/wsgi-scripts/mywebtool.wsgi
> 
> yet, the error also says:
> 
> [Mon Oct 29 15:55:30.446084 2018] [wsgi:error] [pid 20476] [client 
> 60.248.94.241:50359 ]   File 
> "/var/www/wsgi-scripts/mywebtool.wsgi", line 1, in 
> [Mon Oct 29 15:55:30.446150 2018] [wsgi:error] [pid 20476] [client 
> 60.248.94.241:50359 ] from mywebtool import 
> app as application
> 
> so is talking about the import being on line 1, so it doesn't match what you 
> said was in that, which you said was:
> 
> import sys
> 
> sys.path.insert(0, '/var/www/FLASKAPPS')
> 
> from mywebtool import app as application
> 
> The import error should have said line 5, not line 1.
> 
> So check path for WSGIScriptAlias and that the code file does update sys.path.
> 
> Graham
> 
> 
>> On 30 Oct 2018, at 11:24 am, wc ucdavis.edu 
>> > wrote:
>> 
>> I believe I understand what you mean for the package vs. module structure.
>> 
>> I get:
>> $ ls -las /var/www/FLASKAPPS
>> total 6
>> 1 drwxr-xr-x  2 root  wheel3 Oct 23 17:39 .
>> 1 drwxr-xr-x  4 root  wheel4 Oct 23 18:10 ..
>> 5 -rw-r--r--  1 wes   wes148 Oct 23 17:33 mywebtool.py
>> 
>> When I do the ls -las 
>> 
>> On Monday, October 29, 2018 at 5:20:21 PM UTC-7, Graham Dumpleton wrote:
>> 
>> 
>>> On 30 Oct 2018, at 11:16 am, wc > wrote:
>>> 
>>> Yes, my "mywebtool" is under 
>>> 
>>> /var/www/FLASKAPPS
>>> 
>>> I'm assuming that Apache is running as user www, though I should check that 
>>> and check the permissions on the file. As I recall, I uploaded the files as 
>>> root because I was unable to modify the directory /var/www as myself from 
>>> my ftp prog.
>> 
>> Keep in mind it isn't just the files that need to be readable, the 
>> directories down to where the files are also need to be accessible.
>> 
>> So what do you get for:
>> 
>> ls -las /var/www/FLASKAPPS
>> 
>>> I installed mod_wsgi with pip2.7 ... 
>>> 
>>> No... I don't have an __init__.py file, and I'm just seeing now in the 
>>> tutorial that the file I am calling "mywebtool.py" they are referring to as 
>>> __init__.py
>> 
>> If you have mywebtool.py that is fine as just means you are packaging your 
>> application as a module rather than a package. Later on when need to split 
>> code across multiple files, better to use a package format. Because using 
>> Python 2.7, must have the __init__.py in that package where as in Python 3 
>> you don't need it.
>> 
>> Graham
>> 
>>>  
>>> 
>>> On Monday, October 29, 2018 at 5:08:44 PM UTC-7, Graham Dumpleton wrote:
>>> Is your mywebtool module/package under:
>>> 
>>> /var/www/FLASKAPPS
>>> 
>>> or:
>>> 
>>> /var/www/wsgi-scripts
>>> 
>>> Are the directories/files readable to the user that Apache runs as?
>>> 
>>> Is mod_wsgi compiled for Python 2.7 or 3.X?
>>> 
>>> If mywebtool is a package, does it have an __init__.py file in it.
>>> 
>>> Graham
>>> 
 On 30 Oct 2018, at 11:05 am, wc ucdavis.edu 
 > wrote:
 
 Thank you both for your replies. I now have a better understanding of the 
 wsgi framework and I am using the error log to my advantage. I was able to 
 find an error in my httpd.conf - I was using Apache 2.2 syntax in my 
 directives, now I've updated it with the "Require all granted" and I am 
 getting the server to respond with the wsgi script, which I have named 
 mywebtool.wsgi - the code for which I grabbed from a stack overflow post:
 
 def application(environ, start_response):
 status = '200 OK'
 output = b'Hello World!\n'
 response_headers = [('Content-type', 'text/plain'),
 ('Content-Length', str(len(output)))]
 start_response(status, response_headers)
 return [output]
 
 I decided to do this to verify the first 2/3 of the stack were working 
 (Apache, mod_wsgi). 
 
 My original wsgi script taken from the flask mod_wsgi docs 

Re: [modwsgi] Re: mod_wsgi problems on freeBSD

2018-10-29 Thread wc
mywebtool.wsgi is indeed in the location you noted

my virtual host section (showing the WSGIScriptAlias) is:



ServerName my.server.edu

DocumentRoot /var/www/FLASKAPPS


Require all granted


WSGIScriptAlias / /var/www/wsgi-scripts/mywebtool.wsgi


Require all granted




On Monday, October 29, 2018 at 5:30:05 PM UTC-7, Graham Dumpleton wrote:
>
> Where is 'mywebtool.wsgi'.
>
> The error suggests:
>
> /var/www/wsgi-scripts/mywebtool.wsgi
>
> yet, the error also says:
>
> [Mon Oct 29 15:55:30.446084 2018] [wsgi:error] [pid 20476] [client 
> 60.248.94.241:50359]   File "/var/www/wsgi-scripts/mywebtool.wsgi", line 
> 1, in 
> [Mon Oct 29 15:55:30.446150 2018] [wsgi:error] [pid 20476] [client 
> 60.248.94.241:50359] from mywebtool import app as application
>
> so is talking about the import being on line 1, so it doesn't match what 
> you said was in that, which you said was:
>
> import sys
>
> sys.path.insert(0, '/var/www/FLASKAPPS')
>
> from mywebtool import app as application
>
>
> The import error should have said line 5, not line 1.
>
> So check path for WSGIScriptAlias and that the code file does update 
> sys.path.
>
> Graham
>
>
> On 30 Oct 2018, at 11:24 am, wc > wrote:
>
> I believe I understand what you mean for the package vs. module structure.
>
> I get:
>
> $ ls -las /var/www/FLASKAPPS
> total 6
> 1 drwxr-xr-x  2 root  wheel3 Oct 23 17:39 .
> 1 drwxr-xr-x  4 root  wheel4 Oct 23 18:10 ..
> 5 -rw-r--r--  1 wes   wes148 Oct 23 17:33 mywebtool.py
>
>
> When I do the ls -las 
>
> On Monday, October 29, 2018 at 5:20:21 PM UTC-7, Graham Dumpleton wrote:
>>
>>
>>
>> On 30 Oct 2018, at 11:16 am, wc  wrote:
>>
>> Yes, my "mywebtool" is under 
>>
>> /var/www/FLASKAPPS
>>
>>
>> I'm assuming that Apache is running as user www, though I should check 
>> that and check the permissions on the file. As I recall, I uploaded the 
>> files as root because I was unable to modify the directory /var/www as 
>> myself from my ftp prog.
>>
>>
>> Keep in mind it isn't just the files that need to be readable, the 
>> directories down to where the files are also need to be accessible.
>>
>> So what do you get for:
>>
>> ls -las /var/www/FLASKAPPS
>>
>> I installed mod_wsgi with pip2.7 ... 
>>
>> No... I don't have an __init__.py file, and I'm just seeing now in the 
>> tutorial that the file I am calling "mywebtool.py" they are referring to as 
>> __init__.py
>>
>>
>> If you have mywebtool.py that is fine as just means you are packaging 
>> your application as a module rather than a package. Later on when need to 
>> split code across multiple files, better to use a package format. Because 
>> using Python 2.7, must have the __init__.py in that package where as in 
>> Python 3 you don't need it.
>>
>> Graham
>>
>>  
>>
>> On Monday, October 29, 2018 at 5:08:44 PM UTC-7, Graham Dumpleton wrote:
>>>
>>> Is your mywebtool module/package under:
>>>
>>> /var/www/FLASKAPPS
>>>
>>> or:
>>>
>>> /var/www/wsgi-scripts
>>>
>>> Are the directories/files readable to the user that Apache runs as?
>>>
>>> Is mod_wsgi compiled for Python 2.7 or 3.X?
>>>
>>> If mywebtool is a package, does it have an __init__.py file in it.
>>>
>>> Graham
>>>
>>> On 30 Oct 2018, at 11:05 am, wc  wrote:
>>>
>>> Thank you both for your replies. I now have a better understanding of 
>>> the wsgi framework and I am using the error log to my advantage. I was able 
>>> to find an error in my httpd.conf - I was using Apache 2.2 syntax in my 
>>> directives, now I've updated it with the "Require all granted" and I am 
>>> getting the server to respond with the wsgi script, which I have named 
>>> mywebtool.wsgi - the code for which I grabbed from a stack overflow post:
>>>
>>> def application(environ, start_response):
>>> status = '200 OK'
>>> output = b'Hello World!\n'
>>> response_headers = [('Content-type', 'text/plain'),
>>> ('Content-Length', str(len(output)))]
>>> start_response(status, response_headers)
>>> return [output]
>>>
>>>
>>> I decided to do this to verify the first 2/3 of the stack were working 
>>> (Apache, mod_wsgi). 
>>>
>>> My original wsgi script taken from the flask mod_wsgi docs (
>>> http://flask.pocoo.org/docs/1.0/deploying/mod_wsgi/) is simple:
>>>
>>> import sys
>>>
>>> sys.path.insert(0, '/var/www/FLASKAPPS')
>>>
>>> from mywebtool import app as application
>>>
>>>
>>>
>>>
>>> and points to the Hello World python app I was calling originally 
>>> (again, got this basic python script from a tutorial at 
>>> https://www.bogotobogo.com/python/Flask/Python_Flask_HelloWorld_App_with_Apache_WSGI_Ubuntu14.php
>>> ):
>>>
>>>
>>>  
>>>
>>> $ cat mywebtool.py
>>> from flask import Flask
>>>  
>>> app = Flask(__name__)
>>>  
>>> @app.route("/")
>>> def hello():
>>> return "Hello world!"
>>>  
>>> if __name__ == "__main__":
>>> app.run()
>>>
>>>
>>> But, this is failing. When I tailed the Apache error log, I saw:
>>>
>>> 

Re: [modwsgi] Re: mod_wsgi problems on freeBSD

2018-10-29 Thread Graham Dumpleton
Where is 'mywebtool.wsgi'.

The error suggests:

/var/www/wsgi-scripts/mywebtool.wsgi

yet, the error also says:

[Mon Oct 29 15:55:30.446084 2018] [wsgi:error] [pid 20476] [client 
60.248.94.241:50359]   File "/var/www/wsgi-scripts/mywebtool.wsgi", line 1, in 

[Mon Oct 29 15:55:30.446150 2018] [wsgi:error] [pid 20476] [client 
60.248.94.241:50359] from mywebtool import app as application

so is talking about the import being on line 1, so it doesn't match what you 
said was in that, which you said was:

import sys

sys.path.insert(0, '/var/www/FLASKAPPS')

from mywebtool import app as application

The import error should have said line 5, not line 1.

So check path for WSGIScriptAlias and that the code file does update sys.path.

Graham


> On 30 Oct 2018, at 11:24 am, wc  wrote:
> 
> I believe I understand what you mean for the package vs. module structure.
> 
> I get:
> $ ls -las /var/www/FLASKAPPS
> total 6
> 1 drwxr-xr-x  2 root  wheel3 Oct 23 17:39 .
> 1 drwxr-xr-x  4 root  wheel4 Oct 23 18:10 ..
> 5 -rw-r--r--  1 wes   wes148 Oct 23 17:33 mywebtool.py
> 
> When I do the ls -las 
> 
> On Monday, October 29, 2018 at 5:20:21 PM UTC-7, Graham Dumpleton wrote:
> 
> 
>> On 30 Oct 2018, at 11:16 am, wc > wrote:
>> 
>> Yes, my "mywebtool" is under 
>> 
>> /var/www/FLASKAPPS
>> 
>> I'm assuming that Apache is running as user www, though I should check that 
>> and check the permissions on the file. As I recall, I uploaded the files as 
>> root because I was unable to modify the directory /var/www as myself from my 
>> ftp prog.
> 
> Keep in mind it isn't just the files that need to be readable, the 
> directories down to where the files are also need to be accessible.
> 
> So what do you get for:
> 
> ls -las /var/www/FLASKAPPS
> 
>> I installed mod_wsgi with pip2.7 ... 
>> 
>> No... I don't have an __init__.py file, and I'm just seeing now in the 
>> tutorial that the file I am calling "mywebtool.py" they are referring to as 
>> __init__.py
> 
> If you have mywebtool.py that is fine as just means you are packaging your 
> application as a module rather than a package. Later on when need to split 
> code across multiple files, better to use a package format. Because using 
> Python 2.7, must have the __init__.py in that package where as in Python 3 
> you don't need it.
> 
> Graham
> 
>>  
>> 
>> On Monday, October 29, 2018 at 5:08:44 PM UTC-7, Graham Dumpleton wrote:
>> Is your mywebtool module/package under:
>> 
>> /var/www/FLASKAPPS
>> 
>> or:
>> 
>> /var/www/wsgi-scripts
>> 
>> Are the directories/files readable to the user that Apache runs as?
>> 
>> Is mod_wsgi compiled for Python 2.7 or 3.X?
>> 
>> If mywebtool is a package, does it have an __init__.py file in it.
>> 
>> Graham
>> 
>>> On 30 Oct 2018, at 11:05 am, wc ucdavis.edu 
>>> > wrote:
>>> 
>>> Thank you both for your replies. I now have a better understanding of the 
>>> wsgi framework and I am using the error log to my advantage. I was able to 
>>> find an error in my httpd.conf - I was using Apache 2.2 syntax in my 
>>> directives, now I've updated it with the "Require all granted" and I am 
>>> getting the server to respond with the wsgi script, which I have named 
>>> mywebtool.wsgi - the code for which I grabbed from a stack overflow post:
>>> 
>>> def application(environ, start_response):
>>> status = '200 OK'
>>> output = b'Hello World!\n'
>>> response_headers = [('Content-type', 'text/plain'),
>>> ('Content-Length', str(len(output)))]
>>> start_response(status, response_headers)
>>> return [output]
>>> 
>>> I decided to do this to verify the first 2/3 of the stack were working 
>>> (Apache, mod_wsgi). 
>>> 
>>> My original wsgi script taken from the flask mod_wsgi docs 
>>> (http://flask.pocoo.org/docs/1.0/deploying/mod_wsgi/ 
>>> ) is simple:
>>> 
>>> import sys
>>> 
>>> sys.path.insert(0, '/var/www/FLASKAPPS')
>>> 
>>> from mywebtool import app as application
>>> 
>>> 
>>> 
>>> and points to the Hello World python app I was calling originally (again, 
>>> got this basic python script from a tutorial at 
>>> https://www.bogotobogo.com/python/Flask/Python_Flask_HelloWorld_App_with_Apache_WSGI_Ubuntu14.php
>>>  
>>> ):
>>> 
>>>  
>>> $ cat mywebtool.py
>>> from flask import Flask
>>>  
>>> app = Flask(__name__)
>>>  
>>> @app.route("/")
>>> def hello():
>>> return "Hello world!"
>>>  
>>> if __name__ == "__main__":
>>> app.run()
>>> 
>>> But, this is failing. When I tailed the Apache error log, I saw:
>>> 
>>> [Mon Oct 29 15:53:08.108746 2018] [wsgi:error] [pid 20474] [client 
>>> 185.26.34.125:53717 ] ImportError: No module 
>>> named mywebtool
>>> [Mon Oct 29 15:55:30.445940 2018] [wsgi:error] [pid 20476] [client 
>>> 60.248.94.241:50359 

Re: [modwsgi] Re: mod_wsgi problems on freeBSD

2018-10-29 Thread wc
I believe I understand what you mean for the package vs. module structure.

I get:

$ ls -las /var/www/FLASKAPPS
total 6
1 drwxr-xr-x  2 root  wheel3 Oct 23 17:39 .
1 drwxr-xr-x  4 root  wheel4 Oct 23 18:10 ..
5 -rw-r--r--  1 wes   wes148 Oct 23 17:33 mywebtool.py


When I do the ls -las 

On Monday, October 29, 2018 at 5:20:21 PM UTC-7, Graham Dumpleton wrote:
>
>
>
> On 30 Oct 2018, at 11:16 am, wc > wrote:
>
> Yes, my "mywebtool" is under 
>
> /var/www/FLASKAPPS
>
>
> I'm assuming that Apache is running as user www, though I should check 
> that and check the permissions on the file. As I recall, I uploaded the 
> files as root because I was unable to modify the directory /var/www as 
> myself from my ftp prog.
>
>
> Keep in mind it isn't just the files that need to be readable, the 
> directories down to where the files are also need to be accessible.
>
> So what do you get for:
>
> ls -las /var/www/FLASKAPPS
>
> I installed mod_wsgi with pip2.7 ... 
>
> No... I don't have an __init__.py file, and I'm just seeing now in the 
> tutorial that the file I am calling "mywebtool.py" they are referring to as 
> __init__.py
>
>
> If you have mywebtool.py that is fine as just means you are packaging your 
> application as a module rather than a package. Later on when need to split 
> code across multiple files, better to use a package format. Because using 
> Python 2.7, must have the __init__.py in that package where as in Python 3 
> you don't need it.
>
> Graham
>
>  
>
> On Monday, October 29, 2018 at 5:08:44 PM UTC-7, Graham Dumpleton wrote:
>>
>> Is your mywebtool module/package under:
>>
>> /var/www/FLASKAPPS
>>
>> or:
>>
>> /var/www/wsgi-scripts
>>
>> Are the directories/files readable to the user that Apache runs as?
>>
>> Is mod_wsgi compiled for Python 2.7 or 3.X?
>>
>> If mywebtool is a package, does it have an __init__.py file in it.
>>
>> Graham
>>
>> On 30 Oct 2018, at 11:05 am, wc  wrote:
>>
>> Thank you both for your replies. I now have a better understanding of the 
>> wsgi framework and I am using the error log to my advantage. I was able to 
>> find an error in my httpd.conf - I was using Apache 2.2 syntax in my 
>> directives, now I've updated it with the "Require all granted" and I am 
>> getting the server to respond with the wsgi script, which I have named 
>> mywebtool.wsgi - the code for which I grabbed from a stack overflow post:
>>
>> def application(environ, start_response):
>> status = '200 OK'
>> output = b'Hello World!\n'
>> response_headers = [('Content-type', 'text/plain'),
>> ('Content-Length', str(len(output)))]
>> start_response(status, response_headers)
>> return [output]
>>
>>
>> I decided to do this to verify the first 2/3 of the stack were working 
>> (Apache, mod_wsgi). 
>>
>> My original wsgi script taken from the flask mod_wsgi docs (
>> http://flask.pocoo.org/docs/1.0/deploying/mod_wsgi/) is simple:
>>
>> import sys
>>
>> sys.path.insert(0, '/var/www/FLASKAPPS')
>>
>> from mywebtool import app as application
>>
>>
>>
>>
>> and points to the Hello World python app I was calling originally (again, 
>> got this basic python script from a tutorial at 
>> https://www.bogotobogo.com/python/Flask/Python_Flask_HelloWorld_App_with_Apache_WSGI_Ubuntu14.php
>> ):
>>
>>
>>  
>>
>> $ cat mywebtool.py
>> from flask import Flask
>>  
>> app = Flask(__name__)
>>  
>> @app.route("/")
>> def hello():
>> return "Hello world!"
>>  
>> if __name__ == "__main__":
>> app.run()
>>
>>
>> But, this is failing. When I tailed the Apache error log, I saw:
>>
>> [Mon Oct 29 15:53:08.108746 2018] [wsgi:error] [pid 20474] [client 
>> 185.26.34.125:53717] ImportError: No module named mywebtool
>> [Mon Oct 29 15:55:30.445940 2018] [wsgi:error] [pid 20476] [client 
>> 60.248.94.241:50359] mod_wsgi (pid=20476): Failed to exec Python script 
>> file '/var/www/wsgi-scripts/mywebtool.wsgi'.
>> [Mon Oct 29 15:55:30.446038 2018] [wsgi:error] [pid 20476] [client 
>> 60.248.94.241:50359] mod_wsgi (pid=20476): Exception occurred processing 
>> WSGI script '/var/www/wsgi-scripts/mywebtool.wsgi'.
>> [Mon Oct 29 15:55:30.446059 2018] [wsgi:error] [pid 20476] [client 
>> 60.248.94.241:50359] Traceback (most recent call last):
>> [Mon Oct 29 15:55:30.446084 2018] [wsgi:error] [pid 20476] [client 
>> 60.248.94.241:50359]   File "/var/www/wsgi-scripts/mywebtool.wsgi", line 
>> 1, in 
>> [Mon Oct 29 15:55:30.446150 2018] [wsgi:error] [pid 20476] [client 
>> 60.248.94.241:50359] from mywebtool import app as application
>> [Mon Oct 29 15:55:30.446173 2018] [wsgi:error] [pid 20476] [client 
>> 60.248.94.241:50359] ImportError: No module named mywebtool
>>
>>
>> Obviously, I named my python file "mywebtool.py" as I say in the wsgi 
>> script, which leads me to two potential conclusions - 1. I'm not properly 
>> referring to the .py in the wsgi script, or 2. my python script is not 
>> executing due to a problem with python, or  with the python code 

Re: [modwsgi] Re: mod_wsgi problems on freeBSD

2018-10-29 Thread Graham Dumpleton


> On 30 Oct 2018, at 11:16 am, wc  wrote:
> 
> Yes, my "mywebtool" is under 
> 
> /var/www/FLASKAPPS
> 
> I'm assuming that Apache is running as user www, though I should check that 
> and check the permissions on the file. As I recall, I uploaded the files as 
> root because I was unable to modify the directory /var/www as myself from my 
> ftp prog.

Keep in mind it isn't just the files that need to be readable, the directories 
down to where the files are also need to be accessible.

So what do you get for:

ls -las /var/www/FLASKAPPS

> I installed mod_wsgi with pip2.7 ... 
> 
> No... I don't have an __init__.py file, and I'm just seeing now in the 
> tutorial that the file I am calling "mywebtool.py" they are referring to as 
> __init__.py

If you have mywebtool.py that is fine as just means you are packaging your 
application as a module rather than a package. Later on when need to split code 
across multiple files, better to use a package format. Because using Python 
2.7, must have the __init__.py in that package where as in Python 3 you don't 
need it.

Graham

>  
> 
> On Monday, October 29, 2018 at 5:08:44 PM UTC-7, Graham Dumpleton wrote:
> Is your mywebtool module/package under:
> 
> /var/www/FLASKAPPS
> 
> or:
> 
> /var/www/wsgi-scripts
> 
> Are the directories/files readable to the user that Apache runs as?
> 
> Is mod_wsgi compiled for Python 2.7 or 3.X?
> 
> If mywebtool is a package, does it have an __init__.py file in it.
> 
> Graham
> 
>> On 30 Oct 2018, at 11:05 am, wc ucdavis.edu 
>> > wrote:
>> 
>> Thank you both for your replies. I now have a better understanding of the 
>> wsgi framework and I am using the error log to my advantage. I was able to 
>> find an error in my httpd.conf - I was using Apache 2.2 syntax in my 
>> directives, now I've updated it with the "Require all granted" and I am 
>> getting the server to respond with the wsgi script, which I have named 
>> mywebtool.wsgi - the code for which I grabbed from a stack overflow post:
>> 
>> def application(environ, start_response):
>> status = '200 OK'
>> output = b'Hello World!\n'
>> response_headers = [('Content-type', 'text/plain'),
>> ('Content-Length', str(len(output)))]
>> start_response(status, response_headers)
>> return [output]
>> 
>> I decided to do this to verify the first 2/3 of the stack were working 
>> (Apache, mod_wsgi). 
>> 
>> My original wsgi script taken from the flask mod_wsgi docs 
>> (http://flask.pocoo.org/docs/1.0/deploying/mod_wsgi/ 
>> ) is simple:
>> 
>> import sys
>> 
>> sys.path.insert(0, '/var/www/FLASKAPPS')
>> 
>> from mywebtool import app as application
>> 
>> 
>> 
>> and points to the Hello World python app I was calling originally (again, 
>> got this basic python script from a tutorial at 
>> https://www.bogotobogo.com/python/Flask/Python_Flask_HelloWorld_App_with_Apache_WSGI_Ubuntu14.php
>>  
>> ):
>> 
>>  
>> $ cat mywebtool.py
>> from flask import Flask
>>  
>> app = Flask(__name__)
>>  
>> @app.route("/")
>> def hello():
>> return "Hello world!"
>>  
>> if __name__ == "__main__":
>> app.run()
>> 
>> But, this is failing. When I tailed the Apache error log, I saw:
>> 
>> [Mon Oct 29 15:53:08.108746 2018] [wsgi:error] [pid 20474] [client 
>> 185.26.34.125:53717 ] ImportError: No module 
>> named mywebtool
>> [Mon Oct 29 15:55:30.445940 2018] [wsgi:error] [pid 20476] [client 
>> 60.248.94.241:50359 ] mod_wsgi (pid=20476): 
>> Failed to exec Python script file '/var/www/wsgi-scripts/mywebtool.wsgi'.
>> [Mon Oct 29 15:55:30.446038 2018] [wsgi:error] [pid 20476] [client 
>> 60.248.94.241:50359 ] mod_wsgi (pid=20476): 
>> Exception occurred processing WSGI script 
>> '/var/www/wsgi-scripts/mywebtool.wsgi'.
>> [Mon Oct 29 15:55:30.446059 2018] [wsgi:error] [pid 20476] [client 
>> 60.248.94.241:50359 ] Traceback (most recent 
>> call last):
>> [Mon Oct 29 15:55:30.446084 2018] [wsgi:error] [pid 20476] [client 
>> 60.248.94.241:50359 ]   File 
>> "/var/www/wsgi-scripts/mywebtool.wsgi", line 1, in 
>> [Mon Oct 29 15:55:30.446150 2018] [wsgi:error] [pid 20476] [client 
>> 60.248.94.241:50359 ] from mywebtool import 
>> app as application
>> [Mon Oct 29 15:55:30.446173 2018] [wsgi:error] [pid 20476] [client 
>> 60.248.94.241:50359 ] ImportError: No module 
>> named mywebtool
>> 
>> Obviously, I named my python file "mywebtool.py" as I say in the wsgi 
>> script, which leads me to two potential conclusions - 1. I'm not properly 
>> referring to the .py in the wsgi script, or 2. my python script is not 
>> executing due to a problem with python, or  with the python 

Re: [modwsgi] Re: mod_wsgi problems on freeBSD

2018-10-29 Thread wc
Yes, my "mywebtool" is under 

/var/www/FLASKAPPS


I'm assuming that Apache is running as user www, though I should check that 
and check the permissions on the file. As I recall, I uploaded the files as 
root because I was unable to modify the directory /var/www as myself from 
my ftp prog.

I installed mod_wsgi with pip2.7 ... 

No... I don't have an __init__.py file, and I'm just seeing now in the 
tutorial that the file I am calling "mywebtool.py" they are referring to as 
__init__.py

 

On Monday, October 29, 2018 at 5:08:44 PM UTC-7, Graham Dumpleton wrote:
>
> Is your mywebtool module/package under:
>
> /var/www/FLASKAPPS
>
> or:
>
> /var/www/wsgi-scripts
>
> Are the directories/files readable to the user that Apache runs as?
>
> Is mod_wsgi compiled for Python 2.7 or 3.X?
>
> If mywebtool is a package, does it have an __init__.py file in it.
>
> Graham
>
> On 30 Oct 2018, at 11:05 am, wc > wrote:
>
> Thank you both for your replies. I now have a better understanding of the 
> wsgi framework and I am using the error log to my advantage. I was able to 
> find an error in my httpd.conf - I was using Apache 2.2 syntax in my 
> directives, now I've updated it with the "Require all granted" and I am 
> getting the server to respond with the wsgi script, which I have named 
> mywebtool.wsgi - the code for which I grabbed from a stack overflow post:
>
> def application(environ, start_response):
> status = '200 OK'
> output = b'Hello World!\n'
> response_headers = [('Content-type', 'text/plain'),
> ('Content-Length', str(len(output)))]
> start_response(status, response_headers)
> return [output]
>
>
> I decided to do this to verify the first 2/3 of the stack were working 
> (Apache, mod_wsgi). 
>
> My original wsgi script taken from the flask mod_wsgi docs (
> http://flask.pocoo.org/docs/1.0/deploying/mod_wsgi/) is simple:
>
> import sys
>
> sys.path.insert(0, '/var/www/FLASKAPPS')
>
> from mywebtool import app as application
>
>
>
>
> and points to the Hello World python app I was calling originally (again, 
> got this basic python script from a tutorial at 
> https://www.bogotobogo.com/python/Flask/Python_Flask_HelloWorld_App_with_Apache_WSGI_Ubuntu14.php
> ):
>
>
>  
>
> $ cat mywebtool.py
> from flask import Flask
>  
> app = Flask(__name__)
>  
> @app.route("/")
> def hello():
> return "Hello world!"
>  
> if __name__ == "__main__":
> app.run()
>
>
> But, this is failing. When I tailed the Apache error log, I saw:
>
> [Mon Oct 29 15:53:08.108746 2018] [wsgi:error] [pid 20474] [client 
> 185.26.34.125:53717] ImportError: No module named mywebtool
> [Mon Oct 29 15:55:30.445940 2018] [wsgi:error] [pid 20476] [client 
> 60.248.94.241:50359] mod_wsgi (pid=20476): Failed to exec Python script 
> file '/var/www/wsgi-scripts/mywebtool.wsgi'.
> [Mon Oct 29 15:55:30.446038 2018] [wsgi:error] [pid 20476] [client 
> 60.248.94.241:50359] mod_wsgi (pid=20476): Exception occurred processing 
> WSGI script '/var/www/wsgi-scripts/mywebtool.wsgi'.
> [Mon Oct 29 15:55:30.446059 2018] [wsgi:error] [pid 20476] [client 
> 60.248.94.241:50359] Traceback (most recent call last):
> [Mon Oct 29 15:55:30.446084 2018] [wsgi:error] [pid 20476] [client 
> 60.248.94.241:50359]   File "/var/www/wsgi-scripts/mywebtool.wsgi", line 
> 1, in 
> [Mon Oct 29 15:55:30.446150 2018] [wsgi:error] [pid 20476] [client 
> 60.248.94.241:50359] from mywebtool import app as application
> [Mon Oct 29 15:55:30.446173 2018] [wsgi:error] [pid 20476] [client 
> 60.248.94.241:50359] ImportError: No module named mywebtool
>
>
> Obviously, I named my python file "mywebtool.py" as I say in the wsgi 
> script, which leads me to two potential conclusions - 1. I'm not properly 
> referring to the .py in the wsgi script, or 2. my python script is not 
> executing due to a problem with python, or  with the python code itself.
>
> I'm optimistic I'm getting closer here...
>
>  
>
>  
>
>
> On Monday, October 29, 2018 at 4:00:21 PM UTC-7, Graham Dumpleton wrote:
>>
>> I'd agree on that except as noted.
>>
>> If the error message from the Apache error log is shown, along with 
>> configuration for your WSGI application in Apache config, as well as saying 
>> where your Python application code is located, that would help to give 
>> better idea of what is going on.
>>
>> On 30 Oct 2018, at 9:57 am, Peter Lai  wrote:
>>
>> 403 usually means that the directory to which you are hosting the .wsgi 
>> isn't configured with:
>>
>> 
>>
>>
>> Except that the argument is a directory path, not full path to WSGI 
>> script file.
>>
>> AllowOverride None
>> Require all granted
>> 
>>
>> This is required even though you have configured WSGIScriptAlias 
>> /web/path/to/app /path/to/your/app.wsgi
>>
>>
>> On Monday, October 29, 2018 at 6:52:29 PM UTC-4, wc wrote:
>>>
>>> Hello,
>>>
>>> My colleague would like to get a Python Flask app running on our new 
>>> sever. I've been scratching my head for several days and 

Re: [modwsgi] Re: mod_wsgi problems on freeBSD

2018-10-29 Thread Graham Dumpleton
Is your mywebtool module/package under:

/var/www/FLASKAPPS

or:

/var/www/wsgi-scripts

Are the directories/files readable to the user that Apache runs as?

Is mod_wsgi compiled for Python 2.7 or 3.X?

If mywebtool is a package, does it have an __init__.py file in it.

Graham

> On 30 Oct 2018, at 11:05 am, wc  wrote:
> 
> Thank you both for your replies. I now have a better understanding of the 
> wsgi framework and I am using the error log to my advantage. I was able to 
> find an error in my httpd.conf - I was using Apache 2.2 syntax in my 
> directives, now I've updated it with the "Require all granted" and I am 
> getting the server to respond with the wsgi script, which I have named 
> mywebtool.wsgi - the code for which I grabbed from a stack overflow post:
> 
> def application(environ, start_response):
> status = '200 OK'
> output = b'Hello World!\n'
> response_headers = [('Content-type', 'text/plain'),
> ('Content-Length', str(len(output)))]
> start_response(status, response_headers)
> return [output]
> 
> I decided to do this to verify the first 2/3 of the stack were working 
> (Apache, mod_wsgi). 
> 
> My original wsgi script taken from the flask mod_wsgi docs 
> (http://flask.pocoo.org/docs/1.0/deploying/mod_wsgi/ 
> ) is simple:
> 
> import sys
> 
> sys.path.insert(0, '/var/www/FLASKAPPS')
> 
> from mywebtool import app as application
> 
> 
> 
> and points to the Hello World python app I was calling originally (again, got 
> this basic python script from a tutorial at 
> https://www.bogotobogo.com/python/Flask/Python_Flask_HelloWorld_App_with_Apache_WSGI_Ubuntu14.php
>  
> ):
> 
>  
> $ cat mywebtool.py
> from flask import Flask
>  
> app = Flask(__name__)
>  
> @app.route("/")
> def hello():
> return "Hello world!"
>  
> if __name__ == "__main__":
> app.run()
> 
> But, this is failing. When I tailed the Apache error log, I saw:
> 
> [Mon Oct 29 15:53:08.108746 2018] [wsgi:error] [pid 20474] [client 
> 185.26.34.125:53717] ImportError: No module named mywebtool
> [Mon Oct 29 15:55:30.445940 2018] [wsgi:error] [pid 20476] [client 
> 60.248.94.241:50359] mod_wsgi (pid=20476): Failed to exec Python script file 
> '/var/www/wsgi-scripts/mywebtool.wsgi'.
> [Mon Oct 29 15:55:30.446038 2018] [wsgi:error] [pid 20476] [client 
> 60.248.94.241:50359] mod_wsgi (pid=20476): Exception occurred processing WSGI 
> script '/var/www/wsgi-scripts/mywebtool.wsgi'.
> [Mon Oct 29 15:55:30.446059 2018] [wsgi:error] [pid 20476] [client 
> 60.248.94.241:50359] Traceback (most recent call last):
> [Mon Oct 29 15:55:30.446084 2018] [wsgi:error] [pid 20476] [client 
> 60.248.94.241:50359]   File "/var/www/wsgi-scripts/mywebtool.wsgi", line 1, 
> in 
> [Mon Oct 29 15:55:30.446150 2018] [wsgi:error] [pid 20476] [client 
> 60.248.94.241:50359] from mywebtool import app as application
> [Mon Oct 29 15:55:30.446173 2018] [wsgi:error] [pid 20476] [client 
> 60.248.94.241:50359] ImportError: No module named mywebtool
> 
> Obviously, I named my python file "mywebtool.py" as I say in the wsgi script, 
> which leads me to two potential conclusions - 1. I'm not properly referring 
> to the .py in the wsgi script, or 2. my python script is not executing due to 
> a problem with python, or  with the python code itself.
> 
> I'm optimistic I'm getting closer here...
>  
>  
> 
> On Monday, October 29, 2018 at 4:00:21 PM UTC-7, Graham Dumpleton wrote:
> I'd agree on that except as noted.
> 
> If the error message from the Apache error log is shown, along with 
> configuration for your WSGI application in Apache config, as well as saying 
> where your Python application code is located, that would help to give better 
> idea of what is going on.
> 
>> On 30 Oct 2018, at 9:57 am, Peter Lai pw.utc.com 
>> > wrote:
>> 
>> 403 usually means that the directory to which you are hosting the .wsgi 
>> isn't configured with:
>> 
>> 
> 
> Except that the argument is a directory path, not full path to WSGI script 
> file.
> 
>> AllowOverride None
>> Require all granted
>> 
>> 
>> This is required even though you have configured WSGIScriptAlias 
>> /web/path/to/app /path/to/your/app.wsgi
>> 
>> 
>> On Monday, October 29, 2018 at 6:52:29 PM UTC-4, wc wrote:
>> Hello,
>> 
>> My colleague would like to get a Python Flask app running on our new sever. 
>> I've been scratching my head for several days and doing lots of googling to 
>> help me get just a simple hello world wsgi app to run on my FreeBSD 11.2 
>> server. I've followed some online tutorials to make a .py file, a .wsgi file 
>> and modify the http.conf file to add a virtual host.
>> 
>> When I navigate to our site, I get a 403 forbidden error.
>> 
>> I'm getting lost... but I've gone back to this checklist I found 
>> 

Re: [modwsgi] Re: mod_wsgi problems on freeBSD

2018-10-29 Thread wc
Thank you both for your replies. I now have a better understanding of the 
wsgi framework and I am using the error log to my advantage. I was able to 
find an error in my httpd.conf - I was using Apache 2.2 syntax in my 
directives, now I've updated it with the "Require all granted" and I am 
getting the server to respond with the wsgi script, which I have named 
mywebtool.wsgi - the code for which I grabbed from a stack overflow post:

def application(environ, start_response):
status = '200 OK'
output = b'Hello World!\n'
response_headers = [('Content-type', 'text/plain'),
('Content-Length', str(len(output)))]
start_response(status, response_headers)
return [output]


I decided to do this to verify the first 2/3 of the stack were working 
(Apache, mod_wsgi). 

My original wsgi script taken from the flask mod_wsgi docs 
(http://flask.pocoo.org/docs/1.0/deploying/mod_wsgi/) is simple:

import sys

sys.path.insert(0, '/var/www/FLASKAPPS')

from mywebtool import app as application




and points to the Hello World python app I was calling originally (again, 
got this basic python script from a tutorial at 
https://www.bogotobogo.com/python/Flask/Python_Flask_HelloWorld_App_with_Apache_WSGI_Ubuntu14.php):


 

$ cat mywebtool.py
from flask import Flask
 
app = Flask(__name__)
 
@app.route("/")
def hello():
return "Hello world!"
 
if __name__ == "__main__":
app.run()


But, this is failing. When I tailed the Apache error log, I saw:

[Mon Oct 29 15:53:08.108746 2018] [wsgi:error] [pid 20474] [client 
185.26.34.125:53717] ImportError: No module named mywebtool
[Mon Oct 29 15:55:30.445940 2018] [wsgi:error] [pid 20476] [client 
60.248.94.241:50359] mod_wsgi (pid=20476): Failed to exec Python script 
file '/var/www/wsgi-scripts/mywebtool.wsgi'.
[Mon Oct 29 15:55:30.446038 2018] [wsgi:error] [pid 20476] [client 
60.248.94.241:50359] mod_wsgi (pid=20476): Exception occurred processing 
WSGI script '/var/www/wsgi-scripts/mywebtool.wsgi'.
[Mon Oct 29 15:55:30.446059 2018] [wsgi:error] [pid 20476] [client 
60.248.94.241:50359] Traceback (most recent call last):
[Mon Oct 29 15:55:30.446084 2018] [wsgi:error] [pid 20476] [client 
60.248.94.241:50359]   File "/var/www/wsgi-scripts/mywebtool.wsgi", line 1, 
in 
[Mon Oct 29 15:55:30.446150 2018] [wsgi:error] [pid 20476] [client 
60.248.94.241:50359] from mywebtool import app as application
[Mon Oct 29 15:55:30.446173 2018] [wsgi:error] [pid 20476] [client 
60.248.94.241:50359] ImportError: No module named mywebtool


Obviously, I named my python file "mywebtool.py" as I say in the wsgi 
script, which leads me to two potential conclusions - 1. I'm not properly 
referring to the .py in the wsgi script, or 2. my python script is not 
executing due to a problem with python, or  with the python code itself.

I'm optimistic I'm getting closer here...

 

 


On Monday, October 29, 2018 at 4:00:21 PM UTC-7, Graham Dumpleton wrote:
>
> I'd agree on that except as noted.
>
> If the error message from the Apache error log is shown, along with 
> configuration for your WSGI application in Apache config, as well as saying 
> where your Python application code is located, that would help to give 
> better idea of what is going on.
>
> On 30 Oct 2018, at 9:57 am, Peter Lai > 
> wrote:
>
> 403 usually means that the directory to which you are hosting the .wsgi 
> isn't configured with:
>
> 
>
>
> Except that the argument is a directory path, not full path to WSGI script 
> file.
>
> AllowOverride None
> Require all granted
> 
>
> This is required even though you have configured WSGIScriptAlias 
> /web/path/to/app /path/to/your/app.wsgi
>
>
> On Monday, October 29, 2018 at 6:52:29 PM UTC-4, wc wrote:
>>
>> Hello,
>>
>> My colleague would like to get a Python Flask app running on our new 
>> sever. I've been scratching my head for several days and doing lots of 
>> googling to help me get just a simple hello world wsgi app to run on my 
>> FreeBSD 11.2 server. I've followed some online tutorials to make a .py 
>> file, a .wsgi file and modify the http.conf file to add a virtual host.
>>
>> When I navigate to our site, I get a 403 forbidden error.
>>
>> I'm getting lost... but I've gone back to this checklist I found (
>> https://modwsgi.readthedocs.io/en/develop/user-guides/checking-your-installation.html)
>>  
>> to see what I might be missing.
>>
>> I see that in Apache (version 2.4) the wsgi_module is installed when I 
>> run httpd -M
>>
>> but when I attempt ldd mod_wsgi.so I get the following:
>>
>> ldd: mod_wsgi.so: No such file or directory
>>
>> At this point, I think that Python and mod_wsgi are not linked, but I am 
>> unsure. I have two versions of Python installed, 2.7 and 3.6 and I 
>> installed and updated everything using pkg with the exception of the 
>> wsgi_module, which I installed using pip2.7.
>>
>> I'm not sure what I'm missing and if I should go back and try to 
>> uninstall, then reinstall everything from 

Re: [modwsgi] Re: mod_wsgi problems on freeBSD

2018-10-29 Thread Graham Dumpleton
I'd agree on that except as noted.

If the error message from the Apache error log is shown, along with 
configuration for your WSGI application in Apache config, as well as saying 
where your Python application code is located, that would help to give better 
idea of what is going on.

> On 30 Oct 2018, at 9:57 am, Peter Lai  wrote:
> 
> 403 usually means that the directory to which you are hosting the .wsgi isn't 
> configured with:
> 
> 

Except that the argument is a directory path, not full path to WSGI script file.

> AllowOverride None
> Require all granted
> 
> 
> This is required even though you have configured WSGIScriptAlias 
> /web/path/to/app /path/to/your/app.wsgi
> 
> 
> On Monday, October 29, 2018 at 6:52:29 PM UTC-4, wc wrote:
> Hello,
> 
> My colleague would like to get a Python Flask app running on our new sever. 
> I've been scratching my head for several days and doing lots of googling to 
> help me get just a simple hello world wsgi app to run on my FreeBSD 11.2 
> server. I've followed some online tutorials to make a .py file, a .wsgi file 
> and modify the http.conf file to add a virtual host.
> 
> When I navigate to our site, I get a 403 forbidden error.
> 
> I'm getting lost... but I've gone back to this checklist I found 
> (https://modwsgi.readthedocs.io/en/develop/user-guides/checking-your-installation.html
>  
> )
>  to see what I might be missing.
> 
> I see that in Apache (version 2.4) the wsgi_module is installed when I run 
> httpd -M
> 
> but when I attempt ldd mod_wsgi.so I get the following:
> 
> ldd: mod_wsgi.so: No such file or directory
> 
> At this point, I think that Python and mod_wsgi are not linked, but I am 
> unsure. I have two versions of Python installed, 2.7 and 3.6 and I installed 
> and updated everything using pkg with the exception of the wsgi_module, which 
> I installed using pip2.7.
> 
> I'm not sure what I'm missing and if I should go back and try to uninstall, 
> then reinstall everything from scratch, or if there's something simple I'm 
> missing. Anyone have a similar experience or any insight on this? Also, the 
> various tutorials I've read on deploying Dash/Flask/mod_wsgi apps seem to 
> vary in approach and can be somewhat vague on some of the steps. I'm not sure 
> which is the best for me. One area that's not super clear to me is whether 
> virtual host directives for Apache2.4 should be added directly to the 
> httpd.conf virtual hosts section, or if it should be in a separate virtual 
> hosts file.
> 
> Any help anyone could offer me would be greatly appreciated!!! Thanks!
> 
> 
> -- 
> 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 modwsgi+unsubscr...@googlegroups.com 
> .
> To post to this group, send email to modwsgi@googlegroups.com 
> .
> Visit this group at https://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 modwsgi+unsubscr...@googlegroups.com.
To post to this group, send email to modwsgi@googlegroups.com.
Visit this group at https://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.


[modwsgi] Re: mod_wsgi problems on freeBSD

2018-10-29 Thread Peter Lai
403 usually means that the directory to which you are hosting the .wsgi 
isn't configured with:


AllowOverride None
Require all granted


This is required even though you have configured WSGIScriptAlias 
/web/path/to/app /path/to/your/app.wsgi


On Monday, October 29, 2018 at 6:52:29 PM UTC-4, wc wrote:
>
> Hello,
>
> My colleague would like to get a Python Flask app running on our new 
> sever. I've been scratching my head for several days and doing lots of 
> googling to help me get just a simple hello world wsgi app to run on my 
> FreeBSD 11.2 server. I've followed some online tutorials to make a .py 
> file, a .wsgi file and modify the http.conf file to add a virtual host.
>
> When I navigate to our site, I get a 403 forbidden error.
>
> I'm getting lost... but I've gone back to this checklist I found (
> https://modwsgi.readthedocs.io/en/develop/user-guides/checking-your-installation.html)
>  
> to see what I might be missing.
>
> I see that in Apache (version 2.4) the wsgi_module is installed when I run 
> httpd -M
>
> but when I attempt ldd mod_wsgi.so I get the following:
>
> ldd: mod_wsgi.so: No such file or directory
>
> At this point, I think that Python and mod_wsgi are not linked, but I am 
> unsure. I have two versions of Python installed, 2.7 and 3.6 and I 
> installed and updated everything using pkg with the exception of the 
> wsgi_module, which I installed using pip2.7.
>
> I'm not sure what I'm missing and if I should go back and try to 
> uninstall, then reinstall everything from scratch, or if there's something 
> simple I'm missing. Anyone have a similar experience or any insight on 
> this? Also, the various tutorials I've read on deploying 
> Dash/Flask/mod_wsgi apps seem to vary in approach and can be somewhat vague 
> on some of the steps. I'm not sure which is the best for me. One area 
> that's not super clear to me is whether virtual host directives for 
> Apache2.4 should be added directly to the httpd.conf virtual hosts section, 
> or if it should be in a separate virtual hosts file.
>
> Any help anyone could offer me would be greatly appreciated!!! Thanks!
>
>

-- 
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 modwsgi+unsubscr...@googlegroups.com.
To post to this group, send email to modwsgi@googlegroups.com.
Visit this group at https://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.


[modwsgi] Re: [mod_wsgi] Error during make: /bin/sh: 1: apxs: not found

2018-06-04 Thread Jacco van Dorp
Thank you very much. I knew it'd have to be something conceptually simple. 
I managed to resolve it by installing apache2-prefork-dev (took two 
attempts). Still got some other errors, but I dont think any of those have 
anything to do with mod_wsgi.

Op maandag 4 juni 2018 12:10:21 UTC+2 schreef Jacco van Dorp:
>
> Hello everyone,
>
> I got the tarball from 
> https://github.com/GrahamDumpleton/mod_wsgi/releases, wsgi 4.6.4.
>
> At this step: 
> https://modwsgi.readthedocs.io/en/develop/user-guides/quick-installation-guide.html#building-the-source-code
>
> I get an error message not covered in the linked Installation issues:
>
> [Entire output running make]
> apxs -c -I/home/deonet/miniconda3/include/python3.6m -DNDEBUG  -Wc,-g 
> -Wc,-O2  src/server/mod_wsgi.c src/server/wsgi_*.c 
> -L/home/deonet/miniconda3/lib 
> -L/home/deonet/miniconda3/lib/python3.6/config-3.6m  -lpython3.6m -lpthread 
> -ldl -lutil -lrt -lm
> /bin/sh: 1: apxs: not found
> make: *** [src/server/mod_wsgi.la] Error 127
>
> This is remniscent of the error here: 
> https://modwsgi.readthedocs.io/en/develop/user-guides/installation-issues.html#mixing-32-bit-and-64-bit-packages
>  
> , but doesn't look the same to me. 
>
> It looks like the apxs command is not available, instead of that one about 
> it failing.
>
> I'm attempting to add a python website in addition to a normal php one. 
> Under the same apache. afaik, that shouldn't interfere with installation. 
> Apache is running while im installing everything. 
>
> I'd like to add that i'm new to both apache, linux, and apache-like 
> programs in general. Therefore, if there's a possible solution that's "so 
> obvious it's not worth mentioning", please mention it. I'm probably looking 
> for it.
>
> Boring system information:
> Attempting to use wsgi 4.6.4
> using python 3.6.5 (using: 
> --with-python=/home/deonet/miniconda3/bin/python3 )
>   - Running that path directly gets me into the interpreter as expected
> Apache -V:   Server version: Apache/2.2.22 (Ubuntu)
> system uname -a:  Linux DEOPRICE 3.5.0-54-generic #81~precise1-Ubuntu SMP 
> Tue Jul 15 04:05:58 UTC 2014 i686 i686 i386 GNU/Linux
>
> Thank you for your attention in advance.
>

-- 
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 modwsgi+unsubscr...@googlegroups.com.
To post to this group, send email to modwsgi@googlegroups.com.
Visit this group at https://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.


[modwsgi] Re: mod_wsgi issues when using anaconda3 and httpd

2016-12-05 Thread ram . usa9293
Thank you for an immediate response. It works for me. Now mod_wsgi is 
loaded onto the server and I can access Apache server page through 
localhost.

But when I have placed myapp.conf file. I could not access the page and the 
error_log says* avahi_entry_group_add_service_strlst failed invalid 
hostname*

 Is there anything I need to do?

Thanks,
Ram

On Monday, December 5, 2016 at 1:49:35 PM UTC-6, ram.u...@gmail.com wrote:
>
> Hi All,
>
> I am using Redhat scientific Linux 6.7. OS has python2.6 already 
> installed.  I have downloaded anaconda3.sh file from anaconda3.org and 
> installed it. Then I have downloaded the mod_wsgi tar.gz file, unzipped it 
> and used the commands.
>
> ./configure --with-apxs=/usr/bin/python 
> --with-python=/home/vmuser/anaconda3/bin/pytthon3.5
> make 
> make install
>
> Everything goes well here and the mod_wsgi.so files is also stored in 
> ./etc/httpd/modules/mod_wsgi.so
>
> Then, if I run ldd /etc/httpd/modules/mod_wsgi.so   I get the below output
>
> linux-vdso.so.1 =>  (0x7ffda809f000)
> libpython3.5m.so.1.0 => /lib64/libpython3.5m.so.1.0 (0x7f4c4813a000)
> libpthread.so.0 => /lib64/libpthread.so.0 (0x7f4c47f1e000)
> libdl.so.2 => /lib64/libdl.so.2 (0x7f4c47d19000)
> libutil.so.1 => /lib64/libutil.so.1 (0x7f4c47b16000)
> librt.so.1 => /lib64/librt.so.1 (0x7f4c4790e000)
> libm.so.6 => /lib64/libm.so.6 (0x7f4c4760b000)
> libc.so.6 => /lib64/libc.so.6 (0x7f4c47249000)
> /lib64/ld-linux-x86-64.so.2 (0x7f4c4887e000)
>
> I also created a folder symlink python3.5 in /usr/local/lib to point to 
> the anaconda3 python library
>
> When I have run service httpd start  I get the below error
>
> cannot load /etc/httpd/modules/mod_wsgi.so into server: 
> libpython3.5m.so.1.0: cannot open shared object file: Permission denied.
>
> Can anyone help on this? I read many blogs but still couldnt resolve this. 
>
> mod_wsgi express start-server is starting up correctly but  httpd is not 
> starting.. can anyone tell me the difference and also some debug options?
>
> it s been 5 days I have struck on this issue. Help is highly appreciated. 
>
> Thank you.
>

-- 
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 modwsgi+unsubscr...@googlegroups.com.
To post to this group, send email to modwsgi@googlegroups.com.
Visit this group at https://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.


[modwsgi] Re: mod_wsgi issues when using anaconda3 and httpd

2016-12-05 Thread ram . usa9293
Thank you for your immediate response. I will work on the installation 
again and will get back to you. 

On Monday, December 5, 2016 at 1:49:35 PM UTC-6, ram.u...@gmail.com wrote:
>
> Hi All,
>
> I am using Redhat scientific Linux 6.7. OS has python2.6 already 
> installed.  I have downloaded anaconda3.sh file from anaconda3.org and 
> installed it. Then I have downloaded the mod_wsgi tar.gz file, unzipped it 
> and used the commands.
>
> ./configure --with-apxs=/usr/bin/python 
> --with-python=/home/vmuser/anaconda3/bin/pytthon3.5
> make 
> make install
>
> Everything goes well here and the mod_wsgi.so files is also stored in 
> ./etc/httpd/modules/mod_wsgi.so
>
> Then, if I run ldd /etc/httpd/modules/mod_wsgi.so   I get the below output
>
> linux-vdso.so.1 =>  (0x7ffda809f000)
> libpython3.5m.so.1.0 => /lib64/libpython3.5m.so.1.0 (0x7f4c4813a000)
> libpthread.so.0 => /lib64/libpthread.so.0 (0x7f4c47f1e000)
> libdl.so.2 => /lib64/libdl.so.2 (0x7f4c47d19000)
> libutil.so.1 => /lib64/libutil.so.1 (0x7f4c47b16000)
> librt.so.1 => /lib64/librt.so.1 (0x7f4c4790e000)
> libm.so.6 => /lib64/libm.so.6 (0x7f4c4760b000)
> libc.so.6 => /lib64/libc.so.6 (0x7f4c47249000)
> /lib64/ld-linux-x86-64.so.2 (0x7f4c4887e000)
>
> I also created a folder symlink python3.5 in /usr/local/lib to point to 
> the anaconda3 python library
>
> When I have run service httpd start  I get the below error
>
> cannot load /etc/httpd/modules/mod_wsgi.so into server: 
> libpython3.5m.so.1.0: cannot open shared object file: Permission denied.
>
> Can anyone help on this? I read many blogs but still couldnt resolve this. 
>
> mod_wsgi express start-server is starting up correctly but  httpd is not 
> starting.. can anyone tell me the difference and also some debug options?
>
> it s been 5 days I have struck on this issue. Help is highly appreciated. 
>
> Thank you.
>

-- 
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 modwsgi+unsubscr...@googlegroups.com.
To post to this group, send email to modwsgi@googlegroups.com.
Visit this group at https://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.


Re: [modwsgi] Re: mod_wsgi importError

2016-08-21 Thread Graham Dumpleton
And does /var/www/flask_stuff_files/templates/analysis exist? Does it have to 
be a directory or a file? For uploads those directories will need to be 
writable to Apache user.

> On 22 Aug 2016, at 8:52 AM, Tierprot B.  wrote:
> 
> Hmm and now im more confused, i copied server files from 
> /home/user/flask_stuff_files to the new directory /var/www/flask_stuff_files 
> and corrected Apache conf, now it looks like:
> 
> apache-wsgi config:
> 
> 
>   ServerName www.example.com  
>   DocumentRoot /var/www/flask_stuff_files/templates
>   WSGIDaemonProcess home=/var/www/wsgi-scripts 
> python-path=/var/www/flask_stuff_files user=user group=user
>   WSGIScriptAlias /test /var/www/wsgi-scripts/simple_app.wsgi 
> process-group=app application-group=%{GLOBAL}
>   
>   
>   Require all granted
>   
> 
>  
>  
> Still main page www.example.com/test  renders 
> ok, but on files submission i get error File does not exist: 
> /var/www/flask_stuff_files/templates/analysis, referer: 
> http://www.example.com/test 
> 
> 
> 2016-08-22 1:28 GMT+03:00 Graham Dumpleton  >:
> 
>> On 22 Aug 2016, at 8:16 AM, Tierprot B. > > wrote:
>> 
>> Aha! Thanks! Addition of proper user and group options to WSGIDaemonProcess 
>> solved the ImportError! The last question i have might be not related to 
>> mod_wsgi directly, but still.
>> I have a Flask app, purpose of which to be able to upload files provided by 
>> user, do some math and return result on a new page. Simplified code looks 
>> like this:
>> 
>> ... 
>> 
>> @app.route('/'):
>> def index()
>>  return render_template('index.html')
>> 
>> @app.route('/analysis', methods=['POST'])
>> def upload():
>>  uploaded_files = request.files.getlist('files')
>>  ...
>>  for file in uploaded_files:
>>...
>>  return render_template('analysis.html')
>> 
>> ...
>> 
>> The folder with static files which Flask renders is:
>> 
>> home/user/flask_stuff_files/templates
>> 
>> 
>> in Apache ive corrected document root folder and added directory with static 
>> files:
>> 
>> apache-wsgi config:
>> 
>> 
>>   ServerName www.example.com  
>>   DocumentRoot /home/user/flask_stuff_files/templates
> 
> What are you trying to have happen by adding this?
> 
> The Apache user would need access to that directory and once agains the 
> permissions on the directories are such that that can’t happen. Changing user 
> for mod_wsgi daemon process group only affects access to Python code, not 
> static files Apache tries to serve up.
> 
> In general this is why is better not to have anything for your application 
> under your home directory. Better under separate directory for project under 
> /var/www.
> 
>>   WSGIDaemonProcess home=/var/www/wsgi-scripts 
>> python-path=/home/user/flask_stuff_files user=user group=user
>>   WSGIScriptAlias /test /var/www/wsgi-scripts/simple_app.wsgi 
>> process-group=app application-group=%{GLOBAL}
>>   
>>   
>>   Require all granted
>>   
>> 
>>   
>>   WSGIProcessGroup app
>>   WSGIApplicationGroup %{GLOBAL}
>>   Require all granted
>>   
> 
> May not need this entry for /home/user/flask_stuff_files.
> 
>>   
>>   WSGIProcessGroup app
>>   WSGIApplicationGroup %{GLOBAL}
>>   Require all granted
>>   
> 
> May not need this entry for /home/user/flask_stuff_files/templates. Depends 
> on answer about DocumentRoot.
> 
> The Directory block and access grants is only needed for where the WSGI 
> script file is located.
> 
> The WSGIScriptAlias already specifies process-group and application-group so 
> the WSGIProcessGroup and WSGIApplicationGroup not needed either.
> 
>>  
>> 
>> So, www.example.com/test  - it renders main 
>> page as intended, but when i select files and submit them via POST request 
>> ive got a forbidden access with error_log : Permission denied [...] : acces 
>> to /analysis denied (filesystempath '/home/user/flask_stuff_files') because 
>> search permissions are missing on a component of the path, referer: 
>> www.example.com/test .
>> 
>> For the test, i set permissions of the folder /home/user/flask_stuff_files 
>> to the drwxrwxrwx, it belongs to user user.
>> 
>> So, could you share your thoughts on what is wrong here?
> 
> Graham
> 
>> 2016-08-21 23:28 GMT+03:00 Graham Dumpleton > >:
>> Your code will be running as the Apache user. Your home directory would have 
>> restrictive permissions on it such that not everyone can access files out of 
>> it.
>> 
>> The quickest solution 

Re: [modwsgi] Re: mod_wsgi importError

2016-08-21 Thread Tierprot B.
Hmm and now im more confused, i copied server files from
/home/user/flask_stuff_files
to the new directory /var/www/flask_stuff_files and corrected Apache conf,
now it looks like:

apache-wsgi config:


  ServerName www.example.com
  DocumentRoot /var/www/flask_stuff_files/templates
  WSGIDaemonProcess home=/var/www/wsgi-scripts python-path=/var/www
/flask_stuff_files user=user group=user
  WSGIScriptAlias /test /var/www/wsgi-scripts/simple_app.wsgi
process-group=app application-group=%{GLOBAL}

  
  Require all granted
  

 

Still main page www.example.com/test renders ok, but on files submission i
get error File does not exist: /var/www/flask_stuff_files/templates/analysis,
referer: http://www.example.com/test


2016-08-22 1:28 GMT+03:00 Graham Dumpleton :

>
> On 22 Aug 2016, at 8:16 AM, Tierprot B.  wrote:
>
> Aha! Thanks! Addition of proper user and group options to
> WSGIDaemonProcess solved the ImportError! The last question i have might
> be not related to mod_wsgi directly, but still.
> I have a Flask app, purpose of which to be able to upload files provided
> by user, do some math and return result on a new page. Simplified code
> looks like this:
>
> ...
>
> @app.route('/'):
> def index()
>  return render_template('index.html')
>
> @app.route('/analysis', methods=['POST'])
> def upload():
>  uploaded_files = request.files.getlist('files')
>  ...
>  for file in uploaded_files:
>...
>  return render_template('analysis.html')
>
> ...
>
> The folder with static files which Flask renders is:
>
> home/user/flask_stuff_files/templates
>
>
> in Apache ive corrected document root folder and added directory with
> static files:
>
> apache-wsgi config:
> 
> 
>   ServerName www.example.com
>   DocumentRoot /home/user/flask_stuff_files/templates
>
>
> What are you trying to have happen by adding this?
>
> The Apache user would need access to that directory and once agains the
> permissions on the directories are such that that can’t happen. Changing
> user for mod_wsgi daemon process group only affects access to Python code,
> not static files Apache tries to serve up.
>
> In general this is why is better not to have anything for your application
> under your home directory. Better under separate directory for project
> under /var/www.
>
>   WSGIDaemonProcess home=/var/www/wsgi-scripts python-path=
> /home/user/flask_stuff_files user=user group=user
>   WSGIScriptAlias /test /var/www/wsgi-scripts/simple_app.wsgi
> process-group=app application-group=%{GLOBAL}
>
>   
>   Require all granted
>   
>
>   
>   WSGIProcessGroup app
>   WSGIApplicationGroup %{GLOBAL}
>   Require all granted
>   
>
>
> May not need this entry for /home/user/flask_stuff_files.
>
>   
>   WSGIProcessGroup app
>   WSGIApplicationGroup %{GLOBAL}
>   Require all granted
>   
>
>
> May not need this entry for /home/user/flask_stuff_files/templates.
> Depends on answer about DocumentRoot.
>
> The Directory block and access grants is only needed for where the WSGI
> script file is located.
>
> The WSGIScriptAlias already specifies process-group and application-group
> so the WSGIProcessGroup and WSGIApplicationGroup not needed either.
>
>  
>
> So, www.example.com/test - it renders main page as intended, but when i
> select files and submit them via POST request ive got a forbidden access
> with error_log : Permission denied [...] : acces to /analysis denied
> (filesystempath '/home/user/flask_stuff_files') because search
> permissions are missing on a component of the path, referer:
> www.example.com/test.
>
> For the test, i set permissions of the folder /home/user/flask_stuff_files
> to the drwxrwxrwx, it belongs to user user.
>
> So, could you share your thoughts on what is wrong here?
>
>
> Graham
>
> 2016-08-21 23:28 GMT+03:00 Graham Dumpleton :
>
>> Your code will be running as the Apache user. Your home directory would
>> have restrictive permissions on it such that not everyone can access files
>> out of it.
>>
>> The quickest solution would be to set the process/group that the mod_wsgi
>> daemon process runs as.
>>
>> WSGIDaemonProcess home=/var/www/wsgi-scripts
>> python-path=/home/user/flask_stuff_files user=xxx group=yyy
>>
>> Replace xxx with your user name and yyy with the group name, likely same
>> as xxx.
>>
>> Thi presumes the issue isn’t as simple as you having left off the leading
>> slash on the path to the python-path option as your snippet showed.
>>
>> Graham
>>
>> On 21 Aug 2016, at 11:41 PM, Tierprot B.  wrote:
>>
>>
>>> That is what WSGIScriptAlias is doing in giving it the path to the WSGI
>>> script file. If you mean something different you need to be clearer.
>>>
>>> b) that it should include python 

Re: [modwsgi] Re: mod_wsgi importError

2016-08-21 Thread Graham Dumpleton

> On 22 Aug 2016, at 8:16 AM, Tierprot B.  wrote:
> 
> Aha! Thanks! Addition of proper user and group options to WSGIDaemonProcess 
> solved the ImportError! The last question i have might be not related to 
> mod_wsgi directly, but still.
> I have a Flask app, purpose of which to be able to upload files provided by 
> user, do some math and return result on a new page. Simplified code looks 
> like this:
> 
> ... 
> 
> @app.route('/'):
> def index()
>  return render_template('index.html')
> 
> @app.route('/analysis', methods=['POST'])
> def upload():
>  uploaded_files = request.files.getlist('files')
>  ...
>  for file in uploaded_files:
>...
>  return render_template('analysis.html')
> 
> ...
> 
> The folder with static files which Flask renders is:
> 
> home/user/flask_stuff_files/templates
> 
> 
> in Apache ive corrected document root folder and added directory with static 
> files:
> 
> apache-wsgi config:
> 
> 
>   ServerName www.example.com  
>   DocumentRoot /home/user/flask_stuff_files/templates

What are you trying to have happen by adding this?

The Apache user would need access to that directory and once agains the 
permissions on the directories are such that that can’t happen. Changing user 
for mod_wsgi daemon process group only affects access to Python code, not 
static files Apache tries to serve up.

In general this is why is better not to have anything for your application 
under your home directory. Better under separate directory for project under 
/var/www.

>   WSGIDaemonProcess home=/var/www/wsgi-scripts 
> python-path=/home/user/flask_stuff_files user=user group=user
>   WSGIScriptAlias /test /var/www/wsgi-scripts/simple_app.wsgi 
> process-group=app application-group=%{GLOBAL}
>   
>   
>   Require all granted
>   
> 
>   
>   WSGIProcessGroup app
>   WSGIApplicationGroup %{GLOBAL}
>   Require all granted
>   

May not need this entry for /home/user/flask_stuff_files.

>   
>   WSGIProcessGroup app
>   WSGIApplicationGroup %{GLOBAL}
>   Require all granted
>   

May not need this entry for /home/user/flask_stuff_files/templates. Depends on 
answer about DocumentRoot.

The Directory block and access grants is only needed for where the WSGI script 
file is located.

The WSGIScriptAlias already specifies process-group and application-group so 
the WSGIProcessGroup and WSGIApplicationGroup not needed either.

>  
> 
> So, www.example.com/test  - it renders main page 
> as intended, but when i select files and submit them via POST request ive got 
> a forbidden access with error_log : Permission denied [...] : acces to 
> /analysis denied (filesystempath '/home/user/flask_stuff_files') because 
> search permissions are missing on a component of the path, referer: 
> www.example.com/test .
> 
> For the test, i set permissions of the folder /home/user/flask_stuff_files to 
> the drwxrwxrwx, it belongs to user user.
> 
> So, could you share your thoughts on what is wrong here?

Graham

> 2016-08-21 23:28 GMT+03:00 Graham Dumpleton  >:
> Your code will be running as the Apache user. Your home directory would have 
> restrictive permissions on it such that not everyone can access files out of 
> it.
> 
> The quickest solution would be to set the process/group that the mod_wsgi 
> daemon process runs as.
> 
> WSGIDaemonProcess home=/var/www/wsgi-scripts 
> python-path=/home/user/flask_stuff_files user=xxx group=yyy
> 
> Replace xxx with your user name and yyy with the group name, likely same as 
> xxx.
> 
> Thi presumes the issue isn’t as simple as you having left off the leading 
> slash on the path to the python-path option as your snippet showed.
> 
> Graham
> 
>> On 21 Aug 2016, at 11:41 PM, Tierprot B. > > wrote:
>> 
>> 
>> That is what WSGIScriptAlias is doing in giving it the path to the WSGI 
>> script file. If you mean something different you need to be clearer.
>> 
>>> b) that it should include python files from outside directory, for example 
>>> home/user/flask_stuff_files ?
>> 
>> If you are talking about other places to look for Python modules to import, 
>> that is what the python-path option for WSGIDaemonProcess that I mentioned 
>> is for.
>> 
>> Graham
>> 
>> 
>> Ok, ive got python modules which i try to import located at 
>> home/user/flask_stuff_files, mine wsgi file is in /var/www/wsgi-scripts, now 
>> to the code:
>> 
>> apache-wsgi config:
>> 
>> 
>>   ServerName www.example.com  
>>   DocumentRoot /var/www/html
>> 
>>   WSGIDaemonProcess home=/var/www/wsgi-scripts 
>> python-path=home/user/flask_stuff_files
>>   

Re: [modwsgi] Re: mod_wsgi importError

2016-08-21 Thread Tierprot B.
Aha! Thanks! Addition of proper user and group options to WSGIDaemonProcess
solved the ImportError! The last question i have might be not related to
mod_wsgi directly, but still.
I have a Flask app, purpose of which to be able to upload files provided by
user, do some math and return result on a new page. Simplified code looks
like this:

...

@app.route('/'):
def index()
 return render_template('index.html')

@app.route('/analysis', methods=['POST'])
def upload():
 uploaded_files = request.files.getlist('files')
 ...
 for file in uploaded_files:
   ...
 return render_template('analysis.html')

...

The folder with static files which Flask renders is:

home/user/flask_stuff_files/templates


in Apache ive corrected document root folder and added directory with
static files:

apache-wsgi config:


  ServerName www.example.com
  DocumentRoot /home/user/flask_stuff_files/templates
  WSGIDaemonProcess home=/var/www/wsgi-scripts python-path=
/home/user/flask_stuff_files user=user group=user
  WSGIScriptAlias /test /var/www/wsgi-scripts/simple_app.wsgi
process-group=app application-group=%{GLOBAL}

  
  Require all granted
  

  
  WSGIProcessGroup app
  WSGIApplicationGroup %{GLOBAL}
  Require all granted
  

  
  WSGIProcessGroup app
  WSGIApplicationGroup %{GLOBAL}
  Require all granted
  

 

So, www.example.com/test - it renders main page as intended, but when i
select files and submit them via POST request ive got a forbidden access
with error_log : Permission denied [...] : acces to /analysis denied
(filesystempath '/home/user/flask_stuff_files') because search permissions
are missing on a component of the path, referer: www.example.com/test.

For the test, i set permissions of the folder /home/user/flask_stuff_files
to the drwxrwxrwx, it belongs to user user.

So, could you share your thoughts on what is wrong here?

2016-08-21 23:28 GMT+03:00 Graham Dumpleton :

> Your code will be running as the Apache user. Your home directory would
> have restrictive permissions on it such that not everyone can access files
> out of it.
>
> The quickest solution would be to set the process/group that the mod_wsgi
> daemon process runs as.
>
> WSGIDaemonProcess home=/var/www/wsgi-scripts
> python-path=/home/user/flask_stuff_files user=xxx group=yyy
>
> Replace xxx with your user name and yyy with the group name, likely same
> as xxx.
>
> Thi presumes the issue isn’t as simple as you having left off the leading
> slash on the path to the python-path option as your snippet showed.
>
> Graham
>
> On 21 Aug 2016, at 11:41 PM, Tierprot B.  wrote:
>
>
>> That is what WSGIScriptAlias is doing in giving it the path to the WSGI
>> script file. If you mean something different you need to be clearer.
>>
>> b) that it should include python files from outside directory, for
>> example home/user/flask_stuff_files ?
>>
>>
>> If you are talking about other places to look for Python modules to
>> import, that is what the python-path option for WSGIDaemonProcess that I
>> mentioned is for.
>>
>> Graham
>>
>>
> Ok, ive got python modules which i try to import located at 
> home/user/flask_stuff_files,
> mine wsgi file is in /var/www/wsgi-scripts, now to the code:
>
> apache-wsgi config:
> 
> 
>   ServerName www.example.com
>   DocumentRoot /var/www/html
>
>   WSGIDaemonProcess home=/var/www/wsgi-scripts python-path=
> home/user/flask_stuff_files
>   WSGIScriptAlias /test /var/www/wsgi-scripts/simple_app.wsgi
>
>   
>   Require all granted
>   
>  
> -
>
> simple_app.wsgi:
> --
> import server_handle
>
> def application(environ, start_response):
> status = '200 OK'
> output = b'Hello, World!'
>
> response_headers = [('Content-type', 'text/plain'),
> ('Content-Length', str(len(output)))]
> start_response(status, response_headers)
> return [output]
>
> 
>
> server_handle.py module is located at /home/user/flask_stuff_files
>
> on trying www.example.com/test Apache spits with error ImportError: no
> module named 'server_handle'
>
> adding of code like:
>
> import sys
> sys.path.insert(0,'/home/user/flask_stuff_files')
>
> dont solve the problem too (do you know why, btw?)
>
> Theres something i didn`t properly understood, so sorry for annoying and
> dumb questions :)
>
> --
> 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 modwsgi+unsubscr...@googlegroups.com.
> To post to this group, send email to modwsgi@googlegroups.com.
> Visit this group at https://groups.google.com/group/modwsgi.
> For more options, visit 

Re: [modwsgi] Re: mod_wsgi importError

2016-08-21 Thread Tierprot B.

>
>
> That is what WSGIScriptAlias is doing in giving it the path to the WSGI 
> script file. If you mean something different you need to be clearer.
>
> b) that it should include python files from outside directory, for example 
> home/user/flask_stuff_files ?
>
>
> If you are talking about other places to look for Python modules to 
> import, that is what the python-path option for WSGIDaemonProcess that I 
> mentioned is for.
>
> Graham
>
>
Ok, ive got python modules which i try to import located at 
home/user/flask_stuff_files, 
mine wsgi file is in /var/www/wsgi-scripts, now to the code:

apache-wsgi config:


  ServerName www.example.com 
  DocumentRoot /var/www/html

  WSGIDaemonProcess home=/var/www/wsgi-scripts python-path=
home/user/flask_stuff_files
  WSGIScriptAlias /test /var/www/wsgi-scripts/simple_app.wsgi
  
  
  Require all granted
  
 
-

simple_app.wsgi:
--
import server_handle

def application(environ, start_response):
status = '200 OK'
output = b'Hello, World!'

response_headers = [('Content-type', 'text/plain'),
('Content-Length', str(len(output)))]
start_response(status, response_headers)
return [output]



server_handle.py module is located at /home/user/flask_stuff_files

on trying www.example.com/test Apache spits with error ImportError: no 
module named 'server_handle'  

adding of code like:

import sys
sys.path.insert(0,'/home/user/flask_stuff_files')

dont solve the problem too (do you know why, btw?)

Theres something i didn`t properly understood, so sorry for annoying and 
dumb questions :)

-- 
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 modwsgi+unsubscr...@googlegroups.com.
To post to this group, send email to modwsgi@googlegroups.com.
Visit this group at https://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.


Re: [modwsgi] Re: mod_wsgi importError

2016-08-21 Thread Graham Dumpleton

> On 21 Aug 2016, at 8:35 PM, Tierprot B.  wrote:
> 
> Thanks for the fast reply! I did what you`ve wrote and yay it worked! Now i 
> wondering how can i tell to mod_wsgi two things - a) that wsgi file itself 
> lies in /var/www/wsgi-scripts and

That is what WSGIScriptAlias is doing in giving it the path to the WSGI script 
file. If you mean something different you need to be clearer.

> b) that it should include python files from outside directory, for example 
> home/user/flask_stuff_files ?

If you are talking about other places to look for Python modules to import, 
that is what the python-path option for WSGIDaemonProcess that I mentioned is 
for.

Graham

-- 
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 modwsgi+unsubscr...@googlegroups.com.
To post to this group, send email to modwsgi@googlegroups.com.
Visit this group at https://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.


[modwsgi] Re: mod_wsgi importError

2016-08-21 Thread Tierprot B.
Thanks for the fast reply! I did what you`ve wrote and yay it worked! Now i 
wondering how can i tell to mod_wsgi two things - a) that wsgi file itself 
lies in /var/www/wsgi-scripts and b) that it should include python files 
from outside directory, for example home/user/flask_stuff_files ?

-- 
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 modwsgi+unsubscr...@googlegroups.com.
To post to this group, send email to modwsgi@googlegroups.com.
Visit this group at https://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.


Re: [modwsgi] Re: mod_wsgi (3.4-14) / Apache 2.4.12 / cx_oracle 5.2 / Oracle 12 / Red Hat (6.7) / Django 1.8.2 hanging under load

2015-10-10 Thread Graham Dumpleton
Can you provide the traces for all threads?

Graham

> On 9 Oct 2015, at 12:36 am, 'Lukasz Szajkowski' via modwsgi 
>  wrote:
> 
> Thanks a lot Graham for advice
> 
> I tried the settings
> WSGIScriptAlias / /opt/hosts/pyws.test/pyws/pyws/wsgi.py 
> process-group=pyws.st application-group=%{GLOBAL}
> WSGIImportScript /opt/hosts/pyws.test/pyws/pyws/wsgi_monitor.py 
> process-group=pyws.st application-group=%{GLOBAL}
> 
> but I still got the error. Bellow is the stack
> I can now reproduce the problem on all our environments (5). They all use the 
> same technology stack.
> 
> [Thu Oct 08 14:18:25.997539 2015] [:error] [pid 1827] django.setup()
> [Thu Oct 08 14:18:25.997546 2015] [:error] [pid 1827]   File 
> "/opt/python_envs/pyws/lib/python3.3/site-packages/django/__init__.py", line 
> 17, in setup
> [Thu Oct 08 14:18:25.997553 2015] [:error] [pid 1827] 
> configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
> [Thu Oct 08 14:18:25.997560 2015] [:error] [pid 1827]   File 
> "/opt/python_envs/pyws/lib/python3.3/site-packages/django/utils/log.py", line 
> 86, in configure_logging
> [Thu Oct 08 14:18:25.997567 2015] [:error] [pid 1827] 
> logging_config_func(logging_settings)
> [Thu Oct 08 14:18:25.997574 2015] [:error] [pid 1827]   File 
> "/opt/rh/python33/root/usr/lib64/python3.3/logging/config.py", line 795, in 
> dictConfig
> [Thu Oct 08 14:18:25.997581 2015] [:error] [pid 1827] 
> dictConfigClass(config).configure()
> [Thu Oct 08 14:18:25.997588 2015] [:error] [pid 1827]   File 
> "/opt/rh/python33/root/usr/lib64/python3.3/logging/config.py", line 555, in 
> configure
> [Thu Oct 08 14:18:25.997595 2015] [:error] [pid 1827] filters[name] = 
> self.configure_filter(filters[name])
> [Thu Oct 08 14:18:25.997601 2015] [:error] [pid 1827]   File 
> "/opt/rh/python33/root/usr/lib64/python3.3/logging/config.py", line 679, in 
> configure_filter
> [Thu Oct 08 14:18:25.997609 2015] [:error] [pid 1827] result = 
> self.configure_custom(config)
> [Thu Oct 08 14:18:25.997615 2015] [:error] [pid 1827]   File 
> "/opt/rh/python33/root/usr/lib64/python3.3/logging/config.py", line 472, in 
> configure_custom
> [Thu Oct 08 14:18:25.997622 2015] [:error] [pid 1827] c = self.resolve(c)
> [Thu Oct 08 14:18:25.997629 2015] [:error] [pid 1827]   File 
> "/opt/rh/python33/root/usr/lib64/python3.3/logging/config.py", line 387, in 
> resolve
> [Thu Oct 08 14:18:25.997635 2015] [:error] [pid 1827] found = 
> self.importer(used)
> [Thu Oct 08 14:18:25.997649 2015] [:error] [pid 1827] 
> [Thu Oct 08 14:18:25.997658 2015] [:error] [pid 1827] # ProcessId: 1827
> [Thu Oct 08 14:18:25.997674 2015] [:error] [pid 1827] # ThreadID: 
> 140423838201600  File 
> "/opt/python_envs/pyws/lib/python3.3/site-packages/raven/middleware.py", line 
> 35, in __call__
> [Thu Oct 08 14:18:25.997684 2015] [:error] [pid 1827] iterable = 
> self.application(environ, start_response)
> [Thu Oct 08 14:18:25.997692 2015] [:error] [pid 1827]   File 
> "/opt/python_envs/pyws/lib/python3.3/site-packages/django/core/handlers/wsgi.py",
>  line 189, in __call__
> [Thu Oct 08 14:18:25.997699 2015] [:error] [pid 1827] response = 
> self.get_response(request)
> [Thu Oct 08 14:18:25.997706 2015] [:error] [pid 1827]   File 
> "/opt/python_envs/pyws/lib/python3.3/site-packages/django/core/handlers/base.py",
>  line 108, in get_response
> [Thu Oct 08 14:18:25.997713 2015] [:error] [pid 1827] response = 
> middleware_method(request)
> [Thu Oct 08 14:18:25.997720 2015] [:error] [pid 1827]   File 
> "/opt/python_envs/pyws/lib/python3.3/site-packages/django/middleware/common.py",
>  line 74, in process_request
> [Thu Oct 08 14:18:25.997727 2015] [:error] [pid 1827] if (not 
> urlresolvers.is_valid_path(request.path_info, urlconf) and
> [Thu Oct 08 14:18:25.997734 2015] [:error] [pid 1827]   File 
> "/opt/python_envs/pyws/lib/python3.3/site-packages/django/core/urlresolvers.py",
>  line 647, in is_valid_path
> [Thu Oct 08 14:18:25.997748 2015] [:error] [pid 1827] resolve(path, 
> urlconf)
> [Thu Oct 08 14:18:25.997755 2015] [:error] [pid 1827]   File 
> "/opt/python_envs/pyws/lib/python3.3/site-packages/django/core/urlresolvers.py",
>  line 522, in resolve
> [Thu Oct 08 14:18:25.997762 2015] [:error] [pid 1827] return 
> get_resolver(urlconf).resolve(path)
> [Thu Oct 08 14:18:25.997769 2015] [:error] [pid 1827]   File 
> "/opt/python_envs/pyws/lib/python3.3/site-packages/django/core/urlresolvers.py",
>  line 368, in resolve
> [Thu Oct 08 14:18:25.997776 2015] [:error] [pid 1827] sub_match = 
> pattern.resolve(new_path)
> [Thu Oct 08 14:18:25.997783 2015] [:error] [pid 1827]   File 
> "/opt/python_envs/pyws/lib/python3.3/site-packages/django/core/urlresolvers.py",
>  line 368, in resolve
> [Thu Oct 08 14:18:25.997790 2015] [:error] [pid 1827] sub_match = 
> pattern.resolve(new_path)
> [Thu Oct 08 14:18:25.997797 2015] [:error] [pid 1827]   File 
> 

[modwsgi] Re: mod_wsgi (3.4-14) / Apache 2.4.12 / cx_oracle 5.2 / Oracle 12 / Red Hat (6.7) / Django 1.8.2 hanging under load

2015-10-08 Thread 'Lukasz Szajkowski' via modwsgi
Thanks a lot Graham for advice

I tried the settings

WSGIScriptAlias / /opt/hosts/pyws.test/pyws/pyws/wsgi.py process-group=pyws.st 
application-group=%{GLOBAL}
WSGIImportScript /opt/hosts/pyws.test/pyws/pyws/wsgi_monitor.py 
process-group=pyws.st application-group=%{GLOBAL}


but I still got the error. Bellow is the stack

I can now reproduce the problem on all our environments (5). They all use the 
same technology stack.


[Thu Oct 08 14:18:25.997539 2015] [:error] [pid 1827] django.setup()
[Thu Oct 08 14:18:25.997546 2015] [:error] [pid 1827]   File 
"/opt/python_envs/pyws/lib/python3.3/site-packages/django/__init__.py", line 
17, in setup
[Thu Oct 08 14:18:25.997553 2015] [:error] [pid 1827] 
configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
[Thu Oct 08 14:18:25.997560 2015] [:error] [pid 1827]   File 
"/opt/python_envs/pyws/lib/python3.3/site-packages/django/utils/log.py", line 
86, in configure_logging
[Thu Oct 08 14:18:25.997567 2015] [:error] [pid 1827] 
logging_config_func(logging_settings)
[Thu Oct 08 14:18:25.997574 2015] [:error] [pid 1827]   File 
"/opt/rh/python33/root/usr/lib64/python3.3/logging/config.py", line 795, in 
dictConfig
[Thu Oct 08 14:18:25.997581 2015] [:error] [pid 1827] 
dictConfigClass(config).configure()
[Thu Oct 08 14:18:25.997588 2015] [:error] [pid 1827]   File 
"/opt/rh/python33/root/usr/lib64/python3.3/logging/config.py", line 555, in 
configure
[Thu Oct 08 14:18:25.997595 2015] [:error] [pid 1827] filters[name] = 
self.configure_filter(filters[name])
[Thu Oct 08 14:18:25.997601 2015] [:error] [pid 1827]   File 
"/opt/rh/python33/root/usr/lib64/python3.3/logging/config.py", line 679, in 
configure_filter
[Thu Oct 08 14:18:25.997609 2015] [:error] [pid 1827] result = 
self.configure_custom(config)
[Thu Oct 08 14:18:25.997615 2015] [:error] [pid 1827]   File 
"/opt/rh/python33/root/usr/lib64/python3.3/logging/config.py", line 472, in 
configure_custom
[Thu Oct 08 14:18:25.997622 2015] [:error] [pid 1827] c = self.resolve(c)
[Thu Oct 08 14:18:25.997629 2015] [:error] [pid 1827]   File 
"/opt/rh/python33/root/usr/lib64/python3.3/logging/config.py", line 387, in 
resolve
[Thu Oct 08 14:18:25.997635 2015] [:error] [pid 1827] found = 
self.importer(used)
[Thu Oct 08 14:18:25.997649 2015] [:error] [pid 1827] 
[Thu Oct 08 14:18:25.997658 2015] [:error] [pid 1827] # ProcessId: 1827
[Thu Oct 08 14:18:25.997674 2015] [:error] [pid 1827] # ThreadID: 
140423838201600  File 
"/opt/python_envs/pyws/lib/python3.3/site-packages/raven/middleware.py", line 
35, in __call__
[Thu Oct 08 14:18:25.997684 2015] [:error] [pid 1827] iterable = 
self.application(environ, start_response)
[Thu Oct 08 14:18:25.997692 2015] [:error] [pid 1827]   File 
"/opt/python_envs/pyws/lib/python3.3/site-packages/django/core/handlers/wsgi.py",
 line 189, in __call__
[Thu Oct 08 14:18:25.997699 2015] [:error] [pid 1827] response = 
self.get_response(request)
[Thu Oct 08 14:18:25.997706 2015] [:error] [pid 1827]   File 
"/opt/python_envs/pyws/lib/python3.3/site-packages/django/core/handlers/base.py",
 line 108, in get_response
[Thu Oct 08 14:18:25.997713 2015] [:error] [pid 1827] response = 
middleware_method(request)
[Thu Oct 08 14:18:25.997720 2015] [:error] [pid 1827]   File 
"/opt/python_envs/pyws/lib/python3.3/site-packages/django/middleware/common.py",
 line 74, in process_request
[Thu Oct 08 14:18:25.997727 2015] [:error] [pid 1827] if (not 
urlresolvers.is_valid_path(request.path_info, urlconf) and
[Thu Oct 08 14:18:25.997734 2015] [:error] [pid 1827]   File 
"/opt/python_envs/pyws/lib/python3.3/site-packages/django/core/urlresolvers.py",
 line 647, in is_valid_path
[Thu Oct 08 14:18:25.997748 2015] [:error] [pid 1827] resolve(path, urlconf)
[Thu Oct 08 14:18:25.997755 2015] [:error] [pid 1827]   File 
"/opt/python_envs/pyws/lib/python3.3/site-packages/django/core/urlresolvers.py",
 line 522, in resolve
[Thu Oct 08 14:18:25.997762 2015] [:error] [pid 1827] return 
get_resolver(urlconf).resolve(path)
[Thu Oct 08 14:18:25.997769 2015] [:error] [pid 1827]   File 
"/opt/python_envs/pyws/lib/python3.3/site-packages/django/core/urlresolvers.py",
 line 368, in resolve
[Thu Oct 08 14:18:25.997776 2015] [:error] [pid 1827] sub_match = 
pattern.resolve(new_path)
[Thu Oct 08 14:18:25.997783 2015] [:error] [pid 1827]   File 
"/opt/python_envs/pyws/lib/python3.3/site-packages/django/core/urlresolvers.py",
 line 368, in resolve
[Thu Oct 08 14:18:25.997790 2015] [:error] [pid 1827] sub_match = 
pattern.resolve(new_path)
[Thu Oct 08 14:18:25.997797 2015] [:error] [pid 1827]   File 
"/opt/python_envs/pyws/lib/python3.3/site-packages/django/core/urlresolvers.py",
 line 240, in resolve
[Thu Oct 08 14:18:25.997804 2015] [:error] [pid 1827] return 
ResolverMatch(self.callback, args, kwargs, self.name)
[Thu Oct 08 14:18:25.997810 2015] [:error] [pid 1827]   File 
"/opt/python_envs/pyws/lib/python3.3/site-packages/django/core/urlresolvers.py",
 line 

[modwsgi] Re: mod_wsgi (3.4-14) / Apache 2.4.12 / cx_oracle 5.2 / Oracle 12 / Red Hat (6.7) / Django 1.8.2 hanging under load

2015-10-06 Thread 'Lukasz Szajkowski' via modwsgi


Deadlock shows that application hangs trying to load modules (from django 
or built-in etc.). Normally it should be done only once at start-up, but in 
our case it's after many requests (*Why)*. So possible explanations:
   * python process/interpreter is killed/restarted from outside (e.g. by 
logrotate) and starts to import modules again

   * internal mod_wsgi monitor thread kills and restarts python (
https://github.com/GrahamDumpleton/mod_wsgi/blob/3.4/mod_wsgi.c#L11157)

   * lazy load of application leads to late imports - added options to 
mod_wsgi to force early application load (default it lazy load)

-- 
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 modwsgi+unsubscr...@googlegroups.com.
To post to this group, send email to modwsgi@googlegroups.com.
Visit this group at http://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.


Re: [modwsgi] Re: mod_wsgi (3.4-14) / Apache 2.4.12 / cx_oracle 5.2 / Oracle 12 / Red Hat (6.7) / Django 1.8.2 hanging under load

2015-10-06 Thread Graham Dumpleton

> On 6 Oct 2015, at 6:32 pm, 'Lukasz Szajkowski' via modwsgi 
>  wrote:
> 
> Deadlock shows that application hangs trying to load modules (from django or 
> built-in etc.). Normally it should be done only once at start-up, but in our 
> case it's after many requests (Why). So possible explanations:
>* python process/interpreter is killed/restarted from outside (e.g. by 
> logrotate) and starts to import modules again
> 
>* internal mod_wsgi monitor thread kills and restarts python 
> (https://github.com/GrahamDumpleton/mod_wsgi/blob/3.4/mod_wsgi.c#L11157 
> )
> 

Both of the above would result in a completely new process being created. There 
shouldn’t be any case where Python is reinitialised in the same process.

For a process restart wouldn’t be so concerned.
>* lazy load of application leads to late imports - added options to 
> mod_wsgi to force early application load (default it lazy load)
> 

This could definitely be an issue, especially if imports are done from within 
functions rather than global scope.

Lets try another things just to make sure that everything Python is at least 
happening in daemon processes as it should.

For this, ensure that you are setting:

WSGIRestrictedEmbedded On

This will ensure that Python isn’t being initialised inside any Apache child 
worker processes. If for some reason configuration was getting applied wrongly 
and request ran in child worker process rather than daemon processes, this 
would come up as an error with that setting.

The other thing one can do to be absolutely certain things running in right sub 
interpreter context, is that instead of doing:

WSGIDaemonProcess xxx
WSGIProcessGroup xxx
WSGIApplicationGroup %{GLOBAL}
WSGIScriptAlias / /some/path/app.wsgi

use:

WSGIDaemonProcess xxx
WSGIScriptAlias / /some/path/app.wsgi process-group=xxx 
application-group=%{GLOBAL}

This will ensure everything runs in main interpreter context of daemon process 
‘xxx’ and not subject to Apache context matching rules to ensure that 
WSGIProcessGroup/WSGIApplicationGroup are applied correctly.

Use of the process-group and application-group options together on 
WSGIScriptAlias will also have the side effect of preloading the WSGI script 
file on process start rather than lazily on first request.

This only applies to the WSGI script file itself and direct module imports. 
Django itself will lazily load view handlers for URLs still and so code for 
those can still be lazily loaded.

The only away around that is as a side effect of loading WSGI script, use 
WebTest or something to fake requests into the Django application instance for 
certain key URLs to force it to load code then.

Graham


-- 
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 modwsgi+unsubscr...@googlegroups.com.
To post to this group, send email to modwsgi@googlegroups.com.
Visit this group at http://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.


[modwsgi] Re: mod_wsgi (3.4-14) / Apache 2.4.12 / cx_oracle 5.2 / Oracle 12 / Red Hat (6.7) / Django 1.8.2 hanging under load

2015-10-05 Thread 'Lukasz Szajkowski' via modwsgi
I am not sure if it matters but there is one more python demon on the same 
Apache
here is the config

#LogLevel warn
ErrorLog "/opt/logs/pyframe/vhost_epa_prod_error.log"
CustomLog "/opt/logs/pyframe/vhost_epa_prod_access.log" combined


WSGIDaemonProcess epa.prod processes=1 threads=25 user=pnc python-path=PATH
WSGIProcessGroup epa.prod
WSGIApplicationGroup %{GLOBAL}
WSGIScriptAlias / /opt/hosts/epa.test/pyframe/pyframe/wsgi.py
Alias /static/ /opt/hosts/epa.test/pyframe/assets/

-- 
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 modwsgi+unsubscr...@googlegroups.com.
To post to this group, send email to modwsgi@googlegroups.com.
Visit this group at http://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.


Re: [modwsgi] Re: mod_wsgi (3.4-14) / Apache 2.4.12 / cx_oracle 5.2 / Oracle 12 / Red Hat (6.7) / Django 1.8.2 hanging under load

2015-09-28 Thread Bill Freeman
Looks like a lock isn't being freed or a lock priority inversion, etc.
Tricky.

On Mon, Sep 28, 2015 at 3:10 PM, 'Lukasz Szajkowski' via modwsgi <
modwsgi@googlegroups.com> wrote:

> The actual stack trace while hanging is
> #0  0x7f047ff099b0 in sem_wait () from /lib64/libpthread.so.0
> #1  0x7f0474b4c6d8 in PyThread_acquire_lock_timed () from
> /opt/rh/python33/root/usr/lib64/libpython3.3m.so.1.0
> #2  0x7f0474b2cab5 in _PyImport_AcquireLock () from
> /opt/rh/python33/root/usr/lib64/libpython3.3m.so.1.0
> #3  0x7f0474b2cf49 in PyImport_ImportModuleLevelObject () from
> /opt/rh/python33/root/usr/lib64/libpython3.3m.so.1.0
> #4  0x7f0474b10f8f in ?? () from
> /opt/rh/python33/root/usr/lib64/libpython3.3m.so.1.0
> #5  0x7f0474b1baa4 in PyEval_EvalFrameEx () from
> /opt/rh/python33/root/usr/lib64/libpython3.3m.so.1.0
> #6  0x7f0474b1b0f9 in PyEval_EvalFrameEx () from
> /opt/rh/python33/root/usr/lib64/libpython3.3m.so.1.0
> #7  0x7f0474b1c457 in PyEval_EvalCodeEx () from
> /opt/rh/python33/root/usr/lib64/libpython3.3m.so.1.0
> #8  0x7f0474b1aead in PyEval_EvalFrameEx () from
> /opt/rh/python33/root/usr/lib64/libpython3.3m.so.1.0
> #9  0x7f0474b1b0f9 in PyEval_EvalFrameEx () from
> /opt/rh/python33/root/usr/lib64/libpython3.3m.so.1.0
> #10 0x7f0474b1b0f9 in PyEval_EvalFrameEx () from
> /opt/rh/python33/root/usr/lib64/libpython3.3m.so.1.0
> #11 0x7f0474b1b0f9 in PyEval_EvalFrameEx () from
> /opt/rh/python33/root/usr/lib64/libpython3.3m.so.1.0
> #12 0x7f0474b1b0f9 in PyEval_EvalFrameEx () from
> /opt/rh/python33/root/usr/lib64/libpython3.3m.so.1.0
> #13 0x7f0474b1b0f9 in PyEval_EvalFrameEx () from
> /opt/rh/python33/root/usr/lib64/libpython3.3m.so.1.0
> #14 0x7f0474b1b0f9 in PyEval_EvalFrameEx () from
> /opt/rh/python33/root/usr/lib64/libpython3.3m.so.1.0
> #15 0x7f0474b1c457 in PyEval_EvalCodeEx () from
> /opt/rh/python33/root/usr/lib64/libpython3.3m.so.1.0
> #16 0x7f0474a90842 in ?? () from
> /opt/rh/python33/root/usr/lib64/libpython3.3m.so.1.0
> #17 0x7f0474a69fd6 in PyObject_Call () from
> /opt/rh/python33/root/usr/lib64/libpython3.3m.so.1.0
> #18 0x7f0474b11763 in PyEval_CallObjectWithKeywords () from
> /opt/rh/python33/root/usr/lib64/libpython3.3m.so.1.0
> #19 0x7f0474e8f6ac in ?? () from
> /opt/rh/httpd24/root/etc/httpd/modules/mod_python33-wsgi.so
> #20 0x7f0474e93f8b in ?? () from
> /opt/rh/httpd24/root/etc/httpd/modules/mod_python33-wsgi.so
> #21 0x7f0474e976c8 in ?? () from
> /opt/rh/httpd24/root/etc/httpd/modules/mod_python33-wsgi.so
> #22 0x7f047ff03a51 in start_thread () from /lib64/libpthread.so.0
> #23 0x7f047fc509ad in clone () from /lib64/libc.so.6
>
> --
> 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 modwsgi+unsubscr...@googlegroups.com.
> To post to this group, send email to modwsgi@googlegroups.com.
> 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 modwsgi+unsubscr...@googlegroups.com.
To post to this group, send email to modwsgi@googlegroups.com.
Visit this group at http://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.


[modwsgi] Re: mod_wsgi app hanging and I can't pinpoint where its hanging...need help

2015-09-17 Thread Eric Wright
ppp

On Monday, August 12, 2013 at 6:54:24 PM UTC-4, Adam wrote:
>
> Ok.  So this one pyramid app I wrote half a year ago is acting up as this 
> group of artists went ahead to release a new art pack.  The app is hitting 
> some infinite loops/deadlocks somewhere and I'm not sure what's going on 
> exactly with it.  I have the following configurations setup at the moment, 
> and am happy to provide anymore information that I can about this 
> environment.  Keep in mind this website was running fine for 6 months and i 
> checked the DB and didn't see anything majorly wrong.
>
> This is what I got when trying to run gdb with the 'thread apply all bt' 
> to the process ID
>
> Thread 19 (Thread 0x7f5635daf700 (LWP 16172)):
>
> #0  0x7f563fd9f4f3 in select () from /lib64/libc.so.6
>
> #1  0x7f56406d9154 in apr_sleep () from 
> /usr/local/apache/lib/libapr-1.so.0
>
> #2  0x7f563c44a118 in wsgi_monitor_thread ()
>
>from /usr/local/apache/modules/mod_wsgi.so
>
> #3  0x7f56406d8453 in dummy_worker ()
>
>from /usr/local/apache/lib/libapr-1.so.0
>
> #4  0x7f5640058851 in start_thread () from /lib64/libpthread.so.0
>
> #5  0x7f563fda690d in clone () from /lib64/libc.so.6
>
>
> Thread 18 (Thread 0x7f563518f700 (LWP 16173)):
>
> #0  0x7f563fd9f4f3 in select () from /lib64/libc.so.6
>
> #1  0x7f56406d9154 in apr_sleep () from 
> /usr/local/apache/lib/libapr-1.so.0
>
> #2  0x7f563c449d72 in wsgi_deadlock_thread ()
>
>from /usr/local/apache/modules/mod_wsgi.so
>
> #3  0x7f56406d8453 in dummy_worker ()
>
>from /usr/local/apache/lib/libapr-1.so.0
>
> #4  0x7f5640058851 in start_thread () from /lib64/libpthread.so.0
>
> #5  0x7f563fda690d in clone () from /lib64/libc.so.6
>
>
> Thread 17 (Thread 0x7f562700 (LWP 16174)):
>
> #0  0x7f564005c43c in pthread_cond_wait@@GLIBC_2.3.2 ()
>
> ---Type  to continue, or q  to quit---
>
>from /lib64/libpthread.so.0
>
> #1  0x7f56406c8a09 in apr_thread_cond_wait ()
>
>from /usr/local/apache/lib/libapr-1.so.0
>
> #2  0x7f563c44942e in wsgi_worker_acquire ()
>
>from /usr/local/apache/modules/mod_wsgi.so
>
> #3  0x7f563c4496ca in wsgi_daemon_worker ()
>
>from /usr/local/apache/modules/mod_wsgi.so
>
> #4  0x7f563c449c1d in wsgi_daemon_thread ()
>
>from /usr/local/apache/modules/mod_wsgi.so
>
> #5  0x7f56406d8453 in dummy_worker ()
>
>from /usr/local/apache/lib/libapr-1.so.0
>
> #6  0x7f5640058851 in start_thread () from /lib64/libpthread.so.0
>
> #7  0x7f563fda690d in clone () from /lib64/libc.so.6
>
>
> Thread 16 (Thread 0x7f562f5fe700 (LWP 16175)):
>
> #0  0x7f564005c43c in pthread_cond_wait@@GLIBC_2.3.2 ()
>
>from /lib64/libpthread.so.0
>
> #1  0x7f56406c8a09 in apr_thread_cond_wait ()
>
>from /usr/local/apache/lib/libapr-1.so.0
>
> #2  0x7f563c44942e in wsgi_worker_acquire ()
>
>from /usr/local/apache/modules/mod_wsgi.so
>
> #3  0x7f563c4496ca in wsgi_daemon_worker ()
>
>from /usr/local/apache/modules/mod_wsgi.so
>
> ---Type  to continue, or q  to quit---
>
> #4  0x7f563c449c1d in wsgi_daemon_thread ()
>
>from /usr/local/apache/modules/mod_wsgi.so
>
> #5  0x7f56406d8453 in dummy_worker ()
>
>from /usr/local/apache/lib/libapr-1.so.0
>
> #6  0x7f5640058851 in start_thread () from /lib64/libpthread.so.0
>
> #7  0x7f563fda690d in clone () from /lib64/libc.so.6
>
>
> Thread 15 (Thread 0x7f562ebfd700 (LWP 16176)):
>
> #0  0x7f564005c43c in pthread_cond_wait@@GLIBC_2.3.2 ()
>
>from /lib64/libpthread.so.0
>
> #1  0x7f56406c8a09 in apr_thread_cond_wait ()
>
>from /usr/local/apache/lib/libapr-1.so.0
>
> #2  0x7f563c44942e in wsgi_worker_acquire ()
>
>from /usr/local/apache/modules/mod_wsgi.so
>
> #3  0x7f563c4496ca in wsgi_daemon_worker ()
>
>from /usr/local/apache/modules/mod_wsgi.so
>
> #4  0x7f563c449c1d in wsgi_daemon_thread ()
>
>from /usr/local/apache/modules/mod_wsgi.so
>
> #5  0x7f56406d8453 in dummy_worker ()
>
>from /usr/local/apache/lib/libapr-1.so.0
>
> #6  0x7f5640058851 in start_thread () from /lib64/libpthread.so.0
>
> #7  0x7f563fda690d in clone () from /lib64/libc.so.6
>
>
> ---Type  to continue, or q  to quit---
>
> Thread 14 (Thread 0x7f562e1fc700 (LWP 16177)):
>
> #0  0x7f564005c43c in pthread_cond_wait@@GLIBC_2.3.2 ()
>
>from /lib64/libpthread.so.0
>
> #1  0x7f56406c8a09 in apr_thread_cond_wait ()
>
>from /usr/local/apache/lib/libapr-1.so.0
>
> #2  0x7f563c44942e in wsgi_worker_acquire ()
>
>from /usr/local/apache/modules/mod_wsgi.so
>
> #3  0x7f563c4496ca in wsgi_daemon_worker ()
>
>from /usr/local/apache/modules/mod_wsgi.so
>
> #4  0x7f563c449c1d in wsgi_daemon_thread ()
>
>from /usr/local/apache/modules/mod_wsgi.so
>
> #5  0x7f56406d8453 in dummy_worker ()
>
>from /usr/local/apache/lib/libapr-1.so.0
>
> #6  0x7f5640058851 in start_thread () from /lib64/libpthread.so.0
>
> #7  

[modwsgi] Re: mod_wsgi-express possible to edit conf file?

2015-09-11 Thread hongyuan1306
There is one --include-file option for mod_wsgi-express, which might be 
what you are looking for:

  --include-file FILE-PATH
Specify the path to an additional web server
configuration file to be included at the end of the
generated web server configuration file.

By the way, the cleanest way to separate 2 django apps on two different 
python versions on the same machine would be to use two different docker 
images of mod-wsgi.

-- 
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 modwsgi+unsubscr...@googlegroups.com.
To post to this group, send email to modwsgi@googlegroups.com.
Visit this group at http://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.


[modwsgi] Re: mod_wsgi-express: Syntax error: cannot load .../server/mod_wsgi-py27.so into server

2015-06-08 Thread Fabian Ullmann
Dear Graham,

many thanks for your fast answer. I reseted the system and installed it 
again. Today I will install all requirements and give you feedback as soon 
as possible.

Thank your very much for your help. I hope that i will run fine :)

Am Mittwoch, 3. Juni 2015 22:44:39 UTC+2 schrieb Fabian Ullmann:

 Hello together,

 i hope you can help me. I installed Debian7 + apache2 and pydev. From PyPi 
 i installed mod_wsgi.
 If I run the mod_wsgi-express script with the start-server command i get 
 an error:

 apache2 (mod_wsgi-express): Syntax error on line 147 of 
 /home/ullmanfa/server/httpd.conf: Cannot load 
 /home/ullmanfa/.pyenv/versions/test/lib/python2.7/site-packages/mod_wsgi-4.4.12-py2.7-linux-i686.egg/mod_wsgi/server/mod_wsgi-py27.so
  
 into server: 
 /home/ullmanfa/.pyenv/versions/test/lib/python2.7/site-packages/mod_wsgi-4.4.12-py2.7-linux-i686.egg/mod_wsgi/server/mod_wsgi-py27.so:
  
 undefined symbol: fmod 

 Do you know what my mistake is? I hope you can help me... Thanks a lot
  


-- 
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 modwsgi+unsubscr...@googlegroups.com.
To post to this group, send email to modwsgi@googlegroups.com.
Visit this group at http://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.


[modwsgi] Re: mod_wsgi v3.5 Installation within Python

2014-11-08 Thread Anthony Dycks
Some additional Version background on my system environment:


   - Platform: Windows 7 Pro 32-bit
   - Python Installation: 
  - Version 2.7.6 32 Bit 
  - (Default Install for Multiple User; User installed had Admin 
  privileges)
   - LAMP Stack: XAMPP v1.8.2 32-bit
   - Apache Server: v2.4.7
   - mod_wsgi Install: Binary: mod_wsgi‑3.5.ap24.win32‑py2.7.zip



On Saturday, November 8, 2014 10:10:24 AM UTC-8, Anthony Dycks wrote:

 From reading the Python PyPi Index descriptionon for mod_wsgi v4.3, I 
 understand that mod_wsgi v4.3 can be installed within the Python 
 Interpreter.  Can the latest release of mod_wsgi v3.5 be installed within 
 the Python Interpreter as well?

 If I install mod_wsgi within the Python Interpreter do I need to remove 
 the mod_wsgi3.5.so - private http://mod_wsgi3.5.so module reference 
 from the Apache httpd.conf file to prevent versioning and environment 
 issues?

 Thanks!


-- 
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 modwsgi+unsubscr...@googlegroups.com.
To post to this group, send email to modwsgi@googlegroups.com.
Visit this group at http://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.


[modwsgi] Re: mod_wsgi hello world failing on ubuntu 14.04

2014-09-25 Thread David Sargrad
Thank you for the fast response.

The failure is that I can not browse to my hello world app, and see the 
expected response Yo World.

yohost is in my hosts files (tied currently to 127.0.0.1).. pingable and 
resolvable.


i've tried to get to the site using wget 
wget http://yohost/yo

I am able to wget the base apache page
wget http://yohost

Should I see anything in a log somewhere that would indicate that yo.wsgi 
has been loaded? Is the SIGTERM that you see in the error.log related to 
wsgi? I did notice that I still see that even when i disable my yohost 
site. It does seem however that mod_wsgi is running, starting pything, and 
attaching interpreters. I would have thought that some log would say 
mod_wsgi... loading yo, or something akin to that.

On Thursday, September 25, 2014 9:04:57 AM UTC-4, David Sargrad wrote:

 I am trying to follow the instructions for running the mod_wsgi hello 
 world application:
 https://code.google.com/p/modwsgi/wiki/WhereToGetHelp

 I installed apache2 and libapache2-mod-wsgi

 sudo apt-get install apache2
 sudo apt-get install libapache2-mod-wsgi


 My wsgi hello world:
 /var/www/yo/public_html# cat yo.wsgi
 def application(environ, start_response):
 status = '200 OK'
 output = 'Yo World!'

 response_headers = [('Content-type', 'text/plain'),
 ('Content-Length', str(len(output)))]

 start_response(status, response_headers)

 return [output]


 My virtualhost:
 /etc/apache2/sites-available# cat yo.conf
 VirtualHost *:80
 ServerName yohost
 #WSGIDaemonProcess cwpmash user=ubuntu group=ubuntu threads=5
 WSGIScriptAlias /yo /var/www/yo/public_html/yo.wsgi
 DocumentRoot /var/www/yo/public_html
 Directory /var/www/yo/public_html
 #WSGIProcessGroup cwpmash
 #WSGIApplicationGroup %{GLOBAL}
 Order allow,deny
 Allow from all
 /Directory
 /VirtualHost

 I've enabled info logging in apache (rather than warn).

 I've enabled the site:
 /etc/apache2/sites-available# ls ../sites-enabled/
 000-default.conf  yo.conf




 My apache2 error log shows the following on apache restart:

 [Thu Sep 25 13:04:46.211520 2014] [:info] [pid 2305:tid 139868472567680] 
 mod_wsgi (pid=2305): Destroying interpreters.
 [Thu Sep 25 13:04:46.211603 2014] [:info] [pid 2305:tid 139868472567680] 
 mod_wsgi (pid=2305): Cleanup interpreter ''.
 [Thu Sep 25 13:04:46.211907 2014] [:info] [pid 2306:tid 139868472567680] 
 mod_wsgi (pid=2306): Destroying interpreters.
 [Thu Sep 25 13:04:46.211976 2014] [:info] [pid 2306:tid 139868472567680] 
 mod_wsgi (pid=2306): Cleanup interpreter ''.
 [Thu Sep 25 13:04:46.216683 2014] [:info] [pid 2305:tid 139868472567680] 
 mod_wsgi (pid=2305): Terminating Python.
 [Thu Sep 25 13:04:46.217228 2014] [:info] [pid 2306:tid 139868472567680] 
 mod_wsgi (pid=2306): Terminating Python.
 [Thu Sep 25 13:04:46.220709 2014] [:info] [pid 2305:tid 139868472567680] 
 mod_wsgi (pid=2305): Python has shutdown.
 [Thu Sep 25 13:04:46.221243 2014] [:info] [pid 2306:tid 139868472567680] 
 mod_wsgi (pid=2306): Python has shutdown.
 [Thu Sep 25 13:04:46.226124 2014] [core:info] [pid 2302:tid 
 139868472567680] AH00096: removed PID file /var/run/apache2/apache2.pid (
 pid=2302)
 [Thu Sep 25 13:04:46.226199 2014] [mpm_event:notice] [pid 2302:tid 
 139868472567680] AH00491: caught SIGTERM, shutting down
 [Thu Sep 25 13:04:47.348730 2014] [mpm_event:notice] [pid 2484:tid 
 140368719771520] AH00489: Apache/2.4.7 (Ubuntu) mod_wsgi/3.4 Python/2.7.6 
 configured -- resuming normal operations
 ...

-- 
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 modwsgi+unsubscr...@googlegroups.com.
To post to this group, send email to modwsgi@googlegroups.com.
Visit this group at http://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.


[modwsgi] Re: mod_wsgi hello world failing on ubuntu 14.04

2014-09-25 Thread David Sargrad
So In the error log I see the following:

[Thu Sep 25 13:57:44.291610 2014] [core:info] [pid 3148:tid 
139882152310528] [client 127.0.0.1:38363] AH00128: File does not exist: 
/var/www/html/yo

The access log shows a 404:
127.0.0.1 - - [25/Sep/2014:13:57:44 +] GET /yo HTTP/1.1 404 490 - 
Wget/1.15 (linux-gnu)

This seems to suggest that apache is looking in the default document root, 
rather than at the yo virtual host.

Just as an aside, I am trying to get the hello  world working, before I 
get my flask app working: trying to crawl before I walk. :)


On Thursday, September 25, 2014 9:04:57 AM UTC-4, David Sargrad wrote:

 I am trying to follow the instructions for running the mod_wsgi hello 
 world application:
 https://code.google.com/p/modwsgi/wiki/WhereToGetHelp

 I installed apache2 and libapache2-mod-wsgi

 sudo apt-get install apache2
 sudo apt-get install libapache2-mod-wsgi


 My wsgi hello world:
 /var/www/yo/public_html# cat yo.wsgi
 def application(environ, start_response):
 status = '200 OK'
 output = 'Yo World!'

 response_headers = [('Content-type', 'text/plain'),
 ('Content-Length', str(len(output)))]

 start_response(status, response_headers)

 return [output]


 My virtualhost:
 /etc/apache2/sites-available# cat yo.conf
 VirtualHost *:80
 ServerName yohost
 #WSGIDaemonProcess cwpmash user=ubuntu group=ubuntu threads=5
 WSGIScriptAlias /yo /var/www/yo/public_html/yo.wsgi
 DocumentRoot /var/www/yo/public_html
 Directory /var/www/yo/public_html
 #WSGIProcessGroup cwpmash
 #WSGIApplicationGroup %{GLOBAL}
 Order allow,deny
 Allow from all
 /Directory
 /VirtualHost

 I've enabled info logging in apache (rather than warn).

 I've enabled the site:
 /etc/apache2/sites-available# ls ../sites-enabled/
 000-default.conf  yo.conf




 My apache2 error log shows the following on apache restart:

 [Thu Sep 25 13:04:46.211520 2014] [:info] [pid 2305:tid 139868472567680] 
 mod_wsgi (pid=2305): Destroying interpreters.
 [Thu Sep 25 13:04:46.211603 2014] [:info] [pid 2305:tid 139868472567680] 
 mod_wsgi (pid=2305): Cleanup interpreter ''.
 [Thu Sep 25 13:04:46.211907 2014] [:info] [pid 2306:tid 139868472567680] 
 mod_wsgi (pid=2306): Destroying interpreters.
 [Thu Sep 25 13:04:46.211976 2014] [:info] [pid 2306:tid 139868472567680] 
 mod_wsgi (pid=2306): Cleanup interpreter ''.
 [Thu Sep 25 13:04:46.216683 2014] [:info] [pid 2305:tid 139868472567680] 
 mod_wsgi (pid=2305): Terminating Python.
 [Thu Sep 25 13:04:46.217228 2014] [:info] [pid 2306:tid 139868472567680] 
 mod_wsgi (pid=2306): Terminating Python.
 [Thu Sep 25 13:04:46.220709 2014] [:info] [pid 2305:tid 139868472567680] 
 mod_wsgi (pid=2305): Python has shutdown.
 [Thu Sep 25 13:04:46.221243 2014] [:info] [pid 2306:tid 139868472567680] 
 mod_wsgi (pid=2306): Python has shutdown.
 [Thu Sep 25 13:04:46.226124 2014] [core:info] [pid 2302:tid 
 139868472567680] AH00096: removed PID file /var/run/apache2/apache2.pid (
 pid=2302)
 [Thu Sep 25 13:04:46.226199 2014] [mpm_event:notice] [pid 2302:tid 
 139868472567680] AH00491: caught SIGTERM, shutting down
 [Thu Sep 25 13:04:47.348730 2014] [mpm_event:notice] [pid 2484:tid 
 140368719771520] AH00489: Apache/2.4.7 (Ubuntu) mod_wsgi/3.4 Python/2.7.6 
 configured -- resuming normal operations
 ...

-- 
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 modwsgi+unsubscr...@googlegroups.com.
To post to this group, send email to modwsgi@googlegroups.com.
Visit this group at http://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.


[modwsgi] Re: mod_wsgi hello world failing on ubuntu 14.04

2014-09-25 Thread David Sargrad
The same request within the browser also shows that Not Found The 
requested URL /yo was not found...



On Thursday, September 25, 2014 9:04:57 AM UTC-4, David Sargrad wrote:

 I am trying to follow the instructions for running the mod_wsgi hello 
 world application:
 https://code.google.com/p/modwsgi/wiki/WhereToGetHelp

 I installed apache2 and libapache2-mod-wsgi

 sudo apt-get install apache2
 sudo apt-get install libapache2-mod-wsgi


 My wsgi hello world:
 /var/www/yo/public_html# cat yo.wsgi
 def application(environ, start_response):
 status = '200 OK'
 output = 'Yo World!'

 response_headers = [('Content-type', 'text/plain'),
 ('Content-Length', str(len(output)))]

 start_response(status, response_headers)

 return [output]


 My virtualhost:
 /etc/apache2/sites-available# cat yo.conf
 VirtualHost *:80
 ServerName yohost
 #WSGIDaemonProcess cwpmash user=ubuntu group=ubuntu threads=5
 WSGIScriptAlias /yo /var/www/yo/public_html/yo.wsgi
 DocumentRoot /var/www/yo/public_html
 Directory /var/www/yo/public_html
 #WSGIProcessGroup cwpmash
 #WSGIApplicationGroup %{GLOBAL}
 Order allow,deny
 Allow from all
 /Directory
 /VirtualHost

 I've enabled info logging in apache (rather than warn).

 I've enabled the site:
 /etc/apache2/sites-available# ls ../sites-enabled/
 000-default.conf  yo.conf




 My apache2 error log shows the following on apache restart:

 [Thu Sep 25 13:04:46.211520 2014] [:info] [pid 2305:tid 139868472567680] 
 mod_wsgi (pid=2305): Destroying interpreters.
 [Thu Sep 25 13:04:46.211603 2014] [:info] [pid 2305:tid 139868472567680] 
 mod_wsgi (pid=2305): Cleanup interpreter ''.
 [Thu Sep 25 13:04:46.211907 2014] [:info] [pid 2306:tid 139868472567680] 
 mod_wsgi (pid=2306): Destroying interpreters.
 [Thu Sep 25 13:04:46.211976 2014] [:info] [pid 2306:tid 139868472567680] 
 mod_wsgi (pid=2306): Cleanup interpreter ''.
 [Thu Sep 25 13:04:46.216683 2014] [:info] [pid 2305:tid 139868472567680] 
 mod_wsgi (pid=2305): Terminating Python.
 [Thu Sep 25 13:04:46.217228 2014] [:info] [pid 2306:tid 139868472567680] 
 mod_wsgi (pid=2306): Terminating Python.
 [Thu Sep 25 13:04:46.220709 2014] [:info] [pid 2305:tid 139868472567680] 
 mod_wsgi (pid=2305): Python has shutdown.
 [Thu Sep 25 13:04:46.221243 2014] [:info] [pid 2306:tid 139868472567680] 
 mod_wsgi (pid=2306): Python has shutdown.
 [Thu Sep 25 13:04:46.226124 2014] [core:info] [pid 2302:tid 
 139868472567680] AH00096: removed PID file /var/run/apache2/apache2.pid (
 pid=2302)
 [Thu Sep 25 13:04:46.226199 2014] [mpm_event:notice] [pid 2302:tid 
 139868472567680] AH00491: caught SIGTERM, shutting down
 [Thu Sep 25 13:04:47.348730 2014] [mpm_event:notice] [pid 2484:tid 
 140368719771520] AH00489: Apache/2.4.7 (Ubuntu) mod_wsgi/3.4 Python/2.7.6 
 configured -- resuming normal operations
 ...

-- 
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 modwsgi+unsubscr...@googlegroups.com.
To post to this group, send email to modwsgi@googlegroups.com.
Visit this group at http://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.


Re: [modwsgi] Re: mod_wsgi hello world failing on ubuntu 14.04

2014-09-25 Thread Graham Dumpleton
What other VirtualHost definitions are setup for port 80, and especially with 
the same ServerName.

You can't have more than for same server name and port combination. Most likely 
it is ignoring your added one and using a previous one.

Also do check if you new one is even being loaded by adding a syntax error into 
the file. To do this just add a new line to file with:

  This is a syntax error.

and restart Apache. If it still starts, the file isn't even being loaded.

Graham

On 25/09/2014, at 10:06 PM, David Sargrad davidsarg...@hotmail.com wrote:

 The same request within the browser also shows that Not Found The requested 
 URL /yo was not found...
 
 
 
 On Thursday, September 25, 2014 9:04:57 AM UTC-4, David Sargrad wrote:
 I am trying to follow the instructions for running the mod_wsgi hello world 
 application:
 https://code.google.com/p/modwsgi/wiki/WhereToGetHelp
 
 I installed apache2 and libapache2-mod-wsgi
 sudo apt-get install apache2
 sudo apt-get install libapache2-mod-wsgi
 
 My wsgi hello world:
 /var/www/yo/public_html# cat yo.wsgi
 def application(environ, start_response):
 status = '200 OK'
 output = 'Yo World!'
 
 response_headers = [('Content-type', 'text/plain'),
 ('Content-Length', str(len(output)))]
 
 start_response(status, response_headers)
 
 return [output]
 
 
 My virtualhost:
 /etc/apache2/sites-available# cat yo.conf
 VirtualHost *:80
 ServerName yohost
 #WSGIDaemonProcess cwpmash user=ubuntu group=ubuntu threads=5
 WSGIScriptAlias /yo /var/www/yo/public_html/yo.wsgi
 DocumentRoot /var/www/yo/public_html
 Directory /var/www/yo/public_html
 #WSGIProcessGroup cwpmash
 #WSGIApplicationGroup %{GLOBAL}
 Order allow,deny
 Allow from all
 /Directory
 /VirtualHost
 
 I've enabled info logging in apache (rather than warn).
 
 I've enabled the site:
 /etc/apache2/sites-available# ls ../sites-enabled/
 000-default.conf  yo.conf
 
 
 
 
 My apache2 error log shows the following on apache restart:
 
 [Thu Sep 25 13:04:46.211520 2014] [:info] [pid 2305:tid 139868472567680] 
 mod_wsgi (pid=2305): Destroying interpreters.
 [Thu Sep 25 13:04:46.211603 2014] [:info] [pid 2305:tid 139868472567680] 
 mod_wsgi (pid=2305): Cleanup interpreter ''.
 [Thu Sep 25 13:04:46.211907 2014] [:info] [pid 2306:tid 139868472567680] 
 mod_wsgi (pid=2306): Destroying interpreters.
 [Thu Sep 25 13:04:46.211976 2014] [:info] [pid 2306:tid 139868472567680] 
 mod_wsgi (pid=2306): Cleanup interpreter ''.
 [Thu Sep 25 13:04:46.216683 2014] [:info] [pid 2305:tid 139868472567680] 
 mod_wsgi (pid=2305): Terminating Python.
 [Thu Sep 25 13:04:46.217228 2014] [:info] [pid 2306:tid 139868472567680] 
 mod_wsgi (pid=2306): Terminating Python.
 [Thu Sep 25 13:04:46.220709 2014] [:info] [pid 2305:tid 139868472567680] 
 mod_wsgi (pid=2305): Python has shutdown.
 [Thu Sep 25 13:04:46.221243 2014] [:info] [pid 2306:tid 139868472567680] 
 mod_wsgi (pid=2306): Python has shutdown.
 [Thu Sep 25 13:04:46.226124 2014] [core:info] [pid 2302:tid 139868472567680] 
 AH00096: removed PID file /var/run/apache2/apache2.pid (pid=2302)
 [Thu Sep 25 13:04:46.226199 2014] [mpm_event:notice] [pid 2302:tid 
 139868472567680] AH00491: caught SIGTERM, shutting down
 [Thu Sep 25 13:04:47.348730 2014] [mpm_event:notice] [pid 2484:tid 
 140368719771520] AH00489: Apache/2.4.7 (Ubuntu) mod_wsgi/3.4 Python/2.7.6 
 configured -- resuming normal operations
 ...
 
 -- 
 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 modwsgi+unsubscr...@googlegroups.com.
 To post to this group, send email to modwsgi@googlegroups.com.
 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 modwsgi+unsubscr...@googlegroups.com.
To post to this group, send email to modwsgi@googlegroups.com.
Visit this group at http://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.


[modwsgi] Re: mod_wsgi hello world failing on ubuntu 14.04

2014-09-25 Thread David Sargrad
I did a fresh install of both apache and mod_wsgi yesterday. This is the 
only virtual host enabled (above and beyond the default). Though I started 
first with my flask app yesterday I disabled that site:


/etc/apache2/sites-enabled# ls -ltr
total 0
lrwxrwxrwx 1 root root 35 Sep 25 12:03 000-default.conf - 
../sites-available/000-default.conf
lrwxrwxrwx 1 root root 26 Sep 25 13:16 yo.conf - ../sites-available/yo.conf

Do I need to disable the default site?

I would think not
/etc/apache2/sites-enabled# cat 000-default.conf
VirtualHost *:80
# The ServerName directive sets the request scheme, hostname and 
port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header 
to
# match this virtual host. For the default virtual host (this file) 
this
# value is not decisive as it is used as a last resort host 
regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com

ServerAdmin webmaster@localhost
DocumentRoot /var/www/html

# Available loglevels: trace8, ..., trace1, debug, info, notice, 
warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example 
the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with a2disconf.
#Include conf-available/serve-cgi-bin.conf
/VirtualHost

On Thursday, September 25, 2014 9:04:57 AM UTC-4, David Sargrad wrote:

 I am trying to follow the instructions for running the mod_wsgi hello 
 world application:
 https://code.google.com/p/modwsgi/wiki/WhereToGetHelp

 I installed apache2 and libapache2-mod-wsgi

 sudo apt-get install apache2
 sudo apt-get install libapache2-mod-wsgi


 My wsgi hello world:
 /var/www/yo/public_html# cat yo.wsgi
 def application(environ, start_response):
 status = '200 OK'
 output = 'Yo World!'

 response_headers = [('Content-type', 'text/plain'),
 ('Content-Length', str(len(output)))]

 start_response(status, response_headers)

 return [output]


 My virtualhost:
 /etc/apache2/sites-available# cat yo.conf
 VirtualHost *:80
 ServerName yohost
 #WSGIDaemonProcess cwpmash user=ubuntu group=ubuntu threads=5
 WSGIScriptAlias /yo /var/www/yo/public_html/yo.wsgi
 DocumentRoot /var/www/yo/public_html
 Directory /var/www/yo/public_html
 #WSGIProcessGroup cwpmash
 #WSGIApplicationGroup %{GLOBAL}
 Order allow,deny
 Allow from all
 /Directory
 /VirtualHost

 I've enabled info logging in apache (rather than warn).

 I've enabled the site:
 /etc/apache2/sites-available# ls ../sites-enabled/
 000-default.conf  yo.conf




 My apache2 error log shows the following on apache restart:

 [Thu Sep 25 13:04:46.211520 2014] [:info] [pid 2305:tid 139868472567680] 
 mod_wsgi (pid=2305): Destroying interpreters.
 [Thu Sep 25 13:04:46.211603 2014] [:info] [pid 2305:tid 139868472567680] 
 mod_wsgi (pid=2305): Cleanup interpreter ''.
 [Thu Sep 25 13:04:46.211907 2014] [:info] [pid 2306:tid 139868472567680] 
 mod_wsgi (pid=2306): Destroying interpreters.
 [Thu Sep 25 13:04:46.211976 2014] [:info] [pid 2306:tid 139868472567680] 
 mod_wsgi (pid=2306): Cleanup interpreter ''.
 [Thu Sep 25 13:04:46.216683 2014] [:info] [pid 2305:tid 139868472567680] 
 mod_wsgi (pid=2305): Terminating Python.
 [Thu Sep 25 13:04:46.217228 2014] [:info] [pid 2306:tid 139868472567680] 
 mod_wsgi (pid=2306): Terminating Python.
 [Thu Sep 25 13:04:46.220709 2014] [:info] [pid 2305:tid 139868472567680] 
 mod_wsgi (pid=2305): Python has shutdown.
 [Thu Sep 25 13:04:46.221243 2014] [:info] [pid 2306:tid 139868472567680] 
 mod_wsgi (pid=2306): Python has shutdown.
 [Thu Sep 25 13:04:46.226124 2014] [core:info] [pid 2302:tid 
 139868472567680] AH00096: removed PID file /var/run/apache2/apache2.pid (
 pid=2302)
 [Thu Sep 25 13:04:46.226199 2014] [mpm_event:notice] [pid 2302:tid 
 139868472567680] AH00491: caught SIGTERM, shutting down
 [Thu Sep 25 13:04:47.348730 2014] [mpm_event:notice] [pid 2484:tid 
 140368719771520] AH00489: Apache/2.4.7 (Ubuntu) mod_wsgi/3.4 Python/2.7.6 
 configured -- resuming normal operations
 ...

-- 
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 modwsgi+unsubscr...@googlegroups.com.
To 

[modwsgi] Re: mod_wsgi hello world failing on ubuntu 14.04

2014-09-25 Thread David Sargrad
Ok. I've added a syntax error intentionally (this btw was something i did 
b4 to verify that the site file was being loaded).. did it again just to be 
thorough:
service apache2 restart
 * Restarting web server 
apache2 
 
[fail]
 * The apache2 configtest failed.
Output of config test was:
AH00526: Syntax error on line 12 of /etc/apache2/sites-enabled/yo.conf:
Invalid command 'adding', perhaps misspelled or defined by a module not 
included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.


On Thursday, September 25, 2014 9:04:57 AM UTC-4, David Sargrad wrote:

 I am trying to follow the instructions for running the mod_wsgi hello 
 world application:
 https://code.google.com/p/modwsgi/wiki/WhereToGetHelp

 I installed apache2 and libapache2-mod-wsgi

 sudo apt-get install apache2
 sudo apt-get install libapache2-mod-wsgi


 My wsgi hello world:
 /var/www/yo/public_html# cat yo.wsgi
 def application(environ, start_response):
 status = '200 OK'
 output = 'Yo World!'

 response_headers = [('Content-type', 'text/plain'),
 ('Content-Length', str(len(output)))]

 start_response(status, response_headers)

 return [output]


 My virtualhost:
 /etc/apache2/sites-available# cat yo.conf
 VirtualHost *:80
 ServerName yohost
 #WSGIDaemonProcess cwpmash user=ubuntu group=ubuntu threads=5
 WSGIScriptAlias /yo /var/www/yo/public_html/yo.wsgi
 DocumentRoot /var/www/yo/public_html
 Directory /var/www/yo/public_html
 #WSGIProcessGroup cwpmash
 #WSGIApplicationGroup %{GLOBAL}
 Order allow,deny
 Allow from all
 /Directory
 /VirtualHost

 I've enabled info logging in apache (rather than warn).

 I've enabled the site:
 /etc/apache2/sites-available# ls ../sites-enabled/
 000-default.conf  yo.conf




 My apache2 error log shows the following on apache restart:

 [Thu Sep 25 13:04:46.211520 2014] [:info] [pid 2305:tid 139868472567680] 
 mod_wsgi (pid=2305): Destroying interpreters.
 [Thu Sep 25 13:04:46.211603 2014] [:info] [pid 2305:tid 139868472567680] 
 mod_wsgi (pid=2305): Cleanup interpreter ''.
 [Thu Sep 25 13:04:46.211907 2014] [:info] [pid 2306:tid 139868472567680] 
 mod_wsgi (pid=2306): Destroying interpreters.
 [Thu Sep 25 13:04:46.211976 2014] [:info] [pid 2306:tid 139868472567680] 
 mod_wsgi (pid=2306): Cleanup interpreter ''.
 [Thu Sep 25 13:04:46.216683 2014] [:info] [pid 2305:tid 139868472567680] 
 mod_wsgi (pid=2305): Terminating Python.
 [Thu Sep 25 13:04:46.217228 2014] [:info] [pid 2306:tid 139868472567680] 
 mod_wsgi (pid=2306): Terminating Python.
 [Thu Sep 25 13:04:46.220709 2014] [:info] [pid 2305:tid 139868472567680] 
 mod_wsgi (pid=2305): Python has shutdown.
 [Thu Sep 25 13:04:46.221243 2014] [:info] [pid 2306:tid 139868472567680] 
 mod_wsgi (pid=2306): Python has shutdown.
 [Thu Sep 25 13:04:46.226124 2014] [core:info] [pid 2302:tid 
 139868472567680] AH00096: removed PID file /var/run/apache2/apache2.pid (
 pid=2302)
 [Thu Sep 25 13:04:46.226199 2014] [mpm_event:notice] [pid 2302:tid 
 139868472567680] AH00491: caught SIGTERM, shutting down
 [Thu Sep 25 13:04:47.348730 2014] [mpm_event:notice] [pid 2484:tid 
 140368719771520] AH00489: Apache/2.4.7 (Ubuntu) mod_wsgi/3.4 Python/2.7.6 
 configured -- resuming normal operations
 ...

-- 
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 modwsgi+unsubscr...@googlegroups.com.
To post to this group, send email to modwsgi@googlegroups.com.
Visit this group at http://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.


Re: [modwsgi] Re: mod_wsgi hello world failing on ubuntu 14.04

2014-09-25 Thread Graham Dumpleton
If you access:

http://yohost/yo.wsgi

do you see the source code for the script?

If you don't it means that VirtualHost is not being used but the default is.

Also try using telnet to access the server port directly:

$ telnet yohost 80
GET /yo HTTP/1.0
Host: yohost

With multiple returns after Host line.

Anyway, time for me to go and not sure when back on next.

Graham

On 25/09/2014, at 10:20 PM, David Sargrad davidsarg...@hotmail.com wrote:

 Ok. I've added a syntax error intentionally (this btw was something i did b4 
 to verify that the site file was being loaded).. did it again just to be 
 thorough:
 service apache2 restart
  * Restarting web server apache2  
 [fail]
  * The apache2 configtest failed.
 Output of config test was:
 AH00526: Syntax error on line 12 of /etc/apache2/sites-enabled/yo.conf:
 Invalid command 'adding', perhaps misspelled or defined by a module not 
 included in the server configuration
 Action 'configtest' failed.
 The Apache error log may have more information.
 
 
 On Thursday, September 25, 2014 9:04:57 AM UTC-4, David Sargrad wrote:
 I am trying to follow the instructions for running the mod_wsgi hello world 
 application:
 https://code.google.com/p/modwsgi/wiki/WhereToGetHelp
 
 I installed apache2 and libapache2-mod-wsgi
 sudo apt-get install apache2
 sudo apt-get install libapache2-mod-wsgi
 
 My wsgi hello world:
 /var/www/yo/public_html# cat yo.wsgi
 def application(environ, start_response):
 status = '200 OK'
 output = 'Yo World!'
 
 response_headers = [('Content-type', 'text/plain'),
 ('Content-Length', str(len(output)))]
 
 start_response(status, response_headers)
 
 return [output]
 
 
 My virtualhost:
 /etc/apache2/sites-available# cat yo.conf
 VirtualHost *:80
 ServerName yohost
 #WSGIDaemonProcess cwpmash user=ubuntu group=ubuntu threads=5
 WSGIScriptAlias /yo /var/www/yo/public_html/yo.wsgi
 DocumentRoot /var/www/yo/public_html
 Directory /var/www/yo/public_html
 #WSGIProcessGroup cwpmash
 #WSGIApplicationGroup %{GLOBAL}
 Order allow,deny
 Allow from all
 /Directory
 /VirtualHost
 
 I've enabled info logging in apache (rather than warn).
 
 I've enabled the site:
 /etc/apache2/sites-available# ls ../sites-enabled/
 000-default.conf  yo.conf
 
 
 
 
 My apache2 error log shows the following on apache restart:
 
 [Thu Sep 25 13:04:46.211520 2014] [:info] [pid 2305:tid 139868472567680] 
 mod_wsgi (pid=2305): Destroying interpreters.
 [Thu Sep 25 13:04:46.211603 2014] [:info] [pid 2305:tid 139868472567680] 
 mod_wsgi (pid=2305): Cleanup interpreter ''.
 [Thu Sep 25 13:04:46.211907 2014] [:info] [pid 2306:tid 139868472567680] 
 mod_wsgi (pid=2306): Destroying interpreters.
 [Thu Sep 25 13:04:46.211976 2014] [:info] [pid 2306:tid 139868472567680] 
 mod_wsgi (pid=2306): Cleanup interpreter ''.
 [Thu Sep 25 13:04:46.216683 2014] [:info] [pid 2305:tid 139868472567680] 
 mod_wsgi (pid=2305): Terminating Python.
 [Thu Sep 25 13:04:46.217228 2014] [:info] [pid 2306:tid 139868472567680] 
 mod_wsgi (pid=2306): Terminating Python.
 [Thu Sep 25 13:04:46.220709 2014] [:info] [pid 2305:tid 139868472567680] 
 mod_wsgi (pid=2305): Python has shutdown.
 [Thu Sep 25 13:04:46.221243 2014] [:info] [pid 2306:tid 139868472567680] 
 mod_wsgi (pid=2306): Python has shutdown.
 [Thu Sep 25 13:04:46.226124 2014] [core:info] [pid 2302:tid 139868472567680] 
 AH00096: removed PID file /var/run/apache2/apache2.pid (pid=2302)
 [Thu Sep 25 13:04:46.226199 2014] [mpm_event:notice] [pid 2302:tid 
 139868472567680] AH00491: caught SIGTERM, shutting down
 [Thu Sep 25 13:04:47.348730 2014] [mpm_event:notice] [pid 2484:tid 
 140368719771520] AH00489: Apache/2.4.7 (Ubuntu) mod_wsgi/3.4 Python/2.7.6 
 configured -- resuming normal operations
 ...
 
 -- 
 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 modwsgi+unsubscr...@googlegroups.com.
 To post to this group, send email to modwsgi@googlegroups.com.
 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 modwsgi+unsubscr...@googlegroups.com.
To post to this group, send email to modwsgi@googlegroups.com.
Visit this group at http://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.


[modwsgi] Re: mod_wsgi hello world failing on ubuntu 14.04

2014-09-25 Thread David Sargrad
Wow.. telnet shows yo world.. 
root@sensis-8930:/etc/apache2# telnet yohost 80
Trying 127.0.1.1...
Connected to sensis-8930.corp.sensis.com.
Escape character is '^]'.
GET /yo HTTP/1.0
Host: yohost

HTTP/1.1 200 OK
Date: Thu, 25 Sep 2014 14:31:54 GMT
Server: Apache/2.4.7 (Ubuntu)
Content-Length: 9
Vary: Accept-Encoding
Connection: close
Content-Type: text/plain

Yo World!Connection closed by foreign host.




On Thursday, September 25, 2014 9:04:57 AM UTC-4, David Sargrad wrote:

 I am trying to follow the instructions for running the mod_wsgi hello 
 world application:
 https://code.google.com/p/modwsgi/wiki/WhereToGetHelp

 I installed apache2 and libapache2-mod-wsgi

 sudo apt-get install apache2
 sudo apt-get install libapache2-mod-wsgi


 My wsgi hello world:
 /var/www/yo/public_html# cat yo.wsgi
 def application(environ, start_response):
 status = '200 OK'
 output = 'Yo World!'

 response_headers = [('Content-type', 'text/plain'),
 ('Content-Length', str(len(output)))]

 start_response(status, response_headers)

 return [output]


 My virtualhost:
 /etc/apache2/sites-available# cat yo.conf
 VirtualHost *:80
 ServerName yohost
 #WSGIDaemonProcess cwpmash user=ubuntu group=ubuntu threads=5
 WSGIScriptAlias /yo /var/www/yo/public_html/yo.wsgi
 DocumentRoot /var/www/yo/public_html
 Directory /var/www/yo/public_html
 #WSGIProcessGroup cwpmash
 #WSGIApplicationGroup %{GLOBAL}
 Order allow,deny
 Allow from all
 /Directory
 /VirtualHost

 I've enabled info logging in apache (rather than warn).

 I've enabled the site:
 /etc/apache2/sites-available# ls ../sites-enabled/
 000-default.conf  yo.conf




 My apache2 error log shows the following on apache restart:

 [Thu Sep 25 13:04:46.211520 2014] [:info] [pid 2305:tid 139868472567680] 
 mod_wsgi (pid=2305): Destroying interpreters.
 [Thu Sep 25 13:04:46.211603 2014] [:info] [pid 2305:tid 139868472567680] 
 mod_wsgi (pid=2305): Cleanup interpreter ''.
 [Thu Sep 25 13:04:46.211907 2014] [:info] [pid 2306:tid 139868472567680] 
 mod_wsgi (pid=2306): Destroying interpreters.
 [Thu Sep 25 13:04:46.211976 2014] [:info] [pid 2306:tid 139868472567680] 
 mod_wsgi (pid=2306): Cleanup interpreter ''.
 [Thu Sep 25 13:04:46.216683 2014] [:info] [pid 2305:tid 139868472567680] 
 mod_wsgi (pid=2305): Terminating Python.
 [Thu Sep 25 13:04:46.217228 2014] [:info] [pid 2306:tid 139868472567680] 
 mod_wsgi (pid=2306): Terminating Python.
 [Thu Sep 25 13:04:46.220709 2014] [:info] [pid 2305:tid 139868472567680] 
 mod_wsgi (pid=2305): Python has shutdown.
 [Thu Sep 25 13:04:46.221243 2014] [:info] [pid 2306:tid 139868472567680] 
 mod_wsgi (pid=2306): Python has shutdown.
 [Thu Sep 25 13:04:46.226124 2014] [core:info] [pid 2302:tid 
 139868472567680] AH00096: removed PID file /var/run/apache2/apache2.pid (
 pid=2302)
 [Thu Sep 25 13:04:46.226199 2014] [mpm_event:notice] [pid 2302:tid 
 139868472567680] AH00491: caught SIGTERM, shutting down
 [Thu Sep 25 13:04:47.348730 2014] [mpm_event:notice] [pid 2484:tid 
 140368719771520] AH00489: Apache/2.4.7 (Ubuntu) mod_wsgi/3.4 Python/2.7.6 
 configured -- resuming normal operations
 ...

-- 
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 modwsgi+unsubscr...@googlegroups.com.
To post to this group, send email to modwsgi@googlegroups.com.
Visit this group at http://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.


[modwsgi] Re: mod_wsgi hello world failing on ubuntu 14.04

2014-09-25 Thread David Sargrad
Hmm. Ok with your suggestions, I've finally figured out the problem. It is 
indeed a problem with having the default VirtualHost enabled. I disabled 
that and voila everything works:

 a2dissite 000-default

I'm surprised that none of the tutorials that I've seen suggest this. They 
all talk about adding a virtualhost, but none seem to talk to the fact that 
this could interfere with the default virtualhost.

Anyways, Thanks for taking the time to help a noobie.

Now for the real work of getting my flask app integrated. :)


On Thursday, September 25, 2014 9:04:57 AM UTC-4, David Sargrad wrote:

 I am trying to follow the instructions for running the mod_wsgi hello 
 world application:
 https://code.google.com/p/modwsgi/wiki/WhereToGetHelp

 I installed apache2 and libapache2-mod-wsgi

 sudo apt-get install apache2
 sudo apt-get install libapache2-mod-wsgi


 My wsgi hello world:
 /var/www/yo/public_html# cat yo.wsgi
 def application(environ, start_response):
 status = '200 OK'
 output = 'Yo World!'

 response_headers = [('Content-type', 'text/plain'),
 ('Content-Length', str(len(output)))]

 start_response(status, response_headers)

 return [output]


 My virtualhost:
 /etc/apache2/sites-available# cat yo.conf
 VirtualHost *:80
 ServerName yohost
 #WSGIDaemonProcess cwpmash user=ubuntu group=ubuntu threads=5
 WSGIScriptAlias /yo /var/www/yo/public_html/yo.wsgi
 DocumentRoot /var/www/yo/public_html
 Directory /var/www/yo/public_html
 #WSGIProcessGroup cwpmash
 #WSGIApplicationGroup %{GLOBAL}
 Order allow,deny
 Allow from all
 /Directory
 /VirtualHost

 I've enabled info logging in apache (rather than warn).

 I've enabled the site:
 /etc/apache2/sites-available# ls ../sites-enabled/
 000-default.conf  yo.conf




 My apache2 error log shows the following on apache restart:

 [Thu Sep 25 13:04:46.211520 2014] [:info] [pid 2305:tid 139868472567680] 
 mod_wsgi (pid=2305): Destroying interpreters.
 [Thu Sep 25 13:04:46.211603 2014] [:info] [pid 2305:tid 139868472567680] 
 mod_wsgi (pid=2305): Cleanup interpreter ''.
 [Thu Sep 25 13:04:46.211907 2014] [:info] [pid 2306:tid 139868472567680] 
 mod_wsgi (pid=2306): Destroying interpreters.
 [Thu Sep 25 13:04:46.211976 2014] [:info] [pid 2306:tid 139868472567680] 
 mod_wsgi (pid=2306): Cleanup interpreter ''.
 [Thu Sep 25 13:04:46.216683 2014] [:info] [pid 2305:tid 139868472567680] 
 mod_wsgi (pid=2305): Terminating Python.
 [Thu Sep 25 13:04:46.217228 2014] [:info] [pid 2306:tid 139868472567680] 
 mod_wsgi (pid=2306): Terminating Python.
 [Thu Sep 25 13:04:46.220709 2014] [:info] [pid 2305:tid 139868472567680] 
 mod_wsgi (pid=2305): Python has shutdown.
 [Thu Sep 25 13:04:46.221243 2014] [:info] [pid 2306:tid 139868472567680] 
 mod_wsgi (pid=2306): Python has shutdown.
 [Thu Sep 25 13:04:46.226124 2014] [core:info] [pid 2302:tid 
 139868472567680] AH00096: removed PID file /var/run/apache2/apache2.pid (
 pid=2302)
 [Thu Sep 25 13:04:46.226199 2014] [mpm_event:notice] [pid 2302:tid 
 139868472567680] AH00491: caught SIGTERM, shutting down
 [Thu Sep 25 13:04:47.348730 2014] [mpm_event:notice] [pid 2484:tid 
 140368719771520] AH00489: Apache/2.4.7 (Ubuntu) mod_wsgi/3.4 Python/2.7.6 
 configured -- resuming normal operations
 ...

-- 
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 modwsgi+unsubscr...@googlegroups.com.
To post to this group, send email to modwsgi@googlegroups.com.
Visit this group at http://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.


[modwsgi] Re: mod_wsgi Showing more threads in htop than assigned

2014-02-19 Thread scoopseven
I just changed processes=2 threads=5 to see how long I can stay alive 
without queuing requests. htop now reports 18 threads:

10320 www-data   20   0  172M 75264  4668 S  0.0  0.9  0:57.46 mod-wsgi 
 -k start
10321 www-data   20   0  172M 75264  4668 S  0.0  0.9  1:16.62 mod-wsgi 
 -k start
10325 www-data   20   0  172M 75264  4668 S  0.0  0.9  0:03.43 mod-wsgi 
 -k start
10318 www-data   20   0  172M 75264  4668 S 42.0  0.9  1:13.23 mod-wsgi 
 -k start
10306 www-data   20   0  172M 75264  4668 S 44.0  0.9  6:04.31 mod-wsgi 
 -k start
10315 www-data   20   0  172M 75264  4668 S  0.0  0.9  0:00.00 mod-wsgi 
 -k start
10317 www-data   20   0  172M 75264  4668 S  0.0  0.9  1:12.87 mod-wsgi 
 -k start
10316 www-data   20   0  172M 75264  4668 S  0.0  0.9  0:00.13 mod-wsgi 
 -k start
10319 www-data   20   0  172M 75264  4668 S  0.0  0.9  1:14.81 mod-wsgi 
 -k start
10345 www-data   20   0  166M 70584  4988 S  0.0  0.9  0:03.41 mod-wsgi 
 -k start
10322 www-data   20   0  166M 70584  4988 S  0.0  0.9  0:00.00 mod-wsgi 
 -k start
10323 www-data   20   0  166M 70584  4988 S  0.0  0.9  0:00.14 mod-wsgi 
 -k start
10324 www-data   20   0  166M 70584  4988 S  0.0  0.9  1:04.75 mod-wsgi 
 -k start
10327 www-data   20   0  166M 70584  4988 S 31.0  0.9  1:03.30 mod-wsgi 
 -k start
10305 www-data   20   0  166M 70584  4988 S 66.0  0.9  5:30.12 mod-wsgi 
 -k start
10326 www-data   20   0  166M 70584  4988 S  0.0  0.9  1:06.65 mod-wsgi 
 -k start
10328 www-data   20   0  166M 70584  4988 S 16.0  0.9  1:05.57 mod-wsgi 
 -k start
10329 www-data   20   0  166M 70584  4988 S 19.0  0.9  1:01.67 mod-wsgi 
 -k start

So it looks like htop is reporting 9 threads per process, still 3 more than 
the 6 I would expect (1 process + 5 threads). 

On Wednesday, February 19, 2014 12:05:56 PM UTC-5, scoopseven wrote:

 This question started on SO: 
 http://serverfault.com/questions/576527/apache-processes-in-top-more-than-maxclients/576600

 I've updated my Apache config and mod_wsgi settings, but am still 
 experiencing memory creep. Here's my site conf and my apache2.conf:

 WSGIDaemonProcess mywsgi user=www-data group=www-data processes=5 
 threads=5 display-name=mod-wsgi 
 python-path=/home/admin/.virtualenvs/django/lib/python2.7/site-packages
 WSGIPythonHome /home/admin/.virtualenvs/django
 WSGIRestrictEmbedded On
 WSGILazyInitialization On

 VirtualHost 127.0.0.1:8080
 ServerName www.mysite.com
 DocumentRoot /srv/mysite
 
 SetEnvIf X-Forwarded-Protocol https HTTPS=1
 WSGIScriptAlias / /srv/mysite/system/apache/django.wsgi 
 process-group= mywsgi application-group=%{GLOBAL}
 RequestHeader add X-Queue-Start %t
 /VirtualHost

 IfModule mpm_worker_module
 StartServers 1
 ThreadsPerChild  5
 MinSpareThreads  5
 MaxSpareThreads 10
 MaxClients  25
 ServerLimit  5
 MaxRequestsPerChild  0
 MaxMemFree1024
 /IfModule

 I'm watching apache and mod_wsgi via htop and apache seems to be playing 
 by the rules, never loading more than 25 threads. It usually stays around 
 10-15 threads. We average around 5-6 requests/second monitored by 
 /server-status/. The thing that's bothering me is that I'm counting 44 
 mod_wsgi threads in htop. I assumed that since I had processes=5 threads=5 
 I would only see a maximum of 30 threads below (5 processes + 25 threads). 

 Partial htop dump:

  2249 www-data   20   0  159M 65544  4676 S 26.0  0.8  2:09.93 mod-wsgi   
-k start
  2248 www-data   20   0  164M 69040  5560 S 148.  0.8  2:10.72 mod-wsgi   
-k start
  2274 www-data   20   0  159M 65544  4676 S  0.0  0.8  0:12.58 mod-wsgi   
-k start
  2250 www-data   20   0  157M 62212  5168 S 10.0  0.7  1:50.35 mod-wsgi   
-k start
  2291 www-data   20   0  164M 69040  5560 S 41.0  0.8  0:17.07 mod-wsgi   
-k start
  2251 www-data   20   0  165M 69320  4676 S  0.0  0.8  1:59.48 mod-wsgi   
-k start
  2272 www-data   20   0  159M 65544  4676 S  0.0  0.8  0:28.67 mod-wsgi   
-k start
  2282 www-data   20   0  165M 69320  4676 S  0.0  0.8  0:33.85 mod-wsgi   
-k start
  2292 www-data   20   0  164M 69040  5560 S 28.0  0.8  0:28.08 mod-wsgi   
-k start
  2298 www-data   20   0  157M 62212  5168 S  0.0  0.7  0:14.93 mod-wsgi   
-k start
  2299 www-data   20   0  157M 62212  5168 S  1.0  0.7  0:23.71 mod-wsgi   
-k start
  2358 www-data   20   0  164M 69040  5560 S  1.0  0.8  0:02.62 mod-wsgi   
-k start
  2252 www-data   20   0  165M 70468  4660 S 41.0  0.8  1:55.85 mod-wsgi   
-k start
  2273 www-data   20   0  159M 65544  4676 S 10.0  0.8  0:29.03 mod-wsgi   
-k start
  2278 www-data   20   0  159M 65544  4676 S  1.0  0.8  0:02.79 mod-wsgi   
-k start
  2264 www-data   20   0  

[modwsgi] Re: mod_wsgi Showing more threads in htop than assigned

2014-02-19 Thread scoopseven
I left the config processes=2 threads=5 from about 12:00pm ET - 1:40pm ET 
and the capacity analysis and app reports showed lots of request queueing 
and really, really bad performance. During that time apache memory usage 
climbed from 140M-180M in NR's server monitor. Going to try flipping 
processes/threads around. Setting processes=5 threads=2 at 1:40pm ET. 
Request queuing immediately stopped and after the apache restart apache 
reports 300MB of memory usage. htop reports 30 threads. It looks like each 
process has 6 threads, when sorting by VIRT, they're all grouped together. 
There are 5 groups of 6, so I'm not sure how threads=2 is controlling 
anything. Each process looks like it's consuming 130M-160M of memory. Not 
sure why these processes don't show up on the NR server monitor report as 
mod_wsgi, or why I can't differentiate them from apache2 
(https://rpm.newrelic.com/accounts/67402/servers/113/processes#id=152494639).

PID USER  PRI  NI  VIRT   RES   SHR S CPU% MEM%   TIME+  Command
20212 www-data   20   0  136M 64604  4664 S  0.0  0.8  0:00.00 mod-wsgi 
 -k start
20213 www-data   20   0  136M 64604  4664 S  0.0  0.8  0:00.14 mod-wsgi 
 -k start
20214 www-data   20   0  136M 64604  4664 S 51.0  0.8  1:14.28 mod-wsgi 
 -k start
20215 www-data   20   0  136M 64604  4664 S 33.0  0.8  1:18.60 mod-wsgi 
 -k start
20240 www-data   20   0  136M 64604  4664 S  1.0  0.8  0:03.85 mod-wsgi 
 -k start
20179 www-data   20   0  136M 64604  4664 S 86.0  0.8  2:39.99 mod-wsgi 
 -k start
20203 www-data   20   0  131M 61340  4672 S  0.0  0.7  0:00.00 mod-wsgi 
 -k start
20204 www-data   20   0  131M 61340  4672 S  0.0  0.7  0:00.26 mod-wsgi 
 -k start
20205 www-data   20   0  131M 61340  4672 S 19.0  0.7  1:21.73 mod-wsgi 
 -k start
20206 www-data   20   0  131M 61340  4672 S 26.0  0.7  1:23.35 mod-wsgi 
 -k start
20207 www-data   20   0  131M 61340  4672 S  0.0  0.7  0:04.20 mod-wsgi 
 -k start
20177 www-data   20   0  131M 61340  4672 S 46.0  0.7  2:52.40 mod-wsgi 
 -k start
20196 www-data   20   0  131M 59552  4668 S  0.0  0.7  0:00.00 mod-wsgi 
 -k start
20197 www-data   20   0  131M 59552  4668 S  0.0  0.7  0:00.16 mod-wsgi 
 -k start
20198 www-data   20   0  131M 59552  4668 S 13.0  0.7  1:16.92 mod-wsgi 
 -k start
20199 www-data   20   0  131M 59552  4668 S 16.0  0.7  1:14.32 mod-wsgi 
 -k start
20200 www-data   20   0  131M 59552  4668 S  0.0  0.7  0:03.91 mod-wsgi 
 -k start
20175 www-data   20   0  131M 59552  4668 S 30.0  0.7  2:38.28 mod-wsgi 
 -k start
20227 www-data   20   0  130M 60680  4664 S  0.0  0.7  0:00.00 mod-wsgi 
 -k start
20228 www-data   20   0  130M 60680  4664 S  0.0  0.7  0:00.22 mod-wsgi 
 -k start
20229 www-data   20   0  130M 60680  4664 S 14.0  0.7  1:22.35 mod-wsgi 
 -k start
20230 www-data   20   0  130M 60680  4664 S 12.0  0.7  1:23.82 mod-wsgi 
 -k start
20241 www-data   20   0  130M 60680  4664 S  0.0  0.7  0:04.09 mod-wsgi 
 -k start
20178 www-data   20   0  130M 60680  4664 S 28.0  0.7  2:53.50 mod-wsgi 
 -k start
20188 www-data   20   0  132M 61232  4672 S  0.0  0.7  0:00.00 mod-wsgi 
 -k start
20189 www-data   20   0  132M 61232  4672 S  0.0  0.7  0:00.17 mod-wsgi 
 -k start
20190 www-data   20   0  132M 61232  4672 S 45.0  0.7  1:14.18 mod-wsgi 
 -k start
20191 www-data   20   0  132M 61232  4672 S 75.0  0.7  1:25.57 mod-wsgi 
 -k start
20192 www-data   20   0  132M 61232  4672 S  1.0  0.7  0:04.33 mod-wsgi 
 -k start
20176 www-data   20   0  132M 61232  4672 S 122.  0.7  2:47.90 mod-wsgi 
 -k start

On Wednesday, February 19, 2014 12:05:56 PM UTC-5, scoopseven wrote:

 This question started on SO: 
 http://serverfault.com/questions/576527/apache-processes-in-top-more-than-maxclients/576600

 I've updated my Apache config and mod_wsgi settings, but am still 
 experiencing memory creep. Here's my site conf and my apache2.conf:

 WSGIDaemonProcess mywsgi user=www-data group=www-data processes=5 
 threads=5 display-name=mod-wsgi 
 python-path=/home/admin/.virtualenvs/django/lib/python2.7/site-packages
 WSGIPythonHome /home/admin/.virtualenvs/django
 WSGIRestrictEmbedded On
 WSGILazyInitialization On

 VirtualHost 127.0.0.1:8080
 ServerName www.mysite.com
 DocumentRoot /srv/mysite
 
 SetEnvIf X-Forwarded-Protocol https HTTPS=1
 WSGIScriptAlias / /srv/mysite/system/apache/django.wsgi 
 process-group= mywsgi application-group=%{GLOBAL}
 RequestHeader add X-Queue-Start %t
 /VirtualHost

 IfModule mpm_worker_module
 StartServers 1
 ThreadsPerChild  5
 MinSpareThreads  5
 MaxSpareThreads 10
 MaxClients  25
 ServerLimit  5
 MaxRequestsPerChild  0
 MaxMemFree1024
 /IfModule

 I'm watching apache and 

[modwsgi] Re: mod_wsgi Showing more threads in htop than assigned

2014-02-19 Thread scoopseven
Just discovered htop tree view. With processes=5 threads=2 I wouldn't 
expect to see 5 threads under each process. Memory for one of these 
processes has ballooned to 283M. Eventually when all 5 of them get there, 
that means I'll be using 1.5G of ram for mod_wsgi. 

20179 www-data   20   0  147M 76408  5680 S 28.0  0.9 10:17.85 │  ├─ 
mod-wsgi  -k start
20240 www-data   20   0  147M 76408  5680 S  1.0  0.9  0:14.99 │  │  ├─ 
mod-wsgi  -k start
20215 www-data   20   0  147M 76408  5680 S 12.0  0.9  5:05.16 │  │  ├─ 
mod-wsgi  -k start
20214 www-data   20   0  147M 76408  5680 S 14.0  0.9  4:53.99 │  │  ├─ 
mod-wsgi  -k start
20213 www-data   20   0  147M 76408  5680 S  0.0  0.9  0:00.63 │  │  ├─ 
mod-wsgi  -k start
20212 www-data   20   0  147M 76408  5680 S  0.0  0.9  0:00.00 │  │  └─ 
mod-wsgi  -k start
20178 www-data   20   0  138M 67680  5212 S 52.0  0.8 11:01.62 │  ├─ 
mod-wsgi  -k start
20241 www-data   20   0  138M 67680  5212 S  0.0  0.8  0:15.45 │  │  ├─ 
mod-wsgi  -k start
20230 www-data   20   0  138M 67680  5212 S 15.0  0.8  5:17.81 │  │  ├─ 
mod-wsgi  -k start
20229 www-data   20   0  138M 67680  5212 S 35.0  0.8  5:24.63 │  │  ├─ 
mod-wsgi  -k start
20228 www-data   20   0  138M 67680  5212 S  0.0  0.8  0:00.71 │  │  ├─ 
mod-wsgi  -k start
20227 www-data   20   0  138M 67680  5212 S  0.0  0.8  0:00.00 │  │  └─ 
mod-wsgi  -k start
20177 www-data   20   0  137M 67764  5428 S  7.0  0.8 10:47.27 │  ├─ 
mod-wsgi  -k start
20207 www-data   20   0  137M 67764  5428 S  0.0  0.8  0:15.18 │  │  ├─ 
mod-wsgi  -k start
20206 www-data   20   0  137M 67764  5428 S  7.0  0.8  5:16.82 │  │  ├─ 
mod-wsgi  -k start
20205 www-data   20   0  137M 67764  5428 S  0.0  0.8  5:11.55 │  │  ├─ 
mod-wsgi  -k start
20204 www-data   20   0  137M 67764  5428 S  0.0  0.8  0:00.69 │  │  ├─ 
mod-wsgi  -k start
20203 www-data   20   0  137M 67764  5428 S  0.0  0.8  0:00.00 │  │  └─ 
mod-wsgi  -k start
20176 www-data   20   0  138M 68144  5004 S 48.0  0.8 10:47.64 │  ├─ 
mod-wsgi  -k start
20192 www-data   20   0  138M 68144  5004 S  1.0  0.8  0:15.62 │  │  ├─ 
mod-wsgi  -k start
20191 www-data   20   0  138M 68144  5004 S 15.0  0.8  5:25.78 │  │  ├─ 
mod-wsgi  -k start
20190 www-data   20   0  138M 68144  5004 S 31.0  0.8  5:02.00 │  │  ├─ 
mod-wsgi  -k start
20189 www-data   20   0  138M 68144  5004 S  0.0  0.8  0:00.60 │  │  ├─ 
mod-wsgi  -k start
20188 www-data   20   0  138M 68144  5004 S  0.0  0.8  0:00.00 │  │  └─ 
mod-wsgi  -k start
20175 www-data   20   0  283M  197M  5540 S 72.0  2.4 12:24.34 │  └─ 
mod-wsgi  -k start
20200 www-data   20   0  283M  197M  5540 S  0.0  2.4  0:14.62 │ ├─ 
mod-wsgi  -k start
20199 www-data   20   0  283M  197M  5540 S 22.0  2.4  5:25.50 │ ├─ 
mod-wsgi  -k start
20198 www-data   20   0  283M  197M  5540 S 50.0  2.4  6:40.60 │ ├─ 
mod-wsgi  -k start
20197 www-data   20   0  283M  197M  5540 S  0.0  2.4  0:00.69 │ ├─ 
mod-wsgi  -k start
20196 www-data   20   0  283M  197M  5540 S  0.0  2.4  0:00.00 │ └─ 
mod-wsgi  -k start


On Wednesday, February 19, 2014 12:05:56 PM UTC-5, scoopseven wrote:

 This question started on SO: 
 http://serverfault.com/questions/576527/apache-processes-in-top-more-than-maxclients/576600

 I've updated my Apache config and mod_wsgi settings, but am still 
 experiencing memory creep. Here's my site conf and my apache2.conf:

 WSGIDaemonProcess mywsgi user=www-data group=www-data processes=5 
 threads=5 display-name=mod-wsgi 
 python-path=/home/admin/.virtualenvs/django/lib/python2.7/site-packages
 WSGIPythonHome /home/admin/.virtualenvs/django
 WSGIRestrictEmbedded On
 WSGILazyInitialization On

 VirtualHost 127.0.0.1:8080
 ServerName www.mysite.com
 DocumentRoot /srv/mysite
 
 SetEnvIf X-Forwarded-Protocol https HTTPS=1
 WSGIScriptAlias / /srv/mysite/system/apache/django.wsgi 
 process-group= mywsgi application-group=%{GLOBAL}
 RequestHeader add X-Queue-Start %t
 /VirtualHost

 IfModule mpm_worker_module
 StartServers 1
 ThreadsPerChild  5
 MinSpareThreads  5
 MaxSpareThreads 10
 MaxClients  25
 ServerLimit  5
 MaxRequestsPerChild  0
 MaxMemFree1024
 /IfModule

 I'm watching apache and mod_wsgi via htop and apache seems to be playing 
 by the rules, never loading more than 25 threads. It usually stays around 
 10-15 threads. We average around 5-6 requests/second monitored by 
 /server-status/. The thing that's bothering me is that I'm counting 44 
 mod_wsgi threads in htop. I assumed that since I had processes=5 threads=5 
 I would only see a maximum of 30 threads below (5 processes + 25 threads). 

 Partial htop dump:

  2249 www-data   20   0  159M 65544  4676 S 26.0  0.8  

[modwsgi] Re: mod_wsgi Showing more threads in htop than assigned

2014-02-19 Thread scoopseven
After monitoring the wsgi processes for some time I noticed one of the 
processes consumed 585M of memory. Ouch. if all 5 processes consumed that 
much, the server would be approaching 3G of memory used by mod_wsgi. After 
looking through the mod_wsgi config parameters 
(https://code.google.com/p/modwsgi/wiki/ConfigurationDirectives) I 
discovered *maximum-requests *and *inactivity-timeout. *I added these 
parameters to my mod_wsgi directive now looks like this:

WSGIDaemonProcess mywsgi user=www-data group=www-data processes=5 threads=2 
inactivity-timeout=300 maximum-requests=200 display-name=mod-wsgi 
python-path=/home/admin/.virtualenvs/django/lib/python2.7/site-packages 

Now, no matter how much memory my app makes mod_wsgi consume, the processes 
are restarted after 5 minutes of inactivity or 200 requests. I'll probably 
play with that number so that processes aren't being restarted all of the 
time but I can maintain a consistent memory footprint. In any case, the 
problem is solved. My app has a massive footprint (at least one django view 
does) but now I'm able to control it by recycling mod_wsgi processes. Hope 
this helps someone else out there. 

On Wednesday, February 19, 2014 12:05:56 PM UTC-5, scoopseven wrote:

 This question started on SO: 
 http://serverfault.com/questions/576527/apache-processes-in-top-more-than-maxclients/576600

 I've updated my Apache config and mod_wsgi settings, but am still 
 experiencing memory creep. Here's my site conf and my apache2.conf:

 WSGIDaemonProcess mywsgi user=www-data group=www-data processes=5 
 threads=5 display-name=mod-wsgi 
 python-path=/home/admin/.virtualenvs/django/lib/python2.7/site-packages
 WSGIPythonHome /home/admin/.virtualenvs/django
 WSGIRestrictEmbedded On
 WSGILazyInitialization On

 VirtualHost 127.0.0.1:8080
 ServerName www.mysite.com
 DocumentRoot /srv/mysite
 
 SetEnvIf X-Forwarded-Protocol https HTTPS=1
 WSGIScriptAlias / /srv/mysite/system/apache/django.wsgi 
 process-group= mywsgi application-group=%{GLOBAL}
 RequestHeader add X-Queue-Start %t
 /VirtualHost

 IfModule mpm_worker_module
 StartServers 1
 ThreadsPerChild  5
 MinSpareThreads  5
 MaxSpareThreads 10
 MaxClients  25
 ServerLimit  5
 MaxRequestsPerChild  0
 MaxMemFree1024
 /IfModule

 I'm watching apache and mod_wsgi via htop and apache seems to be playing 
 by the rules, never loading more than 25 threads. It usually stays around 
 10-15 threads. We average around 5-6 requests/second monitored by 
 /server-status/. The thing that's bothering me is that I'm counting 44 
 mod_wsgi threads in htop. I assumed that since I had processes=5 threads=5 
 I would only see a maximum of 30 threads below (5 processes + 25 threads). 

 Partial htop dump:

  2249 www-data   20   0  159M 65544  4676 S 26.0  0.8  2:09.93 mod-wsgi   
-k start
  2248 www-data   20   0  164M 69040  5560 S 148.  0.8  2:10.72 mod-wsgi   
-k start
  2274 www-data   20   0  159M 65544  4676 S  0.0  0.8  0:12.58 mod-wsgi   
-k start
  2250 www-data   20   0  157M 62212  5168 S 10.0  0.7  1:50.35 mod-wsgi   
-k start
  2291 www-data   20   0  164M 69040  5560 S 41.0  0.8  0:17.07 mod-wsgi   
-k start
  2251 www-data   20   0  165M 69320  4676 S  0.0  0.8  1:59.48 mod-wsgi   
-k start
  2272 www-data   20   0  159M 65544  4676 S  0.0  0.8  0:28.67 mod-wsgi   
-k start
  2282 www-data   20   0  165M 69320  4676 S  0.0  0.8  0:33.85 mod-wsgi   
-k start
  2292 www-data   20   0  164M 69040  5560 S 28.0  0.8  0:28.08 mod-wsgi   
-k start
  2298 www-data   20   0  157M 62212  5168 S  0.0  0.7  0:14.93 mod-wsgi   
-k start
  2299 www-data   20   0  157M 62212  5168 S  1.0  0.7  0:23.71 mod-wsgi   
-k start
  2358 www-data   20   0  164M 69040  5560 S  1.0  0.8  0:02.62 mod-wsgi   
-k start
  2252 www-data   20   0  165M 70468  4660 S 41.0  0.8  1:55.85 mod-wsgi   
-k start
  2273 www-data   20   0  159M 65544  4676 S 10.0  0.8  0:29.03 mod-wsgi   
-k start
  2278 www-data   20   0  159M 65544  4676 S  1.0  0.8  0:02.79 mod-wsgi   
-k start
  2264 www-data   20   0  165M 70468  4660 S  0.0  0.8  0:07.50 mod-wsgi   
-k start
  2266 www-data   20   0  165M 70468  4660 S 25.0  0.8  0:39.49 mod-wsgi   
-k start
  2300 www-data   20   0  157M 62212  5168 S  6.0  0.7  0:28.78 mod-wsgi   
-k start
  2265 www-data   20   0  165M 70468  4660 S 15.0  0.8  0:31.44 mod-wsgi   
-k start
  2294 www-data   20   0  164M 69040  5560 R 54.0  0.8  0:34.82 mod-wsgi   
-k start
  2279 www-data   20   0  165M 69320  4676 S  0.0  0.8  0:32.63 mod-wsgi   
-k start
  2297 www-data   20   0  157M 62212  5168 S  3.0  0.7  0:09.68 mod-wsgi   
-k start
  2302 www-data   20   0  157M 62212  5168 S  0.0  0.7  0:27.62 mod-wsgi   
-k 

[modwsgi] Re: mod_wsgi Showing more threads in htop than assigned

2014-02-19 Thread scoopseven
Graham, I'm still not sure why with processes=5 threads=2 I see 5 threads 
for each process for mod_wsgi in htop. If you could explain that last 
little hanging chad it would be great. Thanks!

Updated SO with summary of 
solution: 
http://serverfault.com/questions/576527/apache-processes-in-top-more-than-maxclients

Mark


On Wednesday, February 19, 2014 12:05:56 PM UTC-5, scoopseven wrote:

 This question started on SO: 
 http://serverfault.com/questions/576527/apache-processes-in-top-more-than-maxclients/576600

 I've updated my Apache config and mod_wsgi settings, but am still 
 experiencing memory creep. Here's my site conf and my apache2.conf:

 WSGIDaemonProcess mywsgi user=www-data group=www-data processes=5 
 threads=5 display-name=mod-wsgi 
 python-path=/home/admin/.virtualenvs/django/lib/python2.7/site-packages
 WSGIPythonHome /home/admin/.virtualenvs/django
 WSGIRestrictEmbedded On
 WSGILazyInitialization On

 VirtualHost 127.0.0.1:8080
 ServerName www.mysite.com
 DocumentRoot /srv/mysite
 
 SetEnvIf X-Forwarded-Protocol https HTTPS=1
 WSGIScriptAlias / /srv/mysite/system/apache/django.wsgi 
 process-group= mywsgi application-group=%{GLOBAL}
 RequestHeader add X-Queue-Start %t
 /VirtualHost

 IfModule mpm_worker_module
 StartServers 1
 ThreadsPerChild  5
 MinSpareThreads  5
 MaxSpareThreads 10
 MaxClients  25
 ServerLimit  5
 MaxRequestsPerChild  0
 MaxMemFree1024
 /IfModule

 I'm watching apache and mod_wsgi via htop and apache seems to be playing 
 by the rules, never loading more than 25 threads. It usually stays around 
 10-15 threads. We average around 5-6 requests/second monitored by 
 /server-status/. The thing that's bothering me is that I'm counting 44 
 mod_wsgi threads in htop. I assumed that since I had processes=5 threads=5 
 I would only see a maximum of 30 threads below (5 processes + 25 threads). 

 Partial htop dump:

  2249 www-data   20   0  159M 65544  4676 S 26.0  0.8  2:09.93 mod-wsgi   
-k start
  2248 www-data   20   0  164M 69040  5560 S 148.  0.8  2:10.72 mod-wsgi   
-k start
  2274 www-data   20   0  159M 65544  4676 S  0.0  0.8  0:12.58 mod-wsgi   
-k start
  2250 www-data   20   0  157M 62212  5168 S 10.0  0.7  1:50.35 mod-wsgi   
-k start
  2291 www-data   20   0  164M 69040  5560 S 41.0  0.8  0:17.07 mod-wsgi   
-k start
  2251 www-data   20   0  165M 69320  4676 S  0.0  0.8  1:59.48 mod-wsgi   
-k start
  2272 www-data   20   0  159M 65544  4676 S  0.0  0.8  0:28.67 mod-wsgi   
-k start
  2282 www-data   20   0  165M 69320  4676 S  0.0  0.8  0:33.85 mod-wsgi   
-k start
  2292 www-data   20   0  164M 69040  5560 S 28.0  0.8  0:28.08 mod-wsgi   
-k start
  2298 www-data   20   0  157M 62212  5168 S  0.0  0.7  0:14.93 mod-wsgi   
-k start
  2299 www-data   20   0  157M 62212  5168 S  1.0  0.7  0:23.71 mod-wsgi   
-k start
  2358 www-data   20   0  164M 69040  5560 S  1.0  0.8  0:02.62 mod-wsgi   
-k start
  2252 www-data   20   0  165M 70468  4660 S 41.0  0.8  1:55.85 mod-wsgi   
-k start
  2273 www-data   20   0  159M 65544  4676 S 10.0  0.8  0:29.03 mod-wsgi   
-k start
  2278 www-data   20   0  159M 65544  4676 S  1.0  0.8  0:02.79 mod-wsgi   
-k start
  2264 www-data   20   0  165M 70468  4660 S  0.0  0.8  0:07.50 mod-wsgi   
-k start
  2266 www-data   20   0  165M 70468  4660 S 25.0  0.8  0:39.49 mod-wsgi   
-k start
  2300 www-data   20   0  157M 62212  5168 S  6.0  0.7  0:28.78 mod-wsgi   
-k start
  2265 www-data   20   0  165M 70468  4660 S 15.0  0.8  0:31.44 mod-wsgi   
-k start
  2294 www-data   20   0  164M 69040  5560 R 54.0  0.8  0:34.82 mod-wsgi   
-k start
  2279 www-data   20   0  165M 69320  4676 S  0.0  0.8  0:32.63 mod-wsgi   
-k start
  2297 www-data   20   0  157M 62212  5168 S  3.0  0.7  0:09.68 mod-wsgi   
-k start
  2302 www-data   20   0  157M 62212  5168 S  0.0  0.7  0:27.62 mod-wsgi   
-k start
  2323 www-data   20   0  157M 62212  5168 S  0.0  0.7  0:02.56 mod-wsgi   
-k start
  2280 www-data   20   0  165M 69320  4676 S  0.0  0.8  0:13.00 mod-wsgi   
-k start
  2263 www-data   20   0  165M 70468  4660 S  0.0  0.8  0:19.35 mod-wsgi   
-k start
  2322 www-data   20   0  165M 69320  4676 S  0.0  0.8  0:03.05 mod-wsgi   
-k start
  2275 www-data   20   0  165M 70468  4660 S  0.0  0.8  0:02.72 mod-wsgi   
-k start
  2285 www-data   20   0  164M 69040  5560 S  0.0  0.8  0:00.00 mod-wsgi   
-k start
  2288 www-data   20   0  164M 69040  5560 S  0.0  0.8  0:00.11 mod-wsgi   
-k start
  2290 www-data   20   0  164M 69040  5560 S  4.0  0.8  0:15.66 mod-wsgi   
-k start
  2293 www-data   20   0  164M 69040  5560 S 20.0  0.8  0:29.01 mod-wsgi   
-k start
  2268 

[modwsgi] Re: mod_wsgi Showing more threads in htop than assigned

2014-02-19 Thread scoopseven
Thank you, Graham. This information is invaluable. 

Mark

On Wednesday, February 19, 2014 12:05:56 PM UTC-5, scoopseven wrote:

 This question started on SO: 
 http://serverfault.com/questions/576527/apache-processes-in-top-more-than-maxclients/576600

 I've updated my Apache config and mod_wsgi settings, but am still 
 experiencing memory creep. Here's my site conf and my apache2.conf:

 WSGIDaemonProcess mywsgi user=www-data group=www-data processes=5 
 threads=5 display-name=mod-wsgi 
 python-path=/home/admin/.virtualenvs/django/lib/python2.7/site-packages
 WSGIPythonHome /home/admin/.virtualenvs/django
 WSGIRestrictEmbedded On
 WSGILazyInitialization On

 VirtualHost 127.0.0.1:8080
 ServerName www.mysite.com
 DocumentRoot /srv/mysite
 
 SetEnvIf X-Forwarded-Protocol https HTTPS=1
 WSGIScriptAlias / /srv/mysite/system/apache/django.wsgi 
 process-group= mywsgi application-group=%{GLOBAL}
 RequestHeader add X-Queue-Start %t
 /VirtualHost

 IfModule mpm_worker_module
 StartServers 1
 ThreadsPerChild  5
 MinSpareThreads  5
 MaxSpareThreads 10
 MaxClients  25
 ServerLimit  5
 MaxRequestsPerChild  0
 MaxMemFree1024
 /IfModule

 I'm watching apache and mod_wsgi via htop and apache seems to be playing 
 by the rules, never loading more than 25 threads. It usually stays around 
 10-15 threads. We average around 5-6 requests/second monitored by 
 /server-status/. The thing that's bothering me is that I'm counting 44 
 mod_wsgi threads in htop. I assumed that since I had processes=5 threads=5 
 I would only see a maximum of 30 threads below (5 processes + 25 threads). 

 Partial htop dump:

  2249 www-data   20   0  159M 65544  4676 S 26.0  0.8  2:09.93 mod-wsgi   
-k start
  2248 www-data   20   0  164M 69040  5560 S 148.  0.8  2:10.72 mod-wsgi   
-k start
  2274 www-data   20   0  159M 65544  4676 S  0.0  0.8  0:12.58 mod-wsgi   
-k start
  2250 www-data   20   0  157M 62212  5168 S 10.0  0.7  1:50.35 mod-wsgi   
-k start
  2291 www-data   20   0  164M 69040  5560 S 41.0  0.8  0:17.07 mod-wsgi   
-k start
  2251 www-data   20   0  165M 69320  4676 S  0.0  0.8  1:59.48 mod-wsgi   
-k start
  2272 www-data   20   0  159M 65544  4676 S  0.0  0.8  0:28.67 mod-wsgi   
-k start
  2282 www-data   20   0  165M 69320  4676 S  0.0  0.8  0:33.85 mod-wsgi   
-k start
  2292 www-data   20   0  164M 69040  5560 S 28.0  0.8  0:28.08 mod-wsgi   
-k start
  2298 www-data   20   0  157M 62212  5168 S  0.0  0.7  0:14.93 mod-wsgi   
-k start
  2299 www-data   20   0  157M 62212  5168 S  1.0  0.7  0:23.71 mod-wsgi   
-k start
  2358 www-data   20   0  164M 69040  5560 S  1.0  0.8  0:02.62 mod-wsgi   
-k start
  2252 www-data   20   0  165M 70468  4660 S 41.0  0.8  1:55.85 mod-wsgi   
-k start
  2273 www-data   20   0  159M 65544  4676 S 10.0  0.8  0:29.03 mod-wsgi   
-k start
  2278 www-data   20   0  159M 65544  4676 S  1.0  0.8  0:02.79 mod-wsgi   
-k start
  2264 www-data   20   0  165M 70468  4660 S  0.0  0.8  0:07.50 mod-wsgi   
-k start
  2266 www-data   20   0  165M 70468  4660 S 25.0  0.8  0:39.49 mod-wsgi   
-k start
  2300 www-data   20   0  157M 62212  5168 S  6.0  0.7  0:28.78 mod-wsgi   
-k start
  2265 www-data   20   0  165M 70468  4660 S 15.0  0.8  0:31.44 mod-wsgi   
-k start
  2294 www-data   20   0  164M 69040  5560 R 54.0  0.8  0:34.82 mod-wsgi   
-k start
  2279 www-data   20   0  165M 69320  4676 S  0.0  0.8  0:32.63 mod-wsgi   
-k start
  2297 www-data   20   0  157M 62212  5168 S  3.0  0.7  0:09.68 mod-wsgi   
-k start
  2302 www-data   20   0  157M 62212  5168 S  0.0  0.7  0:27.62 mod-wsgi   
-k start
  2323 www-data   20   0  157M 62212  5168 S  0.0  0.7  0:02.56 mod-wsgi   
-k start
  2280 www-data   20   0  165M 69320  4676 S  0.0  0.8  0:13.00 mod-wsgi   
-k start
  2263 www-data   20   0  165M 70468  4660 S  0.0  0.8  0:19.35 mod-wsgi   
-k start
  2322 www-data   20   0  165M 69320  4676 S  0.0  0.8  0:03.05 mod-wsgi   
-k start
  2275 www-data   20   0  165M 70468  4660 S  0.0  0.8  0:02.72 mod-wsgi   
-k start
  2285 www-data   20   0  164M 69040  5560 S  0.0  0.8  0:00.00 mod-wsgi   
-k start
  2288 www-data   20   0  164M 69040  5560 S  0.0  0.8  0:00.11 mod-wsgi   
-k start
  2290 www-data   20   0  164M 69040  5560 S  4.0  0.8  0:15.66 mod-wsgi   
-k start
  2293 www-data   20   0  164M 69040  5560 S 20.0  0.8  0:29.01 mod-wsgi   
-k start
  2268 www-data   20   0  159M 65544  4676 S  0.0  0.8  0:00.00 mod-wsgi   
-k start
  2269 www-data   20   0  159M 65544  4676 S  0.0  0.8  0:00.11 mod-wsgi   
-k start
  2270 www-data   20   0  159M 65544  4676 S 15.0  0.8  0:26.62 mod-wsgi   
-k start

[modwsgi] Re: mod_wsgi: Possible enhancement: making log level adjustable per message

2012-11-20 Thread elwynd
[Moved to Google Group from private email]

Thanks for the response Graham.

Yes, the standalone version makes use of Python logging.  It seemed that it 
was adding an
additional and potentially unnecessary layer to use Python logging on top 
of the existing
Apache multilevel logging given that Apache logging has the leveling needed.

Is there anything inherently difficult or undesirable to making the Apache 
logging level
control accessible that I haven't spotted?  Threading comes to mind if the 
level setting
is not in the actual log write method - I am not sure whether the 
wsgi.errors logger is 
per-thread or shared in a multiple thread per-process situation.

Regards,
Elwyn

 

 Are you using:

 http://docs.python.org/2/library/logging.html

 It provides log levels and the output of what does get through can still be
 sent to stderr and captured in the Apache error log.

 The logging module should be used in preference to using wsgi.errors.

 The only cosmetic issue is that in the Apache error log everything shows as
 at error level that goes to stdout/stderr. This is something that can't be
 changed.

 To see the proper log level you can still set the logging module logger
 message format to include the logging module log level. It will end up
 being part of the logged message. Thus the entries in the Apache error log
 might end up looking like:

 [Fri Nov 16 05:02:40 2012] [error] 2012-11-16 05:02:40,095 (5010/Dummy-6)
 newrelic.core.agent INFO - New Relic Python Agent Shutdown
 [Fri Nov 16 05:02:40 2012] [error] 2012-11-16 05:02:40,119
 (5010/NR-Harvest-Thread) newrelic.core.agent DEBUG - Commencing harvest of
 all application data and forcing a shutdown at the same time.

 In this case the log format was still including its own date/time stamp,but
 you could drop that to make it more compact.

 BTW, can you use the mod_wsgi mailing list in future.


 http://code.google.com/p/modwsgi/wiki/WhereToGetHelp?tm=6#Asking_Your_Questions

 Thanks.

 Graham





 On 20 November 2012 08:06, Elwyn Davies davie...@scss.tcd.ie wrote:

  Hi.
 
  I am just starting out with mod_wsgi.
 
  I have an existing application which is currently running using a basic
  BaseHTTPServer/BaseHTTPHandler with a Python logger in a standalone
  program.  I am now moving the code to run as a mod_wsgi module.
 
  The code contains extensive logging both for debugging and monitoring
  using multiple logging levels to tune the amount of output according to 
 my
  confidence in the code.  I would like to be able to set the logging level
  for each logged message.  As I understand mod_wsgi the 'wsgi.errors'
  logging object has a fixed logging level, so that whilst I can control
  whether any messages from the mod_wsgi application are logged by Apache
  using the log level setting in Apache, this is rather a blunt instrument.
 
  Having had a quick look at the code, it looks as if it would be very easy
  to add a getter/setter pair to allow adjustment of the 'level' value in 
 the
  log structure.
 
  Would this be an effective and sane enhancement?  I have some code that I
  am currently trying out - not exactly a difficult mod!
 
  Regards,
  Elwyn Davies
  Folly Consulting/Trinity College Dublin
 
 



-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/modwsgi/-/yKcQ7J7HJ6kJ.
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] Re: mod_wsgi prevents apache start following update

2012-10-07 Thread Jake
Hi Graham

I have carried out the make install now and when I run the otool on the 
installed mod_wsgi.so I get the following result;

mod_wsgi.so:
/Library/Frameworks/Python.framework/Versions/3.2/Python (compatibility 
version 3.2.0, current version 3.2.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 
169.3.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation 
(compatibility version 150.0.0, current version 744.12.0)

I guess that this is correct now and apache restarts without causing 
errors. Now just to configure httpd.conf and my virtual hosts then I can 
get on with playing and finding out how to take advantage of mod_wsgi over 
mod_python.

Thanks for your help.

Jake

On Friday, October 5, 2012 11:54:47 PM UTC+1, Graham Dumpleton wrote:

 With otool -L showing the correct result, what then was the result 
 when you tried to actually use it with Apache??? 

 If there is still a run time linking issue causing Apache not to 
 start, you can usually see the error by running: 

   sudo /usr/sbin/apachectl -t 

 It will show any linker error as output immediately. 

 Graham 

 On 6 October 2012 05:31, Jake jake.g...@realspaces.com javascript: 
 wrote: 
  With Mountain lion it comes with versions 2.3, 2.5, 2.6,  2.7. These 
 are 
  installed as you have correctly stated however the installation is a 
 little 
  different compared to a linux installation. 
  
  The version 3.2 that I have installed is from the python site at the 
  following location http://www.python.org/download/releases/3.2.3/. I 
 took 
  the osx 64bit installer. 
  
  The installation location is as per the installer. 
  
  Jake 
  
  On Friday, October 5, 2012 1:42:28 AM UTC+1, Graham Dumpleton wrote: 
  
  The output is correct, although one thing worried me. 
  
  Can you confirm that you manually installed Python 3.2, because a 
  system Python wouldn't be under: 
  
/Library/Frameworks/Python.framework 
  
  What Python versions are under: 
  
/System/Library/Frameworks/Python.framework/Versions 
  
  I ask as I am not sure what ships with Mountain Lion. 
  
  Also, if Python 3.2 was installed manually, did you use the Python 
  Software Foundation binary installer or one from somewhere else. The 
  PSF installer is notorious for requiring --disable-framework option 
  and I don't know what they do differently when building it to break 
  normal framework linking. 
  
  Graham 
  
  On 5 October 2012 07:39, Jake jake.g...@realspaces.com wrote: 
   Graham 
   
   These are the steps that I followed and the output I received; 
   1. 
   ./configure 
   
   
 --with-python=/Library/Frameworks/Python.framework/Versions/3.2/bin/python3 
   --disable-framework 
   2. 
   make 
   3. 
   cd .libs 
   4. 
   otool -L mod_wsgi.so 
   
   Output 
   mod_wsgi.so: 
   /Library/Frameworks/Python.framework/Versions/3.2/Python 
 (compatibility 
   version 3.2.0, current version 3.2.0) 
   /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current 
 version 
   169.3.0) 
   
   
 /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation 

   (compatibility version 150.0.0, current version 744.12.0) 
   
   Is this the correct output??? 
   
   Best regards 
   
   Jake 
   
   
   On Wednesday, October 3, 2012 10:55:45 PM UTC+1, Graham Dumpleton 
 wrote: 
   
   The output you gave showed: 
   
   hostname:mod_wsgi-3.4 user$ make 
   make: Nothing to be done for `all'. 
   
   which indicated that make had already been run in the directory 
 again. 
   
   From that fresh source code, do the configure and make and then run: 
   
 otool -L .libs/mod_wsgi.so 
   
   without doing an install. 
   
   See what the local .so file is before anything gets installed. 
   
   Graham 
   
   On 4 October 2012 06:33, Jake jake.g...@realspaces.com wrote: 
I  had deleted the previous download and started with a clean one. 
Not 
sure 
if the 'make distclean' will do anything. 

I ran it anyway and got the following ; 

make: *** No rule to make target `distclean'.  Stop. 

Which I think is to be expected. 


On Wednesday, October 3, 2012 12:02:16 AM UTC+1, Jake wrote: 

Hi 

Until recently I have developing in python using mod_python but 
decided 
to 
upgrade to mod_wsgi when I upgraded from os snow leopard to 
 mountain 
lion. 

I have followed the instructions and when I restart apache it 
 fails 
to 
start up. To throw things into the mix I am trying to run 
 mod_wsgi 
on 
python 
3.2. I think that this should work. 

If I run the command 

otool -L mod_wsgi.so 

I get ... 

mod_wsgi.so: 
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current 
version 
169.3.0) 




 /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation 

(compatibility version 150.0.0, 

Re: [modwsgi] Re: mod_wsgi prevents apache start following update

2012-10-05 Thread Jake
With Mountain lion it comes with versions 2.3, 2.5, 2.6,  2.7. These are 
installed as you have correctly stated however the installation is a little 
different compared to a linux installation. 

The version 3.2 that I have installed is from the python site at the 
following location http://www.python.org/download/releases/3.2.3/. I took 
the osx 64bit installer.

The installation location is as per the installer.

Jake

On Friday, October 5, 2012 1:42:28 AM UTC+1, Graham Dumpleton wrote:

 The output is correct, although one thing worried me. 

 Can you confirm that you manually installed Python 3.2, because a 
 system Python wouldn't be under: 

   /Library/Frameworks/Python.framework 

 What Python versions are under: 

   /System/Library/Frameworks/Python.framework/Versions 

 I ask as I am not sure what ships with Mountain Lion. 

 Also, if Python 3.2 was installed manually, did you use the Python 
 Software Foundation binary installer or one from somewhere else. The 
 PSF installer is notorious for requiring --disable-framework option 
 and I don't know what they do differently when building it to break 
 normal framework linking. 

 Graham 

 On 5 October 2012 07:39, Jake jake.g...@realspaces.com javascript: 
 wrote: 
  Graham 
  
  These are the steps that I followed and the output I received; 
  1. 
  ./configure 
  
 --with-python=/Library/Frameworks/Python.framework/Versions/3.2/bin/python3 
  --disable-framework 
  2. 
  make 
  3. 
  cd .libs 
  4. 
  otool -L mod_wsgi.so 
  
  Output 
  mod_wsgi.so: 
  /Library/Frameworks/Python.framework/Versions/3.2/Python (compatibility 
  version 3.2.0, current version 3.2.0) 
  /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 
  169.3.0) 
  
 /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation 

  (compatibility version 150.0.0, current version 744.12.0) 
  
  Is this the correct output??? 
  
  Best regards 
  
  Jake 
  
  
  On Wednesday, October 3, 2012 10:55:45 PM UTC+1, Graham Dumpleton wrote: 
  
  The output you gave showed: 
  
  hostname:mod_wsgi-3.4 user$ make 
  make: Nothing to be done for `all'. 
  
  which indicated that make had already been run in the directory again. 
  
  From that fresh source code, do the configure and make and then run: 
  
otool -L .libs/mod_wsgi.so 
  
  without doing an install. 
  
  See what the local .so file is before anything gets installed. 
  
  Graham 
  
  On 4 October 2012 06:33, Jake jake.g...@realspaces.com wrote: 
   I  had deleted the previous download and started with a clean one. 
 Not 
   sure 
   if the 'make distclean' will do anything. 
   
   I ran it anyway and got the following ; 
   
   make: *** No rule to make target `distclean'.  Stop. 
   
   Which I think is to be expected. 
   
   
   On Wednesday, October 3, 2012 12:02:16 AM UTC+1, Jake wrote: 
   
   Hi 
   
   Until recently I have developing in python using mod_python but 
 decided 
   to 
   upgrade to mod_wsgi when I upgraded from os snow leopard to mountain 
   lion. 
   
   I have followed the instructions and when I restart apache it fails 
 to 
   start up. To throw things into the mix I am trying to run mod_wsgi 
 on 
   python 
   3.2. I think that this should work. 
   
   If I run the command 
   
   otool -L mod_wsgi.so 
   
   I get ... 
   
   mod_wsgi.so: 
   /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current 
   version 
   169.3.0) 
   
   
   
 /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation 

   (compatibility version 150.0.0, current version 744.12.0) 
   
   From what I can see from the notes that have been pasted this is not 
   correct. 
   
   Can anyone point me in the right direction, an idiot guide would be 
   useful. 
   
   Thanks 
   
   J 
   
   -- 
   You received this message because you are subscribed to the Google 
   Groups 
   modwsgi group. 
   To view this discussion on the web visit 
   https://groups.google.com/d/msg/modwsgi/-/W3FEnec4nRMJ. 
   
   To post to this group, send email to mod...@googlegroups.com. 
   To unsubscribe from this group, send email to 
   modwsgi+u...@googlegroups.com. 
   For more options, visit this group at 
   http://groups.google.com/group/modwsgi?hl=en. 
  
  -- 
  You received this message because you are subscribed to the Google 
 Groups 
  modwsgi group. 
  To view this discussion on the web visit 
  https://groups.google.com/d/msg/modwsgi/-/U1TxsZNz-D0J. 
  
  To post to this group, send email to mod...@googlegroups.comjavascript:. 

  To unsubscribe from this group, send email to 
  modwsgi+u...@googlegroups.com javascript:. 
  For more options, visit this group at 
  http://groups.google.com/group/modwsgi?hl=en. 


-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/modwsgi/-/E8_IpwXkYrYJ.
To post to this group, send email to 

Re: [modwsgi] Re: mod_wsgi prevents apache start following update

2012-10-05 Thread Graham Dumpleton
With otool -L showing the correct result, what then was the result
when you tried to actually use it with Apache???

If there is still a run time linking issue causing Apache not to
start, you can usually see the error by running:

  sudo /usr/sbin/apachectl -t

It will show any linker error as output immediately.

Graham

On 6 October 2012 05:31, Jake jake.griff...@realspaces.com wrote:
 With Mountain lion it comes with versions 2.3, 2.5, 2.6,  2.7. These are
 installed as you have correctly stated however the installation is a little
 different compared to a linux installation.

 The version 3.2 that I have installed is from the python site at the
 following location http://www.python.org/download/releases/3.2.3/. I took
 the osx 64bit installer.

 The installation location is as per the installer.

 Jake

 On Friday, October 5, 2012 1:42:28 AM UTC+1, Graham Dumpleton wrote:

 The output is correct, although one thing worried me.

 Can you confirm that you manually installed Python 3.2, because a
 system Python wouldn't be under:

   /Library/Frameworks/Python.framework

 What Python versions are under:

   /System/Library/Frameworks/Python.framework/Versions

 I ask as I am not sure what ships with Mountain Lion.

 Also, if Python 3.2 was installed manually, did you use the Python
 Software Foundation binary installer or one from somewhere else. The
 PSF installer is notorious for requiring --disable-framework option
 and I don't know what they do differently when building it to break
 normal framework linking.

 Graham

 On 5 October 2012 07:39, Jake jake.g...@realspaces.com wrote:
  Graham
 
  These are the steps that I followed and the output I received;
  1.
  ./configure
 
  --with-python=/Library/Frameworks/Python.framework/Versions/3.2/bin/python3
  --disable-framework
  2.
  make
  3.
  cd .libs
  4.
  otool -L mod_wsgi.so
 
  Output
  mod_wsgi.so:
  /Library/Frameworks/Python.framework/Versions/3.2/Python (compatibility
  version 3.2.0, current version 3.2.0)
  /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version
  169.3.0)
 
  /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
  (compatibility version 150.0.0, current version 744.12.0)
 
  Is this the correct output???
 
  Best regards
 
  Jake
 
 
  On Wednesday, October 3, 2012 10:55:45 PM UTC+1, Graham Dumpleton wrote:
 
  The output you gave showed:
 
  hostname:mod_wsgi-3.4 user$ make
  make: Nothing to be done for `all'.
 
  which indicated that make had already been run in the directory again.
 
  From that fresh source code, do the configure and make and then run:
 
otool -L .libs/mod_wsgi.so
 
  without doing an install.
 
  See what the local .so file is before anything gets installed.
 
  Graham
 
  On 4 October 2012 06:33, Jake jake.g...@realspaces.com wrote:
   I  had deleted the previous download and started with a clean one.
   Not
   sure
   if the 'make distclean' will do anything.
  
   I ran it anyway and got the following ;
  
   make: *** No rule to make target `distclean'.  Stop.
  
   Which I think is to be expected.
  
  
   On Wednesday, October 3, 2012 12:02:16 AM UTC+1, Jake wrote:
  
   Hi
  
   Until recently I have developing in python using mod_python but
   decided
   to
   upgrade to mod_wsgi when I upgraded from os snow leopard to mountain
   lion.
  
   I have followed the instructions and when I restart apache it fails
   to
   start up. To throw things into the mix I am trying to run mod_wsgi
   on
   python
   3.2. I think that this should work.
  
   If I run the command
  
   otool -L mod_wsgi.so
  
   I get ...
  
   mod_wsgi.so:
   /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
   version
   169.3.0)
  
  
  
   /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
   (compatibility version 150.0.0, current version 744.12.0)
  
   From what I can see from the notes that have been pasted this is not
   correct.
  
   Can anyone point me in the right direction, an idiot guide would be
   useful.
  
   Thanks
  
   J
  
   --
   You received this message because you are subscribed to the Google
   Groups
   modwsgi group.
   To view this discussion on the web visit
   https://groups.google.com/d/msg/modwsgi/-/W3FEnec4nRMJ.
  
   To post to this group, send email to mod...@googlegroups.com.
   To unsubscribe from this group, send email to
   modwsgi+u...@googlegroups.com.
   For more options, visit this group at
   http://groups.google.com/group/modwsgi?hl=en.
 
  --
  You received this message because you are subscribed to the Google
  Groups
  modwsgi group.
  To view this discussion on the web visit
  https://groups.google.com/d/msg/modwsgi/-/U1TxsZNz-D0J.
 
  To post to this group, send email to mod...@googlegroups.com.
  To unsubscribe from this group, send email to
  modwsgi+u...@googlegroups.com.
  For more options, visit this group at
  http://groups.google.com/group/modwsgi?hl=en.

 --
 You received this 

Re: [modwsgi] Re: mod_wsgi prevents apache start following update

2012-10-04 Thread Jake
Graham

These are the steps that I followed and the output I received;
1.
./configure 
--with-python=/Library/Frameworks/Python.framework/Versions/3.2/bin/python3 
--disable-framework
2. 
make
3. 
cd .libs
4. 
otool -L mod_wsgi.so

Output
mod_wsgi.so:
/Library/Frameworks/Python.framework/Versions/3.2/Python (compatibility 
version 3.2.0, current version 3.2.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 
169.3.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation 
(compatibility version 150.0.0, current version 744.12.0)

Is this the correct output???

Best regards

Jake


On Wednesday, October 3, 2012 10:55:45 PM UTC+1, Graham Dumpleton wrote:

 The output you gave showed: 

 hostname:mod_wsgi-3.4 user$ make 
 make: Nothing to be done for `all'. 

 which indicated that make had already been run in the directory again. 

 From that fresh source code, do the configure and make and then run: 

   otool -L .libs/mod_wsgi.so 

 without doing an install. 

 See what the local .so file is before anything gets installed. 

 Graham 

 On 4 October 2012 06:33, Jake jake.g...@realspaces.com javascript: 
 wrote: 
  I  had deleted the previous download and started with a clean one. Not 
 sure 
  if the 'make distclean' will do anything. 
  
  I ran it anyway and got the following ; 
  
  make: *** No rule to make target `distclean'.  Stop. 
  
  Which I think is to be expected. 
  
  
  On Wednesday, October 3, 2012 12:02:16 AM UTC+1, Jake wrote: 
  
  Hi 
  
  Until recently I have developing in python using mod_python but decided 
 to 
  upgrade to mod_wsgi when I upgraded from os snow leopard to mountain 
 lion. 
  
  I have followed the instructions and when I restart apache it fails to 
  start up. To throw things into the mix I am trying to run mod_wsgi on 
 python 
  3.2. I think that this should work. 
  
  If I run the command 
  
  otool -L mod_wsgi.so 
  
  I get ... 
  
  mod_wsgi.so: 
  /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current 
 version 
  169.3.0) 
  
  
 /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation 

  (compatibility version 150.0.0, current version 744.12.0) 
  
  From what I can see from the notes that have been pasted this is not 
  correct. 
  
  Can anyone point me in the right direction, an idiot guide would be 
  useful. 
  
  Thanks 
  
  J 
  
  -- 
  You received this message because you are subscribed to the Google 
 Groups 
  modwsgi group. 
  To view this discussion on the web visit 
  https://groups.google.com/d/msg/modwsgi/-/W3FEnec4nRMJ. 
  
  To post to this group, send email to mod...@googlegroups.comjavascript:. 

  To unsubscribe from this group, send email to 
  modwsgi+u...@googlegroups.com javascript:. 
  For more options, visit this group at 
  http://groups.google.com/group/modwsgi?hl=en. 


-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/modwsgi/-/U1TxsZNz-D0J.
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] Re: mod_wsgi prevents apache start following update

2012-10-04 Thread Graham Dumpleton
The output is correct, although one thing worried me.

Can you confirm that you manually installed Python 3.2, because a
system Python wouldn't be under:

  /Library/Frameworks/Python.framework

What Python versions are under:

  /System/Library/Frameworks/Python.framework/Versions

I ask as I am not sure what ships with Mountain Lion.

Also, if Python 3.2 was installed manually, did you use the Python
Software Foundation binary installer or one from somewhere else. The
PSF installer is notorious for requiring --disable-framework option
and I don't know what they do differently when building it to break
normal framework linking.

Graham

On 5 October 2012 07:39, Jake jake.griff...@realspaces.com wrote:
 Graham

 These are the steps that I followed and the output I received;
 1.
 ./configure
 --with-python=/Library/Frameworks/Python.framework/Versions/3.2/bin/python3
 --disable-framework
 2.
 make
 3.
 cd .libs
 4.
 otool -L mod_wsgi.so

 Output
 mod_wsgi.so:
 /Library/Frameworks/Python.framework/Versions/3.2/Python (compatibility
 version 3.2.0, current version 3.2.0)
 /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version
 169.3.0)
 /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
 (compatibility version 150.0.0, current version 744.12.0)

 Is this the correct output???

 Best regards

 Jake


 On Wednesday, October 3, 2012 10:55:45 PM UTC+1, Graham Dumpleton wrote:

 The output you gave showed:

 hostname:mod_wsgi-3.4 user$ make
 make: Nothing to be done for `all'.

 which indicated that make had already been run in the directory again.

 From that fresh source code, do the configure and make and then run:

   otool -L .libs/mod_wsgi.so

 without doing an install.

 See what the local .so file is before anything gets installed.

 Graham

 On 4 October 2012 06:33, Jake jake.g...@realspaces.com wrote:
  I  had deleted the previous download and started with a clean one. Not
  sure
  if the 'make distclean' will do anything.
 
  I ran it anyway and got the following ;
 
  make: *** No rule to make target `distclean'.  Stop.
 
  Which I think is to be expected.
 
 
  On Wednesday, October 3, 2012 12:02:16 AM UTC+1, Jake wrote:
 
  Hi
 
  Until recently I have developing in python using mod_python but decided
  to
  upgrade to mod_wsgi when I upgraded from os snow leopard to mountain
  lion.
 
  I have followed the instructions and when I restart apache it fails to
  start up. To throw things into the mix I am trying to run mod_wsgi on
  python
  3.2. I think that this should work.
 
  If I run the command
 
  otool -L mod_wsgi.so
 
  I get ...
 
  mod_wsgi.so:
  /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
  version
  169.3.0)
 
 
  /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
  (compatibility version 150.0.0, current version 744.12.0)
 
  From what I can see from the notes that have been pasted this is not
  correct.
 
  Can anyone point me in the right direction, an idiot guide would be
  useful.
 
  Thanks
 
  J
 
  --
  You received this message because you are subscribed to the Google
  Groups
  modwsgi group.
  To view this discussion on the web visit
  https://groups.google.com/d/msg/modwsgi/-/W3FEnec4nRMJ.
 
  To post to this group, send email to mod...@googlegroups.com.
  To unsubscribe from this group, send email to
  modwsgi+u...@googlegroups.com.
  For more options, visit this group at
  http://groups.google.com/group/modwsgi?hl=en.

 --
 You received this message because you are subscribed to the Google Groups
 modwsgi group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/modwsgi/-/U1TxsZNz-D0J.

 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.

-- 
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.



[modwsgi] Re: mod_wsgi prevents apache start following update

2012-10-03 Thread Jake
Hi Graham, thanks for the pointer but it hasn't worked. Here is what I 
entere into terminal;

hostname:mod_wsgi-3.4 user$ ./configure 
--with-python=/Library/Frameworks/Python.framework/Versions/3.2/bin/python3 
--disable-framework
checking for apxs2... no
checking for apxs... /usr/sbin/apxs
checking Apache version... 2.2.22
configure: creating ./config.status
config.status: creating Makefile
hostname:mod_wsgi-3.4 user$ make
make: Nothing to be done for `all'.
hostname:mod_wsgi-3.4 user$ sudo make install
Password:
/usr/sbin/apxs -i -S LIBEXECDIR=/usr/libexec/apache2 -n 'mod_wsgi' 
mod_wsgi.la
/usr/share/httpd/build/instdso.sh 
SH_LIBTOOL='/usr/share/apr-1/build-1/libtool' mod_wsgi.la 
/usr/libexec/apache2
/usr/share/apr-1/build-1/libtool --mode=install cp mod_wsgi.la 
/usr/libexec/apache2/
cp .libs/mod_wsgi.so /usr/libexec/apache2/mod_wsgi.so
cp .libs/mod_wsgi.lai /usr/libexec/apache2/mod_wsgi.la
cp .libs/mod_wsgi.a /usr/libexec/apache2/mod_wsgi.a
chmod 644 /usr/libexec/apache2/mod_wsgi.a
ranlib /usr/libexec/apache2/mod_wsgi.a
--
Libraries have been installed in:
   /usr/libexec/apache2

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `DYLD_LIBRARY_PATH' environment variable
 during execution

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
--
chmod 755 /usr/libexec/apache2/mod_wsgi.so

When I run otool I still get the same output,

hostname:apache2 user$ otool -L mod_wsgi.so 
mod_wsgi.so:
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 
169.3.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation 
(compatibility version 150.0.0, current version 744.12.0)

The version of mod_wsgi is the tar that is available at the following 
location download 
herehttp://code.google.com/p/modwsgi/downloads/detail?name=mod_wsgi-3.4.tar.gzcan=2q=
.

Any ideas?

Thanks

Jake

On Wednesday, October 3, 2012 12:02:16 AM UTC+1, Jake wrote:

 Hi

 Until recently I have developing in python using mod_python but decided to 
 upgrade to mod_wsgi when I upgraded from os snow leopard to mountain lion.

 I have followed the instructions and when I restart apache it fails to 
 start up. To throw things into the mix I am trying to run mod_wsgi on 
 python 3.2. I think that this should work.

 If I run the command 

 otool -L mod_wsgi.so 

 I get ...

 mod_wsgi.so:
 /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 
 169.3.0)
 /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation 
 (compatibility version 150.0.0, current version 744.12.0)

 From what I can see from the notes that have been pasted this is not 
 correct.

 Can anyone point me in the right direction, an idiot guide would be useful.

 Thanks

 J


-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/modwsgi/-/JvTfxYObF74J.
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] Re: mod_wsgi prevents apache start following update

2012-10-03 Thread Graham Dumpleton
Run 'make distclean' in the directory before you rerun configure. You
still had old build results lying around by the look of it.

On 4 October 2012 05:08, Jake jake.griff...@realspaces.com wrote:
 Hi Graham, thanks for the pointer but it hasn't worked. Here is what I
 entere into terminal;

 hostname:mod_wsgi-3.4 user$ ./configure
 --with-python=/Library/Frameworks/Python.framework/Versions/3.2/bin/python3
 --disable-framework
 checking for apxs2... no
 checking for apxs... /usr/sbin/apxs
 checking Apache version... 2.2.22
 configure: creating ./config.status
 config.status: creating Makefile
 hostname:mod_wsgi-3.4 user$ make
 make: Nothing to be done for `all'.
 hostname:mod_wsgi-3.4 user$ sudo make install
 Password:
 /usr/sbin/apxs -i -S LIBEXECDIR=/usr/libexec/apache2 -n 'mod_wsgi'
 mod_wsgi.la
 /usr/share/httpd/build/instdso.sh
 SH_LIBTOOL='/usr/share/apr-1/build-1/libtool' mod_wsgi.la
 /usr/libexec/apache2
 /usr/share/apr-1/build-1/libtool --mode=install cp mod_wsgi.la
 /usr/libexec/apache2/
 cp .libs/mod_wsgi.so /usr/libexec/apache2/mod_wsgi.so
 cp .libs/mod_wsgi.lai /usr/libexec/apache2/mod_wsgi.la
 cp .libs/mod_wsgi.a /usr/libexec/apache2/mod_wsgi.a
 chmod 644 /usr/libexec/apache2/mod_wsgi.a
 ranlib /usr/libexec/apache2/mod_wsgi.a
 --
 Libraries have been installed in:
/usr/libexec/apache2

 If you ever happen to want to link against installed libraries
 in a given directory, LIBDIR, you must either use libtool, and
 specify the full pathname of the library, or use the `-LLIBDIR'
 flag during linking and do at least one of the following:
- add LIBDIR to the `DYLD_LIBRARY_PATH' environment variable
  during execution

 See any operating system documentation about shared libraries for
 more information, such as the ld(1) and ld.so(8) manual pages.
 --
 chmod 755 /usr/libexec/apache2/mod_wsgi.so

 When I run otool I still get the same output,

 hostname:apache2 user$ otool -L mod_wsgi.so
 mod_wsgi.so:
 /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version
 169.3.0)
 /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
 (compatibility version 150.0.0, current version 744.12.0)

 The version of mod_wsgi is the tar that is available at the following
 location download here.

 Any ideas?

 Thanks

 Jake

 On Wednesday, October 3, 2012 12:02:16 AM UTC+1, Jake wrote:

 Hi

 Until recently I have developing in python using mod_python but decided to
 upgrade to mod_wsgi when I upgraded from os snow leopard to mountain lion.

 I have followed the instructions and when I restart apache it fails to
 start up. To throw things into the mix I am trying to run mod_wsgi on python
 3.2. I think that this should work.

 If I run the command

 otool -L mod_wsgi.so

 I get ...

 mod_wsgi.so:
 /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version
 169.3.0)

 /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
 (compatibility version 150.0.0, current version 744.12.0)

 From what I can see from the notes that have been pasted this is not
 correct.

 Can anyone point me in the right direction, an idiot guide would be
 useful.

 Thanks

 J

 --
 You received this message because you are subscribed to the Google Groups
 modwsgi group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/modwsgi/-/JvTfxYObF74J.

 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.

-- 
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.



[modwsgi] Re: mod_wsgi prevents apache start following update

2012-10-03 Thread Jake
I  had deleted the previous download and started with a clean one. Not sure 
if the 'make distclean' will do anything.

I ran it anyway and got the following ;

make: *** No rule to make target `distclean'.  Stop.

Which I think is to be expected.

On Wednesday, October 3, 2012 12:02:16 AM UTC+1, Jake wrote:

 Hi

 Until recently I have developing in python using mod_python but decided to 
 upgrade to mod_wsgi when I upgraded from os snow leopard to mountain lion.

 I have followed the instructions and when I restart apache it fails to 
 start up. To throw things into the mix I am trying to run mod_wsgi on 
 python 3.2. I think that this should work.

 If I run the command 

 otool -L mod_wsgi.so 

 I get ...

 mod_wsgi.so:
 /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 
 169.3.0)
 /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation 
 (compatibility version 150.0.0, current version 744.12.0)

 From what I can see from the notes that have been pasted this is not 
 correct.

 Can anyone point me in the right direction, an idiot guide would be useful.

 Thanks

 J


-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/modwsgi/-/W3FEnec4nRMJ.
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] Re: mod_wsgi prevents apache start following update

2012-10-03 Thread Graham Dumpleton
The output you gave showed:

hostname:mod_wsgi-3.4 user$ make
make: Nothing to be done for `all'.

which indicated that make had already been run in the directory again.

From that fresh source code, do the configure and make and then run:

  otool -L .libs/mod_wsgi.so

without doing an install.

See what the local .so file is before anything gets installed.

Graham

On 4 October 2012 06:33, Jake jake.griff...@realspaces.com wrote:
 I  had deleted the previous download and started with a clean one. Not sure
 if the 'make distclean' will do anything.

 I ran it anyway and got the following ;

 make: *** No rule to make target `distclean'.  Stop.

 Which I think is to be expected.


 On Wednesday, October 3, 2012 12:02:16 AM UTC+1, Jake wrote:

 Hi

 Until recently I have developing in python using mod_python but decided to
 upgrade to mod_wsgi when I upgraded from os snow leopard to mountain lion.

 I have followed the instructions and when I restart apache it fails to
 start up. To throw things into the mix I am trying to run mod_wsgi on python
 3.2. I think that this should work.

 If I run the command

 otool -L mod_wsgi.so

 I get ...

 mod_wsgi.so:
 /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version
 169.3.0)

 /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
 (compatibility version 150.0.0, current version 744.12.0)

 From what I can see from the notes that have been pasted this is not
 correct.

 Can anyone point me in the right direction, an idiot guide would be
 useful.

 Thanks

 J

 --
 You received this message because you are subscribed to the Google Groups
 modwsgi group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/modwsgi/-/W3FEnec4nRMJ.

 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.

-- 
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] Re: mod_wsgi and mod_ruid2

2012-07-21 Thread slech
Graham,
Thank you very much for help! Now it is working perfect!

 WSGIDaemonProcess moin user=www-moin group=www-moin home=/web/moin/ 
 processes=5 threads=10 maximum-requests=1000 umask=0007



On Friday, July 20, 2012 8:51:00 PM UTC+3, Graham Dumpleton wrote:

 Use: 

 WSGIDaemonProcess moin user=www-moin group=www-moin home=/tmp 
 processes=5 threads=10 maximum-requests=1000 umask=0007 

 That is, add home=/tmp argument. 

 This will get rid of complaint about not being able to change home 
 directory. 

 Graham


-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/modwsgi/-/TrMPaSolOE4J.
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.



[modwsgi] Re: mod_wsgi and mod_ruid2

2012-07-20 Thread slech
Thank you for reply!

I tried:

apt-get remove libapache2-mod-wsgi
#
/usr/local/src
wget http://modwsgi.googlecode.com/files/mod_wsgi-3.3.tar.gz
tar -zxvf mod_wsgi-3.3.tar.gz
cd mod_wsgi-3.3
vi mod_wsgi.c

Change:
#if defined(MPM_ITK)
if (chown(process-socket, process-uid, -1)  0) {
#else
if (chown(process-socket, ap_unixd_config.user_id, -1)  0) {
#endif

to:

/ * #if defined(MPM_ITK) */
if (chown(process-socket, process-uid, -1)  0) {
/* #else
if (chown(process-socket, ap_unixd_config.user_id, -1)  0) {
#endif */

apt-get install apache2-threaded-dev python-dev checkinstall
#
./configure
make
#
checkinstall --pkgname=mod_wsgi --pkgversion 3.3.release`date +%Y%m%d` 
--backup=no --install=no --defaul
#
dpkg -i mod-wsgi_3.3.release20120720-1_amd64.deb
#
a2enmod wsgi
service apache2 restart

And I got the errors:
 * Starting web server 
apache2 
  
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
Action 'start' failed.
The Apache error log may have more information.


[Fri Jul 20 17:03:29 2012] [alert] (2)No such file or directory: mod_wsgi 
(pid=393): Unable to change working directory to '/home/www-moin'.
[Fri Jul 20 17:03:29 2012] [alert] (2)No such file or directory: mod_wsgi 
(pid=395): Unable to change working directory to '/home/www-moin'.
[Fri Jul 20 17:03:29 2012] [alert] (2)No such file or directory: mod_wsgi 
(pid=396): Unable to change working directory to '/home/www-moin'.

killall apache2
service apache2 start

And now

srwx--  1 www-moin root   0 Jul 20 20:08 moin.13173.0.1.sock


Now it works! Great!

But I can see in Apache error log:
[Fri Jul 20 20:15:21 2012] [alert] (2)No such file or directory: mod_wsgi 
(pid=13628): Unable to change working directory to '/home/www-moin'.
[Fri Jul 20 20:15:21 2012] [alert] (2)No such file or directory: mod_wsgi 
(pid=13629): Unable to change working directory to '/home/www-moin'.
[Fri Jul 20 20:15:21 2012] [alert] (2)No such file or directory: mod_wsgi 
(pid=13630): Unable to change working directory to '/home/www-moin'.
[Fri Jul 20 20:15:21 2012] [notice] Apache/2.2.22 (Ubuntu) DAV/2 SVN/1.6.17 
PHP/5.3.10-1ubuntu3.2 with Suhosin-Patch mod_ssl/2.2.22 OpenSSL/1.0.1 
mod_wsgi/3.3 Python/2.7.3 configured -- resuming normal operations
[Fri Jul 20 20:15:21 2012] [alert] (2)No such file or directory: mod_wsgi 
(pid=13631): Unable to change working directory to '/home/www-moin'.
[Fri Jul 20 20:15:21 2012] [alert] (2)No such file or directory: mod_wsgi 
(pid=13632): Unable to change working directory to '/home/www-moin'.

My user was created with:

 useradd --shell /bin/false --no-create-home www-moin

 Maybe is possible to fix this ? 


On Friday, July 20, 2012 4:55:29 PM UTC+3, slech wrote:

 Hello Everyone.
 I have an issue to install moin wiki with mod_ruid.
 Moin wiki is python based app and I start it via Apache and mod_wsgi.
 All work fine without mod_ruid2. And also work fine if I manually change 
 permission to the */var/run/wsgi/moin.32282.0.1.sock* file

 chown www-moin:www-moin /var/run/wsgi/moin.32282.0.1.sock

 or

 chmod 777 /var/run/wsgi/moin.32282.0.1.sock


 After restart permission changed and it looks:

 srwx--  1 www-data root   0 Jul 20 16:42 moin.32282.0.1.sock


 My Apache config related settings:

 RMode config
 RUidGid www-moin www-moin
 RGroups www-moin

 WSGIScriptAlias /web/production/moin/wm/moin.wsgi
 WSGIDaemonProcess moin user=www-moin group=www-moin processes=5 
 threads=10 maximum-requests=1000 umask=0007
 WSGIProcessGroup moin


 As I understand wsgi process start as Apache user (in my case www-moin) 
 but maybe at first run(restart, reload) it starts as default Apache user ?

 My question is how I can change sock file default permissions ?

 Thanks.


-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/modwsgi/-/0an-R_sO9WAJ.
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] Re: mod_wsgi and mod_ruid2

2012-07-20 Thread Graham Dumpleton
Use:

WSGIDaemonProcess moin user=www-moin group=www-moin home=/tmp
processes=5 threads=10 maximum-requests=1000 umask=0007

That is, add home=/tmp argument.

This will get rid of complaint about not being able to change home directory.

Graham

On 20 July 2012 10:20, slech xum...@gmail.com wrote:
 Thank you for reply!

 I tried:

 apt-get remove libapache2-mod-wsgi
 #
 /usr/local/src
 wget http://modwsgi.googlecode.com/files/mod_wsgi-3.3.tar.gz
 tar -zxvf mod_wsgi-3.3.tar.gz
 cd mod_wsgi-3.3
 vi mod_wsgi.c

 Change:

 #if defined(MPM_ITK)
 if (chown(process-socket, process-uid, -1)  0) {
 #else
 if (chown(process-socket, ap_unixd_config.user_id, -1)  0) {
 #endif

 to:

 / * #if defined(MPM_ITK) */
 if (chown(process-socket, process-uid, -1)  0) {
 /* #else
 if (chown(process-socket, ap_unixd_config.user_id, -1)  0) {
 #endif */

 apt-get install apache2-threaded-dev python-dev checkinstall
 #
 ./configure
 make
 #
 checkinstall --pkgname=mod_wsgi --pkgversion 3.3.release`date +%Y%m%d`
 --backup=no --install=no --defaul
 #
 dpkg -i mod-wsgi_3.3.release20120720-1_amd64.deb
 #
 a2enmod wsgi
 service apache2 restart

 And I got the errors:
  * Starting web server apache2
 (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
 no listening sockets available, shutting down
 Unable to open logs
 Action 'start' failed.
 The Apache error log may have more information.


 [Fri Jul 20 17:03:29 2012] [alert] (2)No such file or directory: mod_wsgi
 (pid=393): Unable to change working directory to '/home/www-moin'.
 [Fri Jul 20 17:03:29 2012] [alert] (2)No such file or directory: mod_wsgi
 (pid=395): Unable to change working directory to '/home/www-moin'.
 [Fri Jul 20 17:03:29 2012] [alert] (2)No such file or directory: mod_wsgi
 (pid=396): Unable to change working directory to '/home/www-moin'.

 killall apache2
 service apache2 start

 And now

 srwx--  1 www-moin root   0 Jul 20 20:08 moin.13173.0.1.sock


 Now it works! Great!

 But I can see in Apache error log:
 [Fri Jul 20 20:15:21 2012] [alert] (2)No such file or directory: mod_wsgi
 (pid=13628): Unable to change working directory to '/home/www-moin'.
 [Fri Jul 20 20:15:21 2012] [alert] (2)No such file or directory: mod_wsgi
 (pid=13629): Unable to change working directory to '/home/www-moin'.
 [Fri Jul 20 20:15:21 2012] [alert] (2)No such file or directory: mod_wsgi
 (pid=13630): Unable to change working directory to '/home/www-moin'.
 [Fri Jul 20 20:15:21 2012] [notice] Apache/2.2.22 (Ubuntu) DAV/2 SVN/1.6.17
 PHP/5.3.10-1ubuntu3.2 with Suhosin-Patch mod_ssl/2.2.22 OpenSSL/1.0.1
 mod_wsgi/3.3 Python/2.7.3 configured -- resuming normal operations
 [Fri Jul 20 20:15:21 2012] [alert] (2)No such file or directory: mod_wsgi
 (pid=13631): Unable to change working directory to '/home/www-moin'.
 [Fri Jul 20 20:15:21 2012] [alert] (2)No such file or directory: mod_wsgi
 (pid=13632): Unable to change working directory to '/home/www-moin'.

 My user was created with:

 useradd --shell /bin/false --no-create-home www-moin

 Maybe is possible to fix this ?


 On Friday, July 20, 2012 4:55:29 PM UTC+3, slech wrote:

 Hello Everyone.
 I have an issue to install moin wiki with mod_ruid.
 Moin wiki is python based app and I start it via Apache and mod_wsgi.
 All work fine without mod_ruid2. And also work fine if I manually change
 permission to the /var/run/wsgi/moin.32282.0.1.sock file

 chown www-moin:www-moin /var/run/wsgi/moin.32282.0.1.sock

 or

 chmod 777 /var/run/wsgi/moin.32282.0.1.sock


 After restart permission changed and it looks:

 srwx--  1 www-data root   0 Jul 20 16:42 moin.32282.0.1.sock


 My Apache config related settings:

 RMode config
 RUidGid www-moin www-moin
 RGroups www-moin

 WSGIScriptAlias /web/production/moin/wm/moin.wsgi
 WSGIDaemonProcess moin user=www-moin group=www-moin processes=5
 threads=10 maximum-requests=1000 umask=0007
 WSGIProcessGroup moin


 As I understand wsgi process start as Apache user (in my case www-moin)
 but maybe at first run(restart, reload) it starts as default Apache user ?

 My question is how I can change sock file default permissions ?

 Thanks.

 --
 You received this message because you are subscribed to the Google Groups
 modwsgi group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/modwsgi/-/0an-R_sO9WAJ.

 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.

-- 
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.



[modwsgi] Re: mod_wsgi under virtualenv: Error no module named site

2012-07-09 Thread RedBaron
Yes that was indeed the problem. My /home/admin was 700 although I had
fixed permissions is /home/admin/py_run. Changing /home/admin
permissions to 755 fixed it.
Thanks

On Jul 10, 10:32 am, Graham Dumpleton graham.dumple...@gmail.com
wrote:
 You are missing a WSGIProcessGroup directive to go with your
 WSGIDaemonProcess directive. That isn't the cause of your problem.

 The problem is more likely because the user that Apache runs as can't
 read into your /home/admin directory because there is no permission
 for others to read into it. Ie., home directory is rwxr-x--- and not
 rwxr-xr-x. That or permissions on stuff in it prevents it.

 The other option is that you have SELinux enabled and it is stopping
 Apache from reading stuff in that location.

 Graham

 On 10 July 2012 15:22, RedBaron dheeraj.gup...@gmail.com wrote:







  I know this question has been asked many times and you have patiently
  answered it each time. But those solutions are not working for me. I
  have already looked at the wiki and checked my installation. I have
  standard python 2.6 installed on my system. I have also created a
  virtual environment to host my pyramid project. I built mod_wsgi by
  using ./configure then make and make install. The python path was /usr/
  bin/python (Standard system python).
  Here are the ldd outputs

  My virtual env
  # ldd /home/admin/py_run/bin/python
          linux-vdso.so.1 =  (0x7fff49963000)
          libpython2.6.so.1.0 = /usr/lib64/libpython2.6.so.1.0
  (0x003d79c0)
          libpthread.so.0 = /lib64/libpthread.so.0 (0x003d6d80)
          libdl.so.2 = /lib64/libdl.so.2 (0x003d6d00)
          libutil.so.1 = /lib64/libutil.so.1 (0x003d7d00)
          libm.so.6 = /lib64/libm.so.6 (0x003d6e00)
          libc.so.6 = /lib64/libc.so.6 (0x003d6d40)
          /lib64/ld-linux-x86-64.so.2 (0x003d6cc0)

  # ldd /usr/bin/python
          linux-vdso.so.1 =  (0x7fffa9d67000)
          libpython2.6.so.1.0 = /usr/lib64/libpython2.6.so.1.0
  (0x003d79c0)
          libpthread.so.0 = /lib64/libpthread.so.0 (0x003d6d80)
          libdl.so.2 = /lib64/libdl.so.2 (0x003d6d00)
          libutil.so.1 = /lib64/libutil.so.1 (0x003d7d00)
          libm.so.6 = /lib64/libm.so.6 (0x003d6e00)
          libc.so.6 = /lib64/libc.so.6 (0x003d6d40)
          /lib64/ld-linux-x86-64.so.2 (0x003d6cc0)

  # ldd /usr/lib64/httpd/modules/mod_wsgi.so
          linux-vdso.so.1 =  (0x7fff4df4f000)
          libpython2.6.so.1.0 = /usr/lib64/libpython2.6.so.1.0
  (0x7f85aa0e7000)
          libpthread.so.0 = /lib64/libpthread.so.0 (0x7f85a9ecb000)
          libdl.so.2 = /lib64/libdl.so.2 (0x7f85a9cc6000)
          libutil.so.1 = /lib64/libutil.so.1 (0x7f85a9ac3000)
          libm.so.6 = /lib64/libm.so.6 (0x7f85a983f000)
          libc.so.6 = /lib64/libc.so.6 (0x7f85a94af000)
          /lib64/ld-linux-x86-64.so.2 (0x003d6cc0)

  The LD_LIBRARY_PATH variable is not set. I have configured
  WSGIPythonHome as WSGIPythonHome /home/admin/py_run (Where py_run is
  my virtual environment). But on restarting apache I get the following
  error in the log

  [error] mod_wsgi (pid=28815): Unable to import 'site' module.

  If I remove the WSGIPythonHome entry and just leave the following in
  the application config

  WSGIApplicationGroup %{GLOBAL}
  WSGIPassAuthorization On
  WSGIDaemonProcess pyramid user=apache group=apache \
             python-path=/home/admin/py_run/lib/python2.6
  #Alias your project. n my case localhost:8080/argus calls up the home
  page
  WSGIScriptAlias /scrooge /opt/jinja_proj/pyramid.wsgi
  # Get the static and favicon.ico pages working by properly aliasing
  them
  Alias /favicon.ico /opt/jinja_proj/jinja_proj/static/images/
  favicon.ico
  Alias /static /opt/jinja_proj/jinja_proj/static
  Directory /opt/jinja_proj
    Order allow,deny
    Allow from all
  /Directory

  Then there is no error on start, but on accessing the website, I get a
  500 error with the following log entries

  [error] [client 31.21.18.100] mod_wsgi (pid=28818): Target WSGI script
  '/opt/jinja_proj/pyramid.wsgi' cannot be loaded as Python module.
  [Tue Jul 10 10:39:00 2012] [error] [client 31.21.18.100] mod_wsgi
  (pid=28818): Exception occurred processing WSGI script '/opt/
  jinja_proj/pyramid.wsgi'.
  [Tue Jul 10 10:39:00 2012] [error] Traceback (most recent call last):
  [Tue Jul 10 10:39:00 2012] [error]   File /opt/jinja_proj/
  pyramid.wsgi, line 1, in module
  [Tue Jul 10 10:39:00 2012] [error]     from pyramid.paster import
  get_app
  [Tue Jul 10 10:39:00 2012] [error] ImportError: No module named
  pyramid.paster

  However from the virtualenv py_run I can import both these modules.
  Any help is appreciated

  --
  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 

[modwsgi] Re: mod_wsgi without python instalation

2012-05-23 Thread Martin B.
Great, thanks.
Any idea what to do with registry entry?

-- 
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] Re: mod_wsgi without python instalation

2012-05-23 Thread Graham Dumpleton
On 23 May 2012 20:20, Martin B. andzin.d...@gmail.com wrote:
 Great, thanks.
 Any idea what to do with registry entry?

Look at WSGIPythonHome and WSGIPythonPath directives in mod_wsgi configuration.

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.



Re: [modwsgi] Re: mod_wsgi compiled with Python 3.2.2?

2012-04-26 Thread Gnarlodious


 Has this problem been resolved yet? I am running an OSX version that comes 
 with Apache/2.2.22 and would hate to have to downgrade Apache to run 
 mod_wsgi.

-- Gnarlie 

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/modwsgi/-/sYw0yIRGM5UJ.
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] Re: mod_wsgi compiled with Python 3.2.2?

2012-04-26 Thread Graham Dumpleton
On 27 April 2012 04:16, Gnarlodious gnarlodi...@gmail.com wrote:
 Has this problem been resolved yet? I am running an OSX version that comes
 with Apache/2.2.22 and would hate to have to downgrade Apache to run
 mod_wsgi.

Can you clarify what you are asking about?

The prior discussion was about Python 3.2 support not Apache 2.2
versions so I can't see why you would be saying you need to downgrade
Apache.

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.



[modwsgi] Re: mod_wsgi import python modile placed in a folder

2012-04-14 Thread badc0re
I have made it with:

site.addsitedir('/home/baddc0re/Desktop/htdocs/')

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/modwsgi/-/CbF0Lerej88J.
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] Re: mod_wsgi import python modile placed in a folder

2012-04-14 Thread Graham Dumpleton
If you are trying to say it works when you use that, that could only
be the case if you had .pth files in the directory
/home/baddc0re/Desktop/htdocs/. Otherwise there should be no
difference between that and doing sys.path.append() for same
directory.

Graham

On 14 April 2012 18:23, badc0re dame.jovano...@gmail.com wrote:
 I have made it with:

 site.addsitedir('/home/baddc0re/Desktop/htdocs/')

 --
 You received this message because you are subscribed to the Google Groups
 modwsgi group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/modwsgi/-/CbF0Lerej88J.

 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.

-- 
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] Re: mod_wsgi-3.3 Python 3.2 - apache2.2 - windows 7 build

2012-04-01 Thread Graham Dumpleton
On 28 December 2011 02:51, Ahmed Hassan ahmed.i...@gmail.com wrote:
 i also tried Visual Studio 2008 and the same goes here

I fixed what would have been a few obvious build problems with
mod_wsgi 4.0 trunk on Windows since last email. I still haven't tried
it myself yet as still trying to get myself organised to be able to do
that once more.

If you have spare cycles and can try building latest mod_wsgi 4.0 from
trunk on Windows and let me know of any errors from build that would
be helpful.

Thanks.

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.



Re: [modwsgi] Re: mod_wsgi and apache vs. paster

2012-03-27 Thread Kent

Thanks very much.

On 3/26/2012 3:28 PM, Graham Dumpleton wrote:

See:

http://code.google.com/p/modwsgi/wiki/TipsAndTricks#Determining_If_Running_Under_mod_wsgi

Graham

On 27 March 2012 03:02, Kentjkentbo...@gmail.com  wrote:

I found this:

if shell in sys.argv:


And I'll use that unless someone has a better way.

Thanks!


On Monday, March 26, 2012 11:46:07 AM UTC-4, Kent wrote:

Graham,
   How can I detect from within my application whether it is being run by
apache with mod_wsgi versus run by paster?

I'm assuming there is a fairly nice way to determine this.

Thanks for your time,
Kent

--
You received this message because you are subscribed to the Google Groups
modwsgi group.
To view this discussion on the web visit
https://groups.google.com/d/msg/modwsgi/-/LLagqq3tvpUJ.

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.


--
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.



[modwsgi] Re: mod_wsgi and apache vs. paster

2012-03-26 Thread Kent
I found this:

if shell in sys.argv:


And I'll use that unless someone has a better way.

Thanks!

On Monday, March 26, 2012 11:46:07 AM UTC-4, Kent wrote:

 Graham,
   How can I detect from within my application whether it is being run by 
 apache with mod_wsgi versus run by paster?

 I'm assuming there is a fairly nice way to determine this.

 Thanks for your time,
 Kent


-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/modwsgi/-/LLagqq3tvpUJ.
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] Re: mod_wsgi and apache vs. paster

2012-03-26 Thread Graham Dumpleton
See:

http://code.google.com/p/modwsgi/wiki/TipsAndTricks#Determining_If_Running_Under_mod_wsgi

Graham

On 27 March 2012 03:02, Kent jkentbo...@gmail.com wrote:
 I found this:

 if shell in sys.argv:


 And I'll use that unless someone has a better way.

 Thanks!


 On Monday, March 26, 2012 11:46:07 AM UTC-4, Kent wrote:

 Graham,
   How can I detect from within my application whether it is being run by
 apache with mod_wsgi versus run by paster?

 I'm assuming there is a fairly nice way to determine this.

 Thanks for your time,
 Kent

 --
 You received this message because you are subscribed to the Google Groups
 modwsgi group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/modwsgi/-/LLagqq3tvpUJ.

 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.

-- 
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.



[modwsgi] Re: mod_wsgi for Apache2.2 / Python2.5 on Windows

2012-02-08 Thread Graham Dumpleton
On 9 February 2012 02:58, Vijay vijaykumar...@gmail.com wrote:
 Graham

 Request your help in obtaining mod_wsgi module that is compatible with
 Apache2.2python2.5 on windows. I read your blogs and thought that you might
 be able to help me in this. I am newbie to world of python and am finding it
 very difficult to build mod_wsgi module for python2.5.

 Request your help

 Thanks  Regards
 Vijay

I don't have binaries for that and simply don't have the time to
create one even though I believe now I have the right MS compiler
required.

Specifically, from memory you need to have VS 2003. You cannot use
newer compilers and Python 2.5 is built with the older compiler.

Is there a specific reason you need to use Python 2.5 and not a newer version?

Anyway, have cc'd this to mod_wsgi mailing list in case anyone else can help.

Please try and use mod_wsgi mailing list in future rather than mailing
me direct.

  
http://code.google.com/p/modwsgi/wiki/WhereToGetHelp?tm=6#Asking_Your_Questions

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.



Re: [modwsgi] Re: mod_wsgi and access scripts for authentication

2012-01-27 Thread Graham Dumpleton
On 28 January 2012 12:53, James Slagle james.sla...@gmail.com wrote:
 I have a small patch for mod_wsgi that has enabled me to use
 WSGIAccessScript and have access to the client SSL certificate.

 The patch makes it so that the mod_ssl hooks that are registered at
 APR_HOOK_MIDDLE are run before wsgi_hook_access_checker
 hook.  This makes it so that I can use mod_ssl.var_lookup  to get the
 value of the client certificate.

 Here's the patch against mod_wsgi tip:
 diff -r 8633d5afeea8 mod_wsgi.c
 --- a/mod_wsgi.c        Tue Apr 19 11:33:51 2011 +1000
 +++ b/mod_wsgi.c        Fri Jan 27 20:52:25 2012 -0500
 @@ -14880,6 +14880,7 @@
  #endif

     static const char * const p6[] = { mod_python.c, NULL };
 +    static const char * const p7[] = { mod_ssl.c, NULL };

     ap_hook_post_config(wsgi_hook_init, p6, NULL, APR_HOOK_MIDDLE);
     ap_hook_child_init(wsgi_hook_child_init, p6, NULL,
 APR_HOOK_MIDDLE);
 @@ -14908,7 +14909,7 @@
     ap_register_provider(p, AUTHZ_PROVIDER_GROUP, wsgi-group,
                          AUTHZ_PROVIDER_VERSION,
 wsgi_authz_provider);
  #endif
 -    ap_hook_access_checker(wsgi_hook_access_checker, NULL, n5,
 APR_HOOK_MIDDLE);
 +    ap_hook_access_checker(wsgi_hook_access_checker, p7, n5,
 APR_HOOK_MIDDLE);
  #endif
  }

 We're actually using mod_wsgi 3.3, and the patch works there as well.

That is a reasonable solution actually.

I have created:

http://code.google.com/p/modwsgi/issues/detail?id=257

to remind myself to look at it properly and make change if no obvious problems.

Not sure if you have mentioned you were doing this before, I don't remember it.

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.



[modwsgi] Re: [mod_wsgi] It does not work with zeromq..

2012-01-05 Thread Psi
I am using mod_wsgi for python 2.7 and it completely works well
without zmq things.
And zmq works well when it used stand alone.

I don't know why mod_wsgi cannot import zmq.

Plus, it does not work even if I remove add site-package things.



On Jan 6, 11:20 am, Graham Dumpleton graham.dumple...@gmail.com
wrote:
 On 6 January 2012 12:39, Psi kev0...@gmail.com wrote:









  i am trying to make web site which retrieves query from the user, and
  process it by C++ based searching program. In order to achieve this, I
  used python script which gets the query and send the query to C++
  program by zeromq. However it seems like mod_wsgi cannot import zeromq
  even though it perfectly worked well without mod_wsgi or without
  zeromq

  I got an error message like this;

  File D:/wsgi_app/wsgi_app.py, line 2, in module, 
  referer:http://localhost/
          import zmq, referer:http://localhost/

  File D:\\util\\Python27\\lib\\site-packages\\zmq\\__init__.py, line
  35, in module, referer:http://localhost/
          from zmq.utils import initthreads # initialize threads,
  referer:http://localhost/

  ImportError: DLL load failed: \xc1\xf6\xc1\xa4\xb5\xc8
  \xb8\xf0\xb5\xe2\xc0\xbb \xc3\xa3\xc0\xbb \xbc\xf6 \xbe\xf8\xbd
  \xc0\xb4\xcf\xb4\xd9., referer:http://localhost/

  The code below shows how I implemented it. Please help me

  import site
  site.addsitedir(D:\\util\\Python27\\Lib\\site-packages)

 Why are you needing to explicitly add site-packages into sys.path?

 This immediately suggests you are doing something wrong as it should
 not be necessary.

 Is mod_wsgi.so you are using for Python 2.7? Did you install Python
 for all users or just the user you installed it as? You are supposed
 to install it for all users.

 Presuming that zmq module has a C extension component, is that module
 compiled as 32 bit for the Python version mod_wsgi is compiled for?

 Graham







  from cgi import parse_qs, escape
  import zmq # HERE IS THE ERROR
  def application( # It accepts two arguments:
       # environ points to a dictionary containing CGI like environment
  variables
       # which is filled by the server for each received request from
  the client
       environ,
       # start_response is a callback function supplied by the server
       # which will be used to send the HTTP status and headers to the
  server
       start_response):

     # get a query from the webpage :)
    data = parse_qs(environ['QUERY_STRING'])

    query = data.get('query', [''])[0]
    query = escape(query) #prevent script injection

    context = zmq.Context()
    socket = context.socket(zmq.REQ)
    socket.connect (tcp://localhost:) #connect to C++ search
  server database
    socket.send (query)

    # build the response body possibly using the environ dictionary
    response_body = 'The request method was %s' %
  environ['REQUEST_METHOD']

    # HTTP response code and message
    status = '200 OK'

    # These are HTTP headers expected by the client.
    # They must be wrapped as a list of tupled pairs:
    # [(Header name, Header value)].
    response_headers = [('Content-Type', 'text/plain'),
                        ('Content-Length', str(len(response_body)))]

    # Send them to the server using the supplied function
    start_response(status, response_headers)

    # Return the response body.
    # Notice it is wrapped in a list although it could be any iterable.
    return [response_body]

  --
  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 
  athttp://groups.google.com/group/modwsgi?hl=en.

-- 
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.



[modwsgi] Re: mod_wsgi compiled with Python 3.2.2?

2011-12-21 Thread Gnarlodious
I should add that I installed the Python from the package installer. Should 
I have built it custom-like?

-- Gnarlie

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/modwsgi/-/RC-ctfoZVbYJ.
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] Re: mod_wsgi compiled with Python 3.2.2?

2011-12-21 Thread Graham Dumpleton
Can you provide more context than that please?

Have you used mod_wsgi 4.X source code from mod_wsgi source code
repository? You can't use mod_wsgi 3.3 source code with Python 3.2.

Also, what platform are you doing this on?

Graham

On 21 December 2011 23:37, Gnarlodious gnarlodi...@gmail.com wrote:
 I should add that I installed the Python from the package installer. Should
 I have built it custom-like?

 -- Gnarlie

 --
 You received this message because you are subscribed to the Google Groups
 modwsgi group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/modwsgi/-/RC-ctfoZVbYJ.

 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.

-- 
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.



[modwsgi] Re: mod_wsgi compiled with Python 3.2.2?

2011-12-21 Thread Gnarlodious
No I didn't know there is a version 4, I'll keep it in mind for next time. 
The only reason I wanted to upgrade is that Py3.1 leaves all sorts of .pyc 
files in my workspace, and in Py3.2 they are corralled into a cache folder.

-- Gnarlie

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/modwsgi/-/z9zc-1DDawUJ.
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] Re: mod_wsgi compiled with Python 3.2.2?

2011-12-21 Thread Graham Dumpleton
On 22 December 2011 13:21, Gnarlodious gnarlodi...@gmail.com wrote:
 No I didn't know there is a version 4, I'll keep it in mind for next time.
 The only reason I wanted to upgrade is that Py3.1 leaves all sorts of .pyc
 files in my workspace, and in Py3.2 they are corralled into a cache folder.

I would imagine that behaviour may be optional and may require a
special configuration option to be added to mod_wsgi.

Will need to go find documentation about new feature and read it.

Graham

 -- Gnarlie

 --
 You received this message because you are subscribed to the Google Groups
 modwsgi group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/modwsgi/-/z9zc-1DDawUJ.

 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.

-- 
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.



[modwsgi] Re: mod_wsgi-3.3 Python 3.2 - apache2.2 - windows 7 build

2011-12-19 Thread Ahmed Hassan
i cloned source with Mercurial:  https://code.google.com/p/modwsgi/
In the folder there is win32-ap22py31.mk

renamed to win32-ap22py32.mk
and modified paths for python32, visual studio 10.0 and sdks/v7.0A

still getting error

c:\python32\include\pytime.h(21) : warning C4820: 'unnamed-tag' :
'4' bytes padding added after data member 'tv_usec'
c:\python32\include\bytesobject.h(41) : warning C4820: 'unnamed-
tag' : '3' bytes padding added after data member 'ob_sval'
c:\python32\include\longintrepr.h(92) : warning C4820: '_longobject' :
'2' bytes padding added after data member 'ob_digit'
c:\python32\include\pystate.h(83) : warning C4820: '_ts' : '2' bytes
padding added after data member 'recursion_critical'
c:\python32\include\pythonrun.h(172) : warning C4255:
'_Py_CheckPython3' : no function prototype given: converting '()' to
'(void)'
c:\Python32\include\node.h(12) : warning C4820: '_node' : '2' bytes
padding added after data member 'n_type'
Generating Code...
NMAKE : fatal error U1077: 'C:\Program Files\Microsoft Visual Studio
10.0\VC\BIN\cl.EXE' : return code '0x2'
Stop.

-- 
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.



[modwsgi] Re: mod_wsgi, apache, on RedHat - no module named os

2011-06-10 Thread Tim Kutz
Thanks, Graham.  Permissions on that lib directory were the issue.
We're over the hump with that, and on to some django config, now.
Thanks a ton!

On Jun 9, 7:14 pm, Graham Dumpleton graham.dumple...@gmail.com
wrote:
 The only thing I can see to suggest right now is to check whether the
 user Apache run as has permission to read everything in:

   /data2/app/python/python-26/

 In particular the directories under:

   /data2/app/python/python-26/lib/python2.6

 which based on you using that path for WSGIPythonHome, should exist.

 Only other thing can think of, not sure if this applies to RedHat, is
 that SELinux extensions are enabled in some was as to prevent Apache
 process accessing that directory hierarchy.

 Graham

 On 10 June 2011 03:35, Tim Kutz tkut...@gmail.com wrote:







  Hello -

  I have been attempting to set up an environment to run a django-based
  application using apache 2.2, mod_wsgi, and Python 2.6.  This is
  running on RHEL 5, which requires us to keep the default Python 2.4
  installed, as well.  I've gone through the documentation, as well as a
  number of threads that appeared to be related, and tried to follow
  those instructions, but nothing seems to be working.  Any help anyone
  can provide would be greatly appreciated.  I have tried to provide all
  relevant information below, but if I've missed anything, just ask.

  As it stands right now, I have managed to get to the point where
  Apache does send the request to Python through wsgi correctly, and the
  correct Python version (2.6.4) appears to be getting executed.  I am
  basing this on the following line in the apache log files, which
  appears during startup:

  [Thu Jun 09 14:02:36 2011] [notice] Apache/2.2.18 (Unix) mod_ssl/
  2.2.18 OpenSSL/0.9.8e-fips-rhel5 DAV/2 mod_wsgi/3.3 Python/2.6.4
  configured -- resuming normal operations

  However, when the script is run, it seems the python interpreter is
  unable to find the standard libraries, resulting in an import error
  for any referenced module, like so:

  [Thu Jun 09 15:24:13 2011] [error] [client 10.1.2.168] mod_wsgi
  (pid=25436): Target WSGI script '/data2/app/apphome/indivo/
  indivo_server/django.wsgi' cannot be loaded as Python module.
  [Thu Jun 09 15:24:13 2011] [error] [client 10.1.2.168] mod_wsgi
  (pid=25436): Exception occurred processing WSGI script '/data2/app/
  apphome/indivo/indivo_server/django.wsgi'.
  [Thu Jun 09 15:24:13 2011] [error] Traceback (most recent call last):
  [Thu Jun 09 15:24:13 2011] [error]   File /data2/app/apphome/indivo/
  indivo_server/django.wsgi, line 1, in module
  [Thu Jun 09 15:24:13 2011] [error]     import os
  [Thu Jun 09 15:24:13 2011] [error] ImportError: No module named os

  We have attempted to use virtualenv to set up the Python2.6
  environment, and pointed to it using the WSGI configuration
  parameters.  The relevant section of the httpd.conf section looks like
  this:

  -- BEGIN httpd.conf SNIPPET --
  IfModule wsgi_module
     DocumentRoot /data2/app/apphome/indivo/indivo_server
     Alias /static/ /data2/app/apphome/indivo/indivo_server/static/
     EnableMMAP  On
     EnableSendfile On
     LogLevel  warn

    Directory /data2/app/apphome/indivo/indivo_server
       Order deny,allow
       Allow from all
    /Directory
    WSGIPythonHome /data2/app/python/python-26/
    WSGIApplicationGroup %{GLOBAL}
    WSGIScriptAlias / /data2/app/apphome/indivo/indivo_server/
  django.wsgi
    WSGIPassAuthorization On

  /IfModule
  -- END httpd.conf SNIPPET --

  /data2/app/python/python-26/ is the location we created with
  virtualenv.  I have also tried pointing directly to library
  directories with WSGIPythonPath and WSGIPythonEggs directives, but
  nothing seems to make it able to locate the libraries.

  Also, from other threads I have seen, I have verified that the
  mod_wsgi.so we are using is correctly linked to python2.6:

  [ch143422@ndvodmo modules]$ ldd mod_wsgi.so
         linux-vdso.so.1 =  (0x7cdfc000)
         libpython2.6.so.1.0 = /usr/lib64/libpython2.6.so.1.0
  (0x2b2b4ba25000)
         libpthread.so.0 = /lib64/libpthread.so.0 (0x2b2b4bdcd000)
         libdl.so.2 = /lib64/libdl.so.2 (0x2b2b4bfe9000)
         libutil.so.1 = /lib64/libutil.so.1 (0x2b2b4c1ed000)
         libm.so.6 = /lib64/libm.so.6 (0x2b2b4c3f)
         libc.so.6 = /lib64/libc.so.6 (0x2b2b4c674000)
         /lib64/ld-linux-x86-64.so.2 (0x00304ce0)
  [ch143422@ndvodmo modules]$

  Tim Kutz

  --
  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 
  athttp://groups.google.com/group/modwsgi?hl=en.

-- 
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.

Re: [modwsgi] Re: mod_wsgi + virtualenv + multiple projects

2011-05-16 Thread Mr Kiwi

zelegolas,

If i understand the situation correctly, you just need to run an apache 
instance with modwsgi compiled for python2.6, where you would run all 
your projects which use python2.6.
Then, say on port 81, run another instance of apache with modwsgi 
compiled for python2.7, and again all your python2.7 projects sit under 
this.


The only think you cant do is run 2.6 projects and 2.7 projects on port 
80 at the same time, but it sounds like you're in development, not 
production anyway,


Graham will hopefully correct me if im wrong,

Regards,

MrKiwi

zelegolas wrote:

If I understand well mod_wsgi is completely useless in my case :(
Anyway thanks for your answer 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.



Re: [modwsgi] Re: mod_wsgi + virtualenv + multiple projects

2011-05-16 Thread Graham Dumpleton
On 16 May 2011 17:25, Mr Kiwi mrk...@gmail.com wrote:
 zelegolas,

 If i understand the situation correctly, you just need to run an apache
 instance with modwsgi compiled for python2.6, where you would run all your
 projects which use python2.6.
 Then, say on port 81, run another instance of apache with modwsgi compiled
 for python2.7, and again all your python2.7 projects sit under this.

 The only think you cant do is run 2.6 projects and 2.7 projects on port 80
 at the same time, but it sounds like you're in development, not production
 anyway,

 Graham will hopefully correct me if im wrong,

That is where you would actually run the two Apache instances on high
ports, eg 8080 and 8081, and the  run nginx on port 80 and proxy
appropriate URL namespaces to the Apache instances.

If desired, nginx can then be use for more high performance static
file serving and as means of isolating Apache from slow HTTP clients,
allowing Apache to run more efficiently few fewer process/thread and
memory resources.

Graham

 Regards,

 MrKiwi

 zelegolas wrote:

 If I understand well mod_wsgi is completely useless in my case :(
 Anyway thanks for your answer 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.



-- 
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.



[modwsgi] Re: mod_wsgi + virtualenv + multiple projects

2011-05-15 Thread zelegolas
If I understand well mod_wsgi is completely useless in my case :(
Anyway thanks for your answer 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.



Re: [modwsgi] Re: mod_wsgi + virtualenv + multiple projects

2011-05-15 Thread Graham Dumpleton
On 16 May 2011 07:03, zelegolas zelego...@gmail.com wrote:
 If I understand well mod_wsgi is completely useless in my case :(

Yes and no.

Within one single Apache instance you can't currently do what you
want. You could however run up multiple Apache instances where each
mod_wsgi uses different Apache version and use nginx in front.

A future daemon mode only variant of mod_wsgi may allow use of
different versions of Python to be used at same time, but that
embedded mode exists presently means that can't be done.

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.



[modwsgi] Re: mod_wsgi + multiprocessing

2011-05-02 Thread Ed Summers
Thanks very much for the detailed prodding at this...and for the
general advice. I figured it was a bad idea to be using
multiprocessing in the mod_wsgi environment, so I appreciate the
confirmation.

//Ed

On May 2, 7:55 pm, Graham Dumpleton graham.dumple...@gmail.com
wrote:
 Using the multiprocessing module within mod_wsgi is a really bad idea.
 This is because it is an embedded system where Apache and mod_wsgi
 manage processes. Once you start using multiprocessing module which
 tries to do its own process management, then it could potentially
 interfere with the operation of Apache/mod_wsgi in unexpected ways.

 For example, taking your example and changing it not to be dependent
 on web.py I get:

 import multiprocessing
 import os

 def x(y):
   print os.getpid(), 'x', y
   return y

 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)

     print 'create pool'
     pool = multiprocessing.Pool(processes=1)
     print 'map call'
     result = pool.map(x, [1])
     print os.getpid(), 'doit', result

     return [output]

 If I fire off a request to this it appears to work correctly,
 returning me hello world string and log the appropriate messages.

 [Tue May 03 09:40:36 2011] [info] [client 127.0.0.1] mod_wsgi
 (pid=32752, process='hello-1',
 application='hello-1.example.com|/mptest.wsgi'): Loading WSGI script
 '/Library/WebServer/Sites/hello-1/htdocs/mptest.wsgi'.
 [Tue May 03 09:40:36 2011] [error] create pool
 [Tue May 03 09:40:36 2011] [error] map call
 [Tue May 03 09:40:36 2011] [error] 32753 x 1
 [Tue May 03 09:40:36 2011] [error] 32752 doit [1]

 However, the process then appears to receive a signal from somewhere
 causing it to shutdown:

 [Tue May 03 09:40:36 2011] [info] mod_wsgi (pid=32752): Shutdown
 requested 'hello-1'.
 [Tue May 03 09:40:41 2011] [info] mod_wsgi (pid=32752): Aborting
 process 'hello-1'.

 The multiprocessing module does issue signals, so it may be the source of 
 this.

 One thought was that this may be occurring when the pool is destroyed
 at the end of the function call, so I moved the creation of pool to
 module scope.

 import multiprocessing
 import os

 print 'create pool'
 pool = multiprocessing.Pool(processes=1)

 def x(y):
   print os.getpid(), 'x', y
   return y

 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)

     print 'map call'
     result = pool.map(x, [1])
     print os.getpid(), 'doit', result

     return [output]

 This though will not even run:

 [Tue May 03 09:47:31 2011] [info] [client 127.0.0.1] mod_wsgi
 (pid=32893, process='hello-1',
 application='hello-1.example.com|/mptest.wsgi'): Loading WSGI script
 '/Library/WebServer/Sites/hello-1/htdocs/mptest.wsgi'.
 [Tue May 03 09:47:31 2011] [error] create pool
 [Tue May 03 09:47:31 2011] [error] map call
 [Tue May 03 09:47:31 2011] [error] Process PoolWorker-1:
 [Tue May 03 09:47:31 2011] [error] Traceback (most recent call last):
 [Tue May 03 09:47:31 2011] [error]   File
 /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/mul 
 tiprocessing/process.py,
 line 231, in _bootstrap
 [Tue May 03 09:47:31 2011] [error]     self.run()
 [Tue May 03 09:47:31 2011] [error]   File
 /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/mul 
 tiprocessing/process.py,
 line 88, in run
 [Tue May 03 09:47:31 2011] [error]     self._target(*self._args, 
 **self._kwargs)
 [Tue May 03 09:47:31 2011] [error]   File
 /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/mul 
 tiprocessing/pool.py,
 line 57, in worker
 [Tue May 03 09:47:31 2011] [error]     task = get()
 [Tue May 03 09:47:31 2011] [error]   File
 /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/mul 
 tiprocessing/queues.py,
 line 339, in get
 [Tue May 03 09:47:31 2011] [error]     return recv()
 [Tue May 03 09:47:31 2011] [error] AttributeError: 'module' object has
 no attribute 'x'

 The browser also then hangs at that point.

 Part of the issue here may be that WSGI script files are not really
 standard Python modules in that the basename of the WSGI script file
 doesn't match a module in sys.modules. If the multiprocessing module
 tries to do magic stuff with imports to find original code to execute
 in sub process it isn't going to work.

 Specifically, may be related to:

 http://code.google.com/p/modwsgi/wiki/IssuesWithPickleModule

 If I attempt to move x() into being a nested function as:

 import multiprocessing
 import os

 print 'create pool'
 pool = multiprocessing.Pool(processes=1)

 def application(environ, start_response):
     status = '200 OK'
     

[modwsgi] Re: mod_wsgi and apache on windows

2011-04-28 Thread Graham Dumpleton
Please use the mod_wsgi mailing list, don't mail me directly. Ensure
you use reply-all to this email to ensure followups go back to the
mailing list.

First though go watch:

http://code.google.com/p/modwsgi/wiki/WhereToGetHelp?tm=6#Conference_Presentations

It talks about reasons for permissions error.

In short, the Apache service runs as a special user. It would appear
that that user doesn't have permissions to access your WSGI script
file or the directory it is in.

Graham

On 28 April 2011 21:45, Hanson Johnson nijabizcen...@gmail.com wrote:
 Attached is my apache configuration file as edited.
 Please help me out, I am a complete beginner in this course, sorry for
 taking your time.
 I followed the instructions here
  http://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide
 when I got here
  WSGIScriptAlias /myapp /usr/local/www/wsgi-scripts/myapp.wsgi

 I used the path to my applications folder:

 WSGIScriptAlias /wsgi “C:/myapp/wsgi_handler.py (Please is this line
 right?)
 Directory C:/myapp Order allow,deny Allow from all /Directory
 I am using windows 7 and as at now, my apache is still running. But when I
 visit http://localhost/wsgi it will tell me Forbidden You don't have
 permission to access /wsgi on this server.
 Please I don't know what to do again because I need to succeed here before
 moving on to Django.
 I will be grateful.

-- 
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] Re: Mod_wsgi ...

2011-03-10 Thread Ademir Francisco da Silva
Hi all,

Sorry by delay ... but I want to say thank for all of you ...

I have not resolved my problem yet, because I cannot found a good
solution for that, however I will verify all suggestions and think
about it..., who knows I have a insight and decide to change for the
Ubuntu or changes my Python installation from 64 to 32bits... Anyway,
thank you very much for your assistance and good will.


Cheers,

2011/3/6, Graham Dumpleton graham.dumple...@gmail.com:
 On 7 March 2011 03:09, Ademir Francisco da Silva ademirfs@gmail.com
 wrote:
 Hello all,

 Graham ...,

 I have sent only to you several emails on January_2011. Just look for
 them, Ok.
 As I told you before ( 01/2011 ) everything is right with the Python's
 installation except that it is 64bits, I am not sure whether is a big
 problem ...

 Yes it is a big deal. As I said this time and would have said the last
 time, you can't use 64 bit Python with the precompiled mod_wsgi.so
 file on the mod_wsgi site as it is only 32 bit.

 Your only possible opportunity for using 64 bit Python if you cannot
 compile mod_wsgi yourself from source code, is to use ActiveState
 Python as it supplies a 64 bit mod_wsgi.so file. See:

   http://code.activestate.com/pypm/modwsgi-apache2.2/

 You will have to work out where to get 64 bit Apache though as I don't
 know where to get it from. Plus you likely would need to use
 ActiveState Python installation as well.

 Having said that, if you look at the download page for mod_wsgi at:

   http://code.google.com/p/modwsgi/wiki/DownloadTheSoftware?tm=2

 it explicitly says:

 Note that these binaries will only work for 32 bit Python and 32
 bit Apache. If you need to use 64 bit Python and 64 bit Apache and
 can't compile mod_wsgi yourself from source code, you may look at the
 Windows binaries available for ActivateState Python. It is presumed
 that you have to be using ActivateState? Python installation for them
 to work. It is not known where you would however get 64 bit Apache
 from as believe ASF only provides a 32 bit installer.

 So, nothing has changed since you mailed me in January.

 Graham

 All users is default of the Python's installation so I do not change
 it for my installation too.

 Rich ...

 Of course. I did it.

 Guys ...

 I really need a help because is very important to solve it asap. Only
 2 person talk to me about it and this is too few people. Please I know
 there are more than this so let's go and be kind with the newbee and
 answer me if it is possible. I am waiting for your suggestions,
 Thank you very much for your understanding and assistance.



 2011/3/4, Rich richwand...@gmail.com:
 did you rename the file to mod_wsgi.so before trying to load it?

 On Mar 3, 11:23 pm, Ademir Francisco da Silva ademirfs@gmail.com
 wrote:
 Hi all,

 I really need to solve a weird problem and this group is the right
 place to do that, so ...

 After I have installed the mod_swgi in my PC I have tried to access it
 via Apache and nothing happened as matter of fact it returns me a
 follow message ...

 httpd.exe: Syntax error on line 128 of C:/Program Files (x86)/Apache
 Software Foundation/Apache2.2/conf/httpd.conf:  Cannot load C:/Program
 Files (x86)/Apache Software Foundation/Apache2.2/modules/mod_wsgi.so
 into server:  The specified module could not be found.

 Further information 

 1 ) The correct module mod_wsgi is there in that path above ( I have
 got it
 fromhttp://code.google.com/p/modwsgi/downloads/detail?name=mod_wsgi-win32...
 ), and the  httpd.conf  file is Ok too ...
 2 ) I have installed the Python 2.7.1 ...
 3 ) I have installed Apache httpd Server 2.2.17_win32 - x86 -
 Openssl_0.9.8o.msi ...
 4 ) I have got the Windows Vista 64 ...

 Apparently everything is right so please help me and give me a light
 because I don't know what to do. Thanks.

 Cheers,

 --
 Ademir Francisco da Silva

 PS. I already have talking about it with Mr. Graham and he told me to
 try solve it with all you, so I was waiting sugestions. One more thing
 my S.O. is Windows Vista 64 as reported above and my Apache is 32bits,
 however, I am wondering whether someone have the same problem and how
 he/she solve it. Thanks again.

 --
 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.




 --
 Ademir Francisco da Silva

 --
 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.



 --
 You received this message because you are subscribed to the Google Groups
 modwsgi group.
 

Re: [modwsgi] Re: Mod_wsgi ...

2011-03-06 Thread Ademir Francisco da Silva
Hello all,

Graham ...,

I have sent only to you several emails on January_2011. Just look for them, Ok.
As I told you before ( 01/2011 ) everything is right with the Python's
installation except that it is 64bits, I am not sure whether is a big
problem ...
All users is default of the Python's installation so I do not change
it for my installation too.

Rich ...

Of course. I did it.

Guys ...

I really need a help because is very important to solve it asap. Only
2 person talk to me about it and this is too few people. Please I know
there are more than this so let's go and be kind with the newbee and
answer me if it is possible. I am waiting for your suggestions,
Thank you very much for your understanding and assistance.



2011/3/4, Rich richwand...@gmail.com:
 did you rename the file to mod_wsgi.so before trying to load it?

 On Mar 3, 11:23 pm, Ademir Francisco da Silva ademirfs@gmail.com
 wrote:
 Hi all,

 I really need to solve a weird problem and this group is the right
 place to do that, so ...

 After I have installed the mod_swgi in my PC I have tried to access it
 via Apache and nothing happened as matter of fact it returns me a
 follow message ...

 httpd.exe: Syntax error on line 128 of C:/Program Files (x86)/Apache
 Software Foundation/Apache2.2/conf/httpd.conf:  Cannot load C:/Program
 Files (x86)/Apache Software Foundation/Apache2.2/modules/mod_wsgi.so
 into server:  The specified module could not be found.

 Further information 

 1 ) The correct module mod_wsgi is there in that path above ( I have
 got it
 fromhttp://code.google.com/p/modwsgi/downloads/detail?name=mod_wsgi-win32...
 ), and the  httpd.conf  file is Ok too ...
 2 ) I have installed the Python 2.7.1 ...
 3 ) I have installed Apache httpd Server 2.2.17_win32 - x86 -
 Openssl_0.9.8o.msi ...
 4 ) I have got the Windows Vista 64 ...

 Apparently everything is right so please help me and give me a light
 because I don't know what to do. Thanks.

 Cheers,

 --
 Ademir Francisco da Silva

 PS. I already have talking about it with Mr. Graham and he told me to
 try solve it with all you, so I was waiting sugestions. One more thing
 my S.O. is Windows Vista 64 as reported above and my Apache is 32bits,
 however, I am wondering whether someone have the same problem and how
 he/she solve it. Thanks again.

 --
 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.




-- 
Ademir Francisco da Silva

-- 
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] Re: Mod_wsgi ...

2011-03-06 Thread Carl Nobile
Ademir,

Both Apache and Python must be compiled for 64 bits. In other words both
must be compiled the same either 32 or 64 bits.
Both Apache should have libs compiled for x86_64 if they are both 64 bit.

You can use the ldd command to see how they are compiled. You will notice
that on the machine I used all the libs come from one of two /lib64
directories, there are no 32 bit libs being used at all.

$ ldd httpd
libm.so.6 = /lib64/libm.so.6 (0x2b3713248000)
libpcre.so.0 = /lib64/libpcre.so.0 (0x2b37134cb000)
libselinux.so.1 = /lib64/libselinux.so.1 (0x2b37136e7000)
libaprutil-1.so.0 = /usr/lib64/libaprutil-1.so.0
(0x2b371390)
libcrypt.so.1 = /lib64/libcrypt.so.1 (0x2b3713b1d000)
libldap-2.3.so.0 = /usr/lib64/libldap-2.3.so.0 (0x2b3713d55000)
liblber-2.3.so.0 = /usr/lib64/liblber-2.3.so.0 (0x2b3713f9)
libdb-4.3.so = /lib64/libdb-4.3.so (0x2b371419e000)
libexpat.so.0 = /lib64/libexpat.so.0 (0x2b3714493000)
libapr-1.so.0 = /usr/lib64/libapr-1.so.0 (0x2b37146b6000)
libpthread.so.0 = /lib64/libpthread.so.0 (0x2b37148dd000)
libdl.so.2 = /lib64/libdl.so.2 (0x2b3714af7000)
libc.so.6 = /lib64/libc.so.6 (0x2b3714cfc000)
libsepol.so.1 = /lib64/libsepol.so.1 (0x2b371504f000)
/lib64/ld-linux-x86-64.so.2 (0x2b371302c000)
libuuid.so.1 = /lib64/libuuid.so.1 (0x2b3715295000)
libpq.so.4 = /usr/lib64/libpq.so.4 (0x2b371549a000)
libsqlite3.so.0 = /usr/lib64/libsqlite3.so.0 (0x2b37156bc000)
libresolv.so.2 = /lib64/libresolv.so.2 (0x2b3715927000)
libsasl2.so.2 = /usr/lib64/libsasl2.so.2 (0x2b3715b3d000)
libssl.so.6 = /lib64/libssl.so.6 (0x2b3715d56000)
libcrypto.so.6 = /lib64/libcrypto.so.6 (0x2b3715fa2000)
libkrb5.so.3 = /usr/lib64/libkrb5.so.3 (0x2b37162f4000)
libnsl.so.1 = /lib64/libnsl.so.1 (0x2b3716586000)
libgssapi_krb5.so.2 = /usr/lib64/libgssapi_krb5.so.2
(0x2b371679f000)
libcom_err.so.2 = /lib64/libcom_err.so.2 (0x2b37169cd000)
libk5crypto.so.3 = /usr/lib64/libk5crypto.so.3 (0x2b3716bcf000)
libz.so.1 = /usr/lib64/libz.so.1 (0x2b3716df5000)
libkrb5support.so.0 = /usr/lib64/libkrb5support.so.0
(0x2b3717009000)
libkeyutils.so.1 = /lib64/libkeyutils.so.1 (0x2b3717211000)

$ ldd python
libpython2.7.so.1.0 =
/opt/local/toolkit/python-2.7/lib/libpython2.7.so.1.0 (0x2b7269874000)
libpthread.so.0 = /lib64/libpthread.so.0 (0x00314540)
libdl.so.2 = /lib64/libdl.so.2 (0x00314500)
libutil.so.1 = /lib64/libutil.so.1 (0x00314d40)
libm.so.6 = /lib64/libm.so.6 (0x003dd260)
libc.so.6 = /lib64/libc.so.6 (0x003144c0)
/lib64/ld-linux-x86-64.so.2 (0x00314480)

~Carl

On Sun, Mar 6, 2011 at 11:09 AM, Ademir Francisco da Silva 
ademirfs@gmail.com wrote:

 Hello all,

 Graham ...,

 I have sent only to you several emails on January_2011. Just look for them,
 Ok.
 As I told you before ( 01/2011 ) everything is right with the Python's
 installation except that it is 64bits, I am not sure whether is a big
 problem ...
 All users is default of the Python's installation so I do not change
 it for my installation too.

 Rich ...

 Of course. I did it.

 Guys ...

 I really need a help because is very important to solve it asap. Only
 2 person talk to me about it and this is too few people. Please I know
 there are more than this so let's go and be kind with the newbee and
 answer me if it is possible. I am waiting for your suggestions,
 Thank you very much for your understanding and assistance.



 2011/3/4, Rich richwand...@gmail.com:
  did you rename the file to mod_wsgi.so before trying to load it?
 
  On Mar 3, 11:23 pm, Ademir Francisco da Silva ademirfs@gmail.com
  wrote:
  Hi all,
 
  I really need to solve a weird problem and this group is the right
  place to do that, so ...
 
  After I have installed the mod_swgi in my PC I have tried to access it
  via Apache and nothing happened as matter of fact it returns me a
  follow message ...
 
  httpd.exe: Syntax error on line 128 of C:/Program Files (x86)/Apache
  Software Foundation/Apache2.2/conf/httpd.conf:  Cannot load C:/Program
  Files (x86)/Apache Software Foundation/Apache2.2/modules/mod_wsgi.so
  into server:  The specified module could not be found.
 
  Further information 
 
  1 ) The correct module mod_wsgi is there in that path above ( I have
  got it
  fromhttp://
 code.google.com/p/modwsgi/downloads/detail?name=mod_wsgi-win32...
  ), and the  httpd.conf  file is Ok too ...
  2 ) I have installed the Python 2.7.1 ...
  3 ) I have installed Apache httpd Server 2.2.17_win32 - x86 -
  Openssl_0.9.8o.msi ...
  4 ) I have got the Windows Vista 64 ...
 
  Apparently everything is right so please help me and 

Re: [modwsgi] Re: Mod_wsgi ...

2011-03-06 Thread Carl Nobile
Ademir,

Sorry, I hadn't realized that you were using this on a Windows box my
apologies, however the fact that both Apache and Python need to be compiled
for the same bit width is still necessary. I don't know how to test this on
a windows machine since I never use them. You did mention in your 1st post
that Apache is 32 bit and in your 2nd post that Python is 64 bit. It will
never ever work like this, both MUST be the same.

~Carl

On Sun, Mar 6, 2011 at 1:13 PM, Carl Nobile carl.nob...@gmail.com wrote:

 Ademir,

 Both Apache and Python must be compiled for 64 bits. In other words both
 must be compiled the same either 32 or 64 bits.
 Both Apache should have libs compiled for x86_64 if they are both 64 bit.

 You can use the ldd command to see how they are compiled. You will notice
 that on the machine I used all the libs come from one of two /lib64
 directories, there are no 32 bit libs being used at all.

 $ ldd httpd
 libm.so.6 = /lib64/libm.so.6 (0x2b3713248000)
 libpcre.so.0 = /lib64/libpcre.so.0 (0x2b37134cb000)
 libselinux.so.1 = /lib64/libselinux.so.1 (0x2b37136e7000)
 libaprutil-1.so.0 = /usr/lib64/libaprutil-1.so.0
 (0x2b371390)
 libcrypt.so.1 = /lib64/libcrypt.so.1 (0x2b3713b1d000)
 libldap-2.3.so.0 = /usr/lib64/libldap-2.3.so.0
 (0x2b3713d55000)
 liblber-2.3.so.0 = /usr/lib64/liblber-2.3.so.0
 (0x2b3713f9)
 libdb-4.3.so = /lib64/libdb-4.3.so (0x2b371419e000)
 libexpat.so.0 = /lib64/libexpat.so.0 (0x2b3714493000)
 libapr-1.so.0 = /usr/lib64/libapr-1.so.0 (0x2b37146b6000)
 libpthread.so.0 = /lib64/libpthread.so.0 (0x2b37148dd000)
 libdl.so.2 = /lib64/libdl.so.2 (0x2b3714af7000)
 libc.so.6 = /lib64/libc.so.6 (0x2b3714cfc000)
 libsepol.so.1 = /lib64/libsepol.so.1 (0x2b371504f000)
 /lib64/ld-linux-x86-64.so.2 (0x2b371302c000)
 libuuid.so.1 = /lib64/libuuid.so.1 (0x2b3715295000)
 libpq.so.4 = /usr/lib64/libpq.so.4 (0x2b371549a000)
 libsqlite3.so.0 = /usr/lib64/libsqlite3.so.0 (0x2b37156bc000)
 libresolv.so.2 = /lib64/libresolv.so.2 (0x2b3715927000)
 libsasl2.so.2 = /usr/lib64/libsasl2.so.2 (0x2b3715b3d000)
 libssl.so.6 = /lib64/libssl.so.6 (0x2b3715d56000)
 libcrypto.so.6 = /lib64/libcrypto.so.6 (0x2b3715fa2000)
 libkrb5.so.3 = /usr/lib64/libkrb5.so.3 (0x2b37162f4000)
 libnsl.so.1 = /lib64/libnsl.so.1 (0x2b3716586000)
 libgssapi_krb5.so.2 = /usr/lib64/libgssapi_krb5.so.2
 (0x2b371679f000)
 libcom_err.so.2 = /lib64/libcom_err.so.2 (0x2b37169cd000)
 libk5crypto.so.3 = /usr/lib64/libk5crypto.so.3
 (0x2b3716bcf000)
 libz.so.1 = /usr/lib64/libz.so.1 (0x2b3716df5000)
 libkrb5support.so.0 = /usr/lib64/libkrb5support.so.0
 (0x2b3717009000)
 libkeyutils.so.1 = /lib64/libkeyutils.so.1 (0x2b3717211000)

 $ ldd python
 libpython2.7.so.1.0 =
 /opt/local/toolkit/python-2.7/lib/libpython2.7.so.1.0 (0x2b7269874000)
 libpthread.so.0 = /lib64/libpthread.so.0 (0x00314540)
 libdl.so.2 = /lib64/libdl.so.2 (0x00314500)
 libutil.so.1 = /lib64/libutil.so.1 (0x00314d40)
 libm.so.6 = /lib64/libm.so.6 (0x003dd260)
 libc.so.6 = /lib64/libc.so.6 (0x003144c0)
 /lib64/ld-linux-x86-64.so.2 (0x00314480)

 ~Carl


 On Sun, Mar 6, 2011 at 11:09 AM, Ademir Francisco da Silva 
 ademirfs@gmail.com wrote:

 Hello all,

 Graham ...,

 I have sent only to you several emails on January_2011. Just look for
 them, Ok.
 As I told you before ( 01/2011 ) everything is right with the Python's
 installation except that it is 64bits, I am not sure whether is a big
 problem ...
 All users is default of the Python's installation so I do not change
 it for my installation too.

 Rich ...

 Of course. I did it.

 Guys ...

 I really need a help because is very important to solve it asap. Only
 2 person talk to me about it and this is too few people. Please I know
 there are more than this so let's go and be kind with the newbee and
 answer me if it is possible. I am waiting for your suggestions,
 Thank you very much for your understanding and assistance.



 2011/3/4, Rich richwand...@gmail.com:
  did you rename the file to mod_wsgi.so before trying to load it?
 
  On Mar 3, 11:23 pm, Ademir Francisco da Silva ademirfs@gmail.com
  wrote:
  Hi all,
 
  I really need to solve a weird problem and this group is the right
  place to do that, so ...
 
  After I have installed the mod_swgi in my PC I have tried to access it
  via Apache and nothing happened as matter of fact it returns me a
  follow message ...
 
  httpd.exe: Syntax error on line 128 of C:/Program Files (x86)/Apache
  Software Foundation/Apache2.2/conf/httpd.conf:  Cannot load C:/Program
  Files (x86)/Apache 

Re: [modwsgi] Re: Mod_wsgi ...

2011-03-06 Thread Graham Dumpleton
On 7 March 2011 03:09, Ademir Francisco da Silva ademirfs@gmail.com wrote:
 Hello all,

 Graham ...,

 I have sent only to you several emails on January_2011. Just look for them, 
 Ok.
 As I told you before ( 01/2011 ) everything is right with the Python's
 installation except that it is 64bits, I am not sure whether is a big
 problem ...

Yes it is a big deal. As I said this time and would have said the last
time, you can't use 64 bit Python with the precompiled mod_wsgi.so
file on the mod_wsgi site as it is only 32 bit.

Your only possible opportunity for using 64 bit Python if you cannot
compile mod_wsgi yourself from source code, is to use ActiveState
Python as it supplies a 64 bit mod_wsgi.so file. See:

  http://code.activestate.com/pypm/modwsgi-apache2.2/

You will have to work out where to get 64 bit Apache though as I don't
know where to get it from. Plus you likely would need to use
ActiveState Python installation as well.

Having said that, if you look at the download page for mod_wsgi at:

  http://code.google.com/p/modwsgi/wiki/DownloadTheSoftware?tm=2

it explicitly says:

Note that these binaries will only work for 32 bit Python and 32
bit Apache. If you need to use 64 bit Python and 64 bit Apache and
can't compile mod_wsgi yourself from source code, you may look at the
Windows binaries available for ActivateState Python. It is presumed
that you have to be using ActivateState? Python installation for them
to work. It is not known where you would however get 64 bit Apache
from as believe ASF only provides a 32 bit installer.

So, nothing has changed since you mailed me in January.

Graham

 All users is default of the Python's installation so I do not change
 it for my installation too.

 Rich ...

 Of course. I did it.

 Guys ...

 I really need a help because is very important to solve it asap. Only
 2 person talk to me about it and this is too few people. Please I know
 there are more than this so let's go and be kind with the newbee and
 answer me if it is possible. I am waiting for your suggestions,
 Thank you very much for your understanding and assistance.



 2011/3/4, Rich richwand...@gmail.com:
 did you rename the file to mod_wsgi.so before trying to load it?

 On Mar 3, 11:23 pm, Ademir Francisco da Silva ademirfs@gmail.com
 wrote:
 Hi all,

 I really need to solve a weird problem and this group is the right
 place to do that, so ...

 After I have installed the mod_swgi in my PC I have tried to access it
 via Apache and nothing happened as matter of fact it returns me a
 follow message ...

 httpd.exe: Syntax error on line 128 of C:/Program Files (x86)/Apache
 Software Foundation/Apache2.2/conf/httpd.conf:  Cannot load C:/Program
 Files (x86)/Apache Software Foundation/Apache2.2/modules/mod_wsgi.so
 into server:  The specified module could not be found.

 Further information 

 1 ) The correct module mod_wsgi is there in that path above ( I have
 got it
 fromhttp://code.google.com/p/modwsgi/downloads/detail?name=mod_wsgi-win32...
 ), and the  httpd.conf  file is Ok too ...
 2 ) I have installed the Python 2.7.1 ...
 3 ) I have installed Apache httpd Server 2.2.17_win32 - x86 -
 Openssl_0.9.8o.msi ...
 4 ) I have got the Windows Vista 64 ...

 Apparently everything is right so please help me and give me a light
 because I don't know what to do. Thanks.

 Cheers,

 --
 Ademir Francisco da Silva

 PS. I already have talking about it with Mr. Graham and he told me to
 try solve it with all you, so I was waiting sugestions. One more thing
 my S.O. is Windows Vista 64 as reported above and my Apache is 32bits,
 however, I am wondering whether someone have the same problem and how
 he/she solve it. Thanks again.

 --
 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.




 --
 Ademir Francisco da Silva

 --
 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.



-- 
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.



[modwsgi] Re: mod_wsgi build problems

2011-02-11 Thread octopusgrabbus
I stand corrected. By starting apache manually, I was lulled into a
false sense apache would find the shared library. It did not on
reboot. After doing a make clean and issuing your instructions below
and make install, all is well.
Thanks again.

 This setting will not be used by mod_wsgi when run under Apache as
 Apache doesn't inherit your user environment unless you are actually
 running Apache as yourself.

 In cases where OS default library search path doesn't include
 directory where libpythonX.Y.so is installed, you can at time of
 compiling mod_wsgi go:

   LD_RUN_PATH=/usr/local/lib make

 The LD_RUN_PATH environment variable when set for a compilation, will
 cause that path to be embedded in the resultant .so and so it will now
 how to find the library at runtime automatically.

 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.



[modwsgi] Re: mod_wsgi build problems

2011-02-09 Thread octopusgrabbus
Your way is better by embedding the path at configure time. Apache is
working with this. Root's config is set to load this library.

Oh and by the way, thanks for all your help. It was invaluable.

On Feb 8, 9:57 pm, Graham Dumpleton graham.dumple...@gmail.com
wrote:
 On 8 February 2011 05:52, octopusgrabbus old_road_f...@verizon.net wrote:

  Success. Reconfigured Python 2.6.6 with
  --enable-shared
  put in link

  lrwxrwxrwx 1 root root 30 Feb  7 12:01 /usr/local/lib/python2.6/config/
  libpython
  2.6.so - /usr/local/lib/libpython2.6.so

  And loaded the library from .bashrc
  export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

 This setting will not be used by mod_wsgi when run under Apache as
 Apache doesn't inherit your user environment unless you are actually
 running Apache as yourself.

 In cases where OS default library search path doesn't include
 directory where libpythonX.Y.so is installed, you can at time of
 compiling mod_wsgi go:

   LD_RUN_PATH=/usr/local/lib make

 The LD_RUN_PATH environment variable when set for a compilation, will
 cause that path to be embedded in the resultant .so and so it will now
 how to find the library at runtime automatically.

 Graham

  mod_wsgi built fine.

  Thanks for the fine-tuned responses.

  On Feb 7, 11:46 am, octopusgrabbus old_road_f...@verizon.net wrote:
  Graham:

  I rebuilt Python 2.6.6 using the --enable-shared switch on config.
  This produced /usr/local/lib/libpython2.6.so.1.0

  I put a symlink in Python2.6/config libpython2.6.so.1.0 - /usr/local/
  lib/libpython2.6.so.1.0, right along side the static library.

  But when I configure mod_wsgi, I get multiple errors complaining the
  shared library cannot be found.

  /usr/local/bin/python: error while loading shared libraries:
  libpython2.6.so.1.0
  : cannot open shared object file: No such file or directory

  What am I doing wrong?
  tnx
  cmn

  On Feb 7, 10:15 am, Graham Dumpleton graham.dumple...@gmail.com
  wrote:

   Please keep discussion on the mailing list.

   On 8 February 2011 01:58, octopusgrabbus old_road_f...@verizon.net 
   wrote:

Graham:

My answer back to you was not intended to be flip. I looked at the
link you posted this morning, and cannot find the instructions to
rebuild Python on this 64-bit system. I have asked in a number of
places, including the Python forums. One of the answers I got back was
very flip, saying use twisted. I've really tried to get an answer or
re-installing Python and am running into a wall.

   Since your Python is installed under /usr/local/ and not /usr then it
   presumably was installed from source code. Look in the file:

     /usr/local/lib/python2.6/config/Makefile

   and look for the value of the CONFIG_VARS variable. For example, of my
   MacOS X system (different to what you are using), it has:

   CONFIG_ARGS=     '--prefix=/usr' '--mandir=/usr/share/man'
   '--infodir=/usr/share/info' '--disable-dependency-tracking'
   '--enable-ipv6' '--with-threads'
   '--enable-framework=/System/Library/Frameworks'
   '--enable-toolbox-glue' '--enable-dtrace' '--with-system-ffi'
   '--with-gcc=gcc-4.2' 'CC=gcc-4.2' 'CXX=g++-4.2' 'CFLAGS=-g -Os -pipe
   -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd
   -I/usr/include/ffi -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall
   -Wstrict-prototypes -Wshorten-64-to-32' 'LDFLAGS=-Wl,-F.'

   Thos arguments were what was originally supplied to the 'configure'
   script of Python when it was built from source code.

   Post what you find for those in your installation.

   What you would then do to duplicate same build, is to download Python
   source code tar ball fromwww.python.org. You go into the Python
   source tree after you unpack the tar ball. Normally, you would read
   the README which explains how to install Python from source code. The
   simple way in your case though is to just use the same options for
   'configure' as CONFIG_VARS lists for YOUR existing installation,
   except that you MUST also add the '--enable-shared' option as well.
   You might also want to change the value of the '--prefix' option so it
   installs into different location in overwriting the existing Python
   installation would be a problem.

   Check the README in the Python source code for further details on how
   to install it.

   Graham

Thanks.
cmn

On Feb 7, 9:30 am, Graham Dumpleton graham.dumple...@gmail.com
wrote:
Read:

 http://code.google.com/p/modwsgi/wiki/InstallationIssues#Mixing_32_Bi...

Solution is to use a Python installation that provides a shared 
library.

Graham

On 5 February 2011 03:06, octopusgrabbus octopusgrab...@gmail.com 
wrote:

 I've run into a build problem, and am wondering about the best
 solution for fixing it. This is an RHEL 5 WS system.

 Here is the error from running make. ./configure completed fine.

 /usr/lib64/apr-1/build/libtool --silent --mode=link gcc -o
 mod_wsgi.la  

Re: [modwsgi] Re: mod_wsgi build problems

2011-02-08 Thread Graham Dumpleton
On 8 February 2011 05:52, octopusgrabbus old_road_f...@verizon.net wrote:
 Success. Reconfigured Python 2.6.6 with
 --enable-shared
 put in link

 lrwxrwxrwx 1 root root 30 Feb  7 12:01 /usr/local/lib/python2.6/config/
 libpython
 2.6.so - /usr/local/lib/libpython2.6.so

 And loaded the library from .bashrc
 export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

This setting will not be used by mod_wsgi when run under Apache as
Apache doesn't inherit your user environment unless you are actually
running Apache as yourself.

In cases where OS default library search path doesn't include
directory where libpythonX.Y.so is installed, you can at time of
compiling mod_wsgi go:

  LD_RUN_PATH=/usr/local/lib make

The LD_RUN_PATH environment variable when set for a compilation, will
cause that path to be embedded in the resultant .so and so it will now
how to find the library at runtime automatically.

Graham

 mod_wsgi built fine.

 Thanks for the fine-tuned responses.

 On Feb 7, 11:46 am, octopusgrabbus old_road_f...@verizon.net wrote:
 Graham:

 I rebuilt Python 2.6.6 using the --enable-shared switch on config.
 This produced /usr/local/lib/libpython2.6.so.1.0

 I put a symlink in Python2.6/config libpython2.6.so.1.0 - /usr/local/
 lib/libpython2.6.so.1.0, right along side the static library.

 But when I configure mod_wsgi, I get multiple errors complaining the
 shared library cannot be found.

 /usr/local/bin/python: error while loading shared libraries:
 libpython2.6.so.1.0
 : cannot open shared object file: No such file or directory

 What am I doing wrong?
 tnx
 cmn

 On Feb 7, 10:15 am, Graham Dumpleton graham.dumple...@gmail.com
 wrote:

  Please keep discussion on the mailing list.

  On 8 February 2011 01:58, octopusgrabbus old_road_f...@verizon.net wrote:

   Graham:

   My answer back to you was not intended to be flip. I looked at the
   link you posted this morning, and cannot find the instructions to
   rebuild Python on this 64-bit system. I have asked in a number of
   places, including the Python forums. One of the answers I got back was
   very flip, saying use twisted. I've really tried to get an answer or
   re-installing Python and am running into a wall.

  Since your Python is installed under /usr/local/ and not /usr then it
  presumably was installed from source code. Look in the file:

    /usr/local/lib/python2.6/config/Makefile

  and look for the value of the CONFIG_VARS variable. For example, of my
  MacOS X system (different to what you are using), it has:

  CONFIG_ARGS=     '--prefix=/usr' '--mandir=/usr/share/man'
  '--infodir=/usr/share/info' '--disable-dependency-tracking'
  '--enable-ipv6' '--with-threads'
  '--enable-framework=/System/Library/Frameworks'
  '--enable-toolbox-glue' '--enable-dtrace' '--with-system-ffi'
  '--with-gcc=gcc-4.2' 'CC=gcc-4.2' 'CXX=g++-4.2' 'CFLAGS=-g -Os -pipe
  -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd
  -I/usr/include/ffi -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall
  -Wstrict-prototypes -Wshorten-64-to-32' 'LDFLAGS=-Wl,-F.'

  Thos arguments were what was originally supplied to the 'configure'
  script of Python when it was built from source code.

  Post what you find for those in your installation.

  What you would then do to duplicate same build, is to download Python
  source code tar ball fromwww.python.org. You go into the Python
  source tree after you unpack the tar ball. Normally, you would read
  the README which explains how to install Python from source code. The
  simple way in your case though is to just use the same options for
  'configure' as CONFIG_VARS lists for YOUR existing installation,
  except that you MUST also add the '--enable-shared' option as well.
  You might also want to change the value of the '--prefix' option so it
  installs into different location in overwriting the existing Python
  installation would be a problem.

  Check the README in the Python source code for further details on how
  to install it.

  Graham

   Thanks.
   cmn

   On Feb 7, 9:30 am, Graham Dumpleton graham.dumple...@gmail.com
   wrote:
   Read:

    http://code.google.com/p/modwsgi/wiki/InstallationIssues#Mixing_32_Bi...

   Solution is to use a Python installation that provides a shared library.

   Graham

   On 5 February 2011 03:06, octopusgrabbus octopusgrab...@gmail.com 
   wrote:

I've run into a build problem, and am wondering about the best
solution for fixing it. This is an RHEL 5 WS system.

Here is the error from running make. ./configure completed fine.

/usr/lib64/apr-1/build/libtool --silent --mode=link gcc -o
mod_wsgi.la  -rpath /
usr/lib64/httpd/modules -module -avoid-version    mod_wsgi.lo -L/usr/
local/lib -
L/usr/local/lib/python2.6/config -lpython2.6 -lpthread -ldl -lutil -lm
/usr/bin/ld: /usr/local/lib/libpython2.6.a(node.o): relocation
R_X86_64_32 again
st `a local symbol' can not be used when making a shared object;
recompile with
-fPIC

[modwsgi] Re: mod_wsgi build problems

2011-02-07 Thread Graham Dumpleton
Please keep discussion on the mailing list.

On 8 February 2011 01:58, octopusgrabbus old_road_f...@verizon.net wrote:
 Graham:

 My answer back to you was not intended to be flip. I looked at the
 link you posted this morning, and cannot find the instructions to
 rebuild Python on this 64-bit system. I have asked in a number of
 places, including the Python forums. One of the answers I got back was
 very flip, saying use twisted. I've really tried to get an answer or
 re-installing Python and am running into a wall.

Since your Python is installed under /usr/local/ and not /usr then it
presumably was installed from source code. Look in the file:

  /usr/local/lib/python2.6/config/Makefile

and look for the value of the CONFIG_VARS variable. For example, of my
MacOS X system (different to what you are using), it has:

CONFIG_ARGS= '--prefix=/usr' '--mandir=/usr/share/man'
'--infodir=/usr/share/info' '--disable-dependency-tracking'
'--enable-ipv6' '--with-threads'
'--enable-framework=/System/Library/Frameworks'
'--enable-toolbox-glue' '--enable-dtrace' '--with-system-ffi'
'--with-gcc=gcc-4.2' 'CC=gcc-4.2' 'CXX=g++-4.2' 'CFLAGS=-g -Os -pipe
-fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd
-I/usr/include/ffi -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall
-Wstrict-prototypes -Wshorten-64-to-32' 'LDFLAGS=-Wl,-F.'

Thos arguments were what was originally supplied to the 'configure'
script of Python when it was built from source code.

Post what you find for those in your installation.

What you would then do to duplicate same build, is to download Python
source code tar ball from www.python.org. You go into the Python
source tree after you unpack the tar ball. Normally, you would read
the README which explains how to install Python from source code. The
simple way in your case though is to just use the same options for
'configure' as CONFIG_VARS lists for YOUR existing installation,
except that you MUST also add the '--enable-shared' option as well.
You might also want to change the value of the '--prefix' option so it
installs into different location in overwriting the existing Python
installation would be a problem.

Check the README in the Python source code for further details on how
to install it.

Graham

 Thanks.
 cmn

 On Feb 7, 9:30 am, Graham Dumpleton graham.dumple...@gmail.com
 wrote:
 Read:

  http://code.google.com/p/modwsgi/wiki/InstallationIssues#Mixing_32_Bi...

 Solution is to use a Python installation that provides a shared library.

 Graham

 On 5 February 2011 03:06, octopusgrabbus octopusgrab...@gmail.com wrote:

  I've run into a build problem, and am wondering about the best
  solution for fixing it. This is an RHEL 5 WS system.

  Here is the error from running make. ./configure completed fine.

  /usr/lib64/apr-1/build/libtool --silent --mode=link gcc -o
  mod_wsgi.la  -rpath /
  usr/lib64/httpd/modules -module -avoid-version    mod_wsgi.lo -L/usr/
  local/lib -
  L/usr/local/lib/python2.6/config -lpython2.6 -lpthread -ldl -lutil -lm
  /usr/bin/ld: /usr/local/lib/libpython2.6.a(node.o): relocation
  R_X86_64_32 again
  st `a local symbol' can not be used when making a shared object;
  recompile with
  -fPIC
  /usr/local/lib/libpython2.6.a: could not read symbols: Bad value
  collect2: ld returned 1 exit status
  apxs:Error: Command failed with rc=65536

  Your advice would be very much appreciated. I have mod_wsgi running on
  Ubuntu, and I've got to say the operation over mod_python is well
  worth the work. Thank you.

  --
  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 
  athttp://groups.google.com/group/modwsgi?hl=en.


-- 
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.



[modwsgi] Re: mod_wsgi build problems

2011-02-07 Thread octopusgrabbus
Made that error go away by adding the location of the shared library
to the load library path.

On Feb 7, 11:46 am, octopusgrabbus old_road_f...@verizon.net wrote:
 Graham:

 I rebuilt Python 2.6.6 using the --enable-shared switch on config.
 This produced /usr/local/lib/libpython2.6.so.1.0

 I put a symlink in Python2.6/config libpython2.6.so.1.0 - /usr/local/
 lib/libpython2.6.so.1.0, right along side the static library.

 But when I configure mod_wsgi, I get multiple errors complaining the
 shared library cannot be found.

 /usr/local/bin/python: error while loading shared libraries:
 libpython2.6.so.1.0
 : cannot open shared object file: No such file or directory

 What am I doing wrong?
 tnx
 cmn

 On Feb 7, 10:15 am, Graham Dumpleton graham.dumple...@gmail.com
 wrote:

  Please keep discussion on the mailing list.

  On 8 February 2011 01:58, octopusgrabbus old_road_f...@verizon.net wrote:

   Graham:

   My answer back to you was not intended to be flip. I looked at the
   link you posted this morning, and cannot find the instructions to
   rebuild Python on this 64-bit system. I have asked in a number of
   places, including the Python forums. One of the answers I got back was
   very flip, saying use twisted. I've really tried to get an answer or
   re-installing Python and am running into a wall.

  Since your Python is installed under /usr/local/ and not /usr then it
  presumably was installed from source code. Look in the file:

    /usr/local/lib/python2.6/config/Makefile

  and look for the value of the CONFIG_VARS variable. For example, of my
  MacOS X system (different to what you are using), it has:

  CONFIG_ARGS=     '--prefix=/usr' '--mandir=/usr/share/man'
  '--infodir=/usr/share/info' '--disable-dependency-tracking'
  '--enable-ipv6' '--with-threads'
  '--enable-framework=/System/Library/Frameworks'
  '--enable-toolbox-glue' '--enable-dtrace' '--with-system-ffi'
  '--with-gcc=gcc-4.2' 'CC=gcc-4.2' 'CXX=g++-4.2' 'CFLAGS=-g -Os -pipe
  -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd
  -I/usr/include/ffi -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall
  -Wstrict-prototypes -Wshorten-64-to-32' 'LDFLAGS=-Wl,-F.'

  Thos arguments were what was originally supplied to the 'configure'
  script of Python when it was built from source code.

  Post what you find for those in your installation.

  What you would then do to duplicate same build, is to download Python
  source code tar ball fromwww.python.org. You go into the Python
  source tree after you unpack the tar ball. Normally, you would read
  the README which explains how to install Python from source code. The
  simple way in your case though is to just use the same options for
  'configure' as CONFIG_VARS lists for YOUR existing installation,
  except that you MUST also add the '--enable-shared' option as well.
  You might also want to change the value of the '--prefix' option so it
  installs into different location in overwriting the existing Python
  installation would be a problem.

  Check the README in the Python source code for further details on how
  to install it.

  Graham

   Thanks.
   cmn

   On Feb 7, 9:30 am, Graham Dumpleton graham.dumple...@gmail.com
   wrote:
   Read:

    http://code.google.com/p/modwsgi/wiki/InstallationIssues#Mixing_32_Bi...

   Solution is to use a Python installation that provides a shared library.

   Graham

   On 5 February 2011 03:06, octopusgrabbus octopusgrab...@gmail.com 
   wrote:

I've run into a build problem, and am wondering about the best
solution for fixing it. This is an RHEL 5 WS system.

Here is the error from running make. ./configure completed fine.

/usr/lib64/apr-1/build/libtool --silent --mode=link gcc -o
mod_wsgi.la  -rpath /
usr/lib64/httpd/modules -module -avoid-version    mod_wsgi.lo -L/usr/
local/lib -
L/usr/local/lib/python2.6/config -lpython2.6 -lpthread -ldl -lutil -lm
/usr/bin/ld: /usr/local/lib/libpython2.6.a(node.o): relocation
R_X86_64_32 again
st `a local symbol' can not be used when making a shared object;
recompile with
-fPIC
/usr/local/lib/libpython2.6.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
apxs:Error: Command failed with rc=65536

Your advice would be very much appreciated. I have mod_wsgi running on
Ubuntu, and I've got to say the operation over mod_python is well
worth the work. Thank you.

--
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 
athttp://groups.google.com/group/modwsgi?hl=en.

-- 
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] Re: mod_wsgi build problems

2011-02-07 Thread octopusgrabbus
Success. Reconfigured Python 2.6.6 with
--enable-shared
put in link

lrwxrwxrwx 1 root root 30 Feb  7 12:01 /usr/local/lib/python2.6/config/
libpython
2.6.so - /usr/local/lib/libpython2.6.so

And loaded the library from .bashrc
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

mod_wsgi built fine.

Thanks for the fine-tuned responses.

On Feb 7, 11:46 am, octopusgrabbus old_road_f...@verizon.net wrote:
 Graham:

 I rebuilt Python 2.6.6 using the --enable-shared switch on config.
 This produced /usr/local/lib/libpython2.6.so.1.0

 I put a symlink in Python2.6/config libpython2.6.so.1.0 - /usr/local/
 lib/libpython2.6.so.1.0, right along side the static library.

 But when I configure mod_wsgi, I get multiple errors complaining the
 shared library cannot be found.

 /usr/local/bin/python: error while loading shared libraries:
 libpython2.6.so.1.0
 : cannot open shared object file: No such file or directory

 What am I doing wrong?
 tnx
 cmn

 On Feb 7, 10:15 am, Graham Dumpleton graham.dumple...@gmail.com
 wrote:

  Please keep discussion on the mailing list.

  On 8 February 2011 01:58, octopusgrabbus old_road_f...@verizon.net wrote:

   Graham:

   My answer back to you was not intended to be flip. I looked at the
   link you posted this morning, and cannot find the instructions to
   rebuild Python on this 64-bit system. I have asked in a number of
   places, including the Python forums. One of the answers I got back was
   very flip, saying use twisted. I've really tried to get an answer or
   re-installing Python and am running into a wall.

  Since your Python is installed under /usr/local/ and not /usr then it
  presumably was installed from source code. Look in the file:

    /usr/local/lib/python2.6/config/Makefile

  and look for the value of the CONFIG_VARS variable. For example, of my
  MacOS X system (different to what you are using), it has:

  CONFIG_ARGS=     '--prefix=/usr' '--mandir=/usr/share/man'
  '--infodir=/usr/share/info' '--disable-dependency-tracking'
  '--enable-ipv6' '--with-threads'
  '--enable-framework=/System/Library/Frameworks'
  '--enable-toolbox-glue' '--enable-dtrace' '--with-system-ffi'
  '--with-gcc=gcc-4.2' 'CC=gcc-4.2' 'CXX=g++-4.2' 'CFLAGS=-g -Os -pipe
  -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd
  -I/usr/include/ffi -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall
  -Wstrict-prototypes -Wshorten-64-to-32' 'LDFLAGS=-Wl,-F.'

  Thos arguments were what was originally supplied to the 'configure'
  script of Python when it was built from source code.

  Post what you find for those in your installation.

  What you would then do to duplicate same build, is to download Python
  source code tar ball fromwww.python.org. You go into the Python
  source tree after you unpack the tar ball. Normally, you would read
  the README which explains how to install Python from source code. The
  simple way in your case though is to just use the same options for
  'configure' as CONFIG_VARS lists for YOUR existing installation,
  except that you MUST also add the '--enable-shared' option as well.
  You might also want to change the value of the '--prefix' option so it
  installs into different location in overwriting the existing Python
  installation would be a problem.

  Check the README in the Python source code for further details on how
  to install it.

  Graham

   Thanks.
   cmn

   On Feb 7, 9:30 am, Graham Dumpleton graham.dumple...@gmail.com
   wrote:
   Read:

    http://code.google.com/p/modwsgi/wiki/InstallationIssues#Mixing_32_Bi...

   Solution is to use a Python installation that provides a shared library.

   Graham

   On 5 February 2011 03:06, octopusgrabbus octopusgrab...@gmail.com 
   wrote:

I've run into a build problem, and am wondering about the best
solution for fixing it. This is an RHEL 5 WS system.

Here is the error from running make. ./configure completed fine.

/usr/lib64/apr-1/build/libtool --silent --mode=link gcc -o
mod_wsgi.la  -rpath /
usr/lib64/httpd/modules -module -avoid-version    mod_wsgi.lo -L/usr/
local/lib -
L/usr/local/lib/python2.6/config -lpython2.6 -lpthread -ldl -lutil -lm
/usr/bin/ld: /usr/local/lib/libpython2.6.a(node.o): relocation
R_X86_64_32 again
st `a local symbol' can not be used when making a shared object;
recompile with
-fPIC
/usr/local/lib/libpython2.6.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
apxs:Error: Command failed with rc=65536

Your advice would be very much appreciated. I have mod_wsgi running on
Ubuntu, and I've got to say the operation over mod_python is well
worth the work. Thank you.

--
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 

  1   2   3   4   5   >