Re: [modwsgi] Re: wsgi as root for ssh configurations

2021-04-30 Thread Carl Nobile
This is not something that modwsgi is responsible for.
However, you could try to use the same tricks that are done when a daemon
is created to run as root.
I made some major updates to this code
https://github.com/cnobile2012/python-daemon/blob/master/daemonize/daemon.py
You will have to put some thought into how you do this, it will NOT be an
exact copy of my code, but the basic ideas are there.
Good luck

~Carl


On Fri, Apr 30, 2021 at 12:58 PM Edwin Rueda  wrote:

> If I use the following python command to save the file:
>
>  -  os.system('sudo -S echo "test text" | sudo tee /etc/issue.net')
>
> I get the following error in the apache log:
>
> sudo: a terminal is required to read the password; either use the -S
> option to read from standard input or configure an askpass helper
> [sudo] password for www-data:
> sudo: no password was provided
>
> Thanks!
>
> El vie, 30 de abr. de 2021 a la(s) 11:30, Edwin Rueda (
> ejrueda...@gmail.com) escribió:
>
>> Hi Graham and everyone,
>>
>> I have a problem with a current task I'm doing in AWS. I'm creating a web
>> interface to set permissions and change the ssh welcome message. The
>> problem is that when saving the welcome message, I have to modify the /etc/
>> issue.net file with the following python line:
>>
>> open("/etc/issue.net").write("test text")
>>
>> the problem is that the server won't let me save because I don't have
>> superuser permissions.
>>
>> the alert that appears in the apache log is as follows:
>>  -  sudo: a terminal is required to read the password; either use the
>> -S option to read from standard input or configure an askpass helper
>>
>> note that in AWS, by default there is no superuser key
>>
>> Finally, this is my .conf file:
>>
>> WSGIDaemonProcess flaskproject threads=5
>> WSGIScriptAlias / /var/www/html/flaskproject/app.wsgi
>>
>> 
>> WSGIProcessGroup flaskproject
>> WSGIApplicationGroup %{GLOBAL}
>> Order deny,allow
>> Allow from all
>> 
>>
>> can you help me ?
>>
>> Thabks
>> --
>> *Edwin J. Rueda*
>> Maestrando en Ciencias de la Computación
>> Universidade Federal do Pará, Brasil
>> Ingeniero de Sistemas
>> Universidad Industrial de Santander, Colombia
>>
>
>
> --
> *Edwin J. Rueda*
> Maestrando en Ciencias de la Computación
> Universidade Federal do Pará, Brasil
> Ingeniero de Sistemas
> Universidad Industrial de Santander, Colombia
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/modwsgi/CAJ83xwrY9py2qpHBov%2B-bXAFtE1-pvsBpRK96YXvML_KmTq3sQ%40mail.gmail.com
> 
> .
>


-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/modwsgi/CAGQqDQJipNBUrno%2BcvX95kuFB8dOZweh1r6iYRwOON5YoSO0Cw%40mail.gmail.com.


Re: [modwsgi] SSO login

2016-02-22 Thread Carl Nobile
Bill,

That's not completely true there is the fairly new Apache module
'mod_auth_form' that is supposed to ameliorate this problem, but I can't
seem to get that working either.

The browser drops down a login when it sees a 401 status code plus
`WWW-Authenticate: Basic realm="WallyWorld"`. If you rewrite the 'Basic'
part to a custom scheme, but still send basic credentials 'mod_auth_form'
should do the right thing by sending on to 'mod_authnz_external'. At least
that's what I understand. See: https://tools.ietf.org/html/rfc2617.

I'm just trying to get the Apache config right.

The reason I am using 'mod_authnz_external' is because I'm authorizing
through PAM / NIS.

Thanks, for your response anyway.


On Mon, Feb 22, 2016 at 11:28 AM, Bill Freeman <ke1g...@gmail.com> wrote:

> No.  When you say "Basic Auth", you've said browser handles it.
>
>
> On Mon, Feb 22, 2016 at 11:24 AM, Carl Nobile <carl.nob...@gmail.com>
> wrote:
>
>> Hi all,
>>
>> Been awhile since I've posted to this list, but I've run into an issue
>> that I just cannot solve on my own.
>>
>> I need to use the mod_authnz_external package to authenticate using Basic
>> auth through TLS (SSL). Is it possible to bypass the browser dropdown login
>> screen and use the one I've written in Django? Can mod_wsgi come to my
>> rescue here?
>>
>>
>> ---
>> Carl J. Nobile (Software Engineer)
>> carl.nob...@gmail.com
>>
>> ---
>>
>> --
>> 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.
>



-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
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] SSO login

2016-02-22 Thread Carl Nobile
Hi all,

Been awhile since I've posted to this list, but I've run into an issue that
I just cannot solve on my own.

I need to use the mod_authnz_external package to authenticate using Basic
auth through TLS (SSL). Is it possible to bypass the browser dropdown login
screen and use the one I've written in Django? Can mod_wsgi come to my
rescue here?

---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
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] compiling issue

2012-06-04 Thread Carl Nobile
Have you installed both the dev packages for Apache and python?

This is often the reason for these types of errors.
 On Jun 4, 2012 9:28 AM, nitin chandra nitinchand...@gmail.com wrote:

 Hello All,

 I need to know what am I doing wrong to get the following error :

 { I have Ubuntu 12.04 server 64bit on Intel i3, I compiled and
 installed a working apache 2.4.2, the default install of python is
 2.7.3,still I compiled and installed python 2.7.3 in /opt/python273 as
 I was getting compilation error and suggested action was to use
 --with-shared and --with-pth.}

 I am trying to compile mod_wsgi-3.3 and I am getting the following
 error. trying to do this for the past 3 days.

 #/mod_wsgi-3.3$ sudo ./configure --prefix=/opt/mod_wsgi33
 --with-apxs=/opt/apache24/bin/apxs
 --with-python=/opt/python273/bin/python
 checking Apache version... 2.4.2
 configure: creating ./config.status
 config.status: creating Makefile
 nitin@ciceo:~/Downloads/mod_wsgi-3.3$
  ((does not work with out 'sudo'. 'permission denied'))




 #/mod_wsgi-3.3$ sudo make
 /opt/apache24/bin/apxs -c -I/opt/python273/include/python2.7
 mod_wsgi.c -L/opt/python273/lib -L/opt/python273/lib/python2.7/config
 -lpython2.7 -lpthread -ldl  -lutil -lm
 /opt/apache24/build/libtool --silent --mode=compile gcc -std=gnu99
 -prefer-pic   -D_REENTRANT -D_GNU_SOURCE -g -O2 -pthread
 -I/opt/apache24/include  -I/opt/apache24/include
 -I/opt/apache24/include  -I/opt/python273/include/python2.7  -c -o
 mod_wsgi.lo mod_wsgi.c  touch mod_wsgi.slo
 In file included from /opt/python273/include/python2.7/Python.h:8:0,
 from mod_wsgi.c:135:
 /opt/python273/include/python2.7/pyconfig.h:1161:0: warning:
 _POSIX_C_SOURCE redefined [enabled by default]
 /usr/include/features.h:164:0: note: this is the location of the
 previous definition
 /opt/python273/include/python2.7/pyconfig.h:1183:0: warning:
 _XOPEN_SOURCE redefined [enabled by default]
 /usr/include/features.h:166:0: note: this is the location of the
 previous definition
 mod_wsgi.c: In function 'wsgi_process_socket':
 mod_wsgi.c:10095:37: error: 'conn_rec' has no member named 'remote_addr'
 mod_wsgi.c:10103:27: error: 'conn_rec' has no member named 'remote_ip'
 mod_wsgi.c:10103:41: error: 'conn_rec' has no member named 'remote_addr'
 mod_wsgi.c: In function 'wsgi_hook_daemon_handler':
 mod_wsgi.c:12742:18: error: 'conn_rec' has no member named 'remote_ip'
 mod_wsgi.c: In function 'Auth_environ':
 mod_wsgi.c:13262:10: error: 'conn_rec' has no member named 'remote_ip'
 mod_wsgi.c:13263:18: error: 'conn_rec' has no member named 'remote_ip'
 mod_wsgi.c:13295:14: error: 'conn_rec' has no member named 'remote_addr'
 mod_wsgi.c: In function 'wsgi_hook_access_checker':
 mod_wsgi.c:14395:29: error: 'conn_rec' has no member named 'remote_ip'
 mod_wsgi.c: At top level:
 mod_wsgi.c:14697:5: warning: initialization from incompatible pointer
 type [enabled by default]
 mod_wsgi.c:14697:5: warning: (near initialization for
 'wsgi_authz_provider.check_authorization') [enabled by default]
 apxs:Error: Command failed with rc=65536
 .
 make: *** [mod_wsgi.la] Error 1
 nitin@ciceo:~/Downloads/mod_wsgi-3.3$


 PL... giude

 Thanks in Advance

 Nitin

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



Re: [modwsgi] installing modwsgi to work with specific python version in virtenv

2012-03-20 Thread Carl Nobile
Alon,

If you install a mod_wsgi mod that is compiled with Python 2.6 then all
your apps need to use Python 2.6 for all the apps that run with it. never
use any version of Python that mod_wsgi was not compiled against.

~Carl

On Tue, Mar 20, 2012 at 8:59 AM, Alon Nisser alonis...@gmail.com wrote:

 on my linux (ubunto 11) installation I have running both python 2.7 and
 2.6
 I want to install and configure mod_wsgi for my localhost running apache
 (to do some debugging.. I can't figure out with a bottle.py deployment to
 openshift who uses mod_wsgi)
 the virtualenv I want to run the application from is using python 2.6
 should I install the specifc 2.6 mod_wsgi (which seems from looking in the
 guide more of a fuss, since it isn't the default python version in my
 installation)in order with the virtualenv
 or would the default installation (probably with python 2.7) would suffice
 for running the wsgi app in the virtenv?
 thanks for the help!



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




-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
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] installing modwsgi to work with specific python version in virtenv

2012-03-20 Thread Carl Nobile
No you must choose one or the other and develop only for the one you choose.

Graham is the expert on this, but unless he has recently changed the
mod_wsgi code to use multiple versions if Python you can only use a single
version of Python at a time with mod_wsgi.

If it were me I'd go with version Python version 2.7.2, if that's one of
your choices.

~Carl

On Tue, Mar 20, 2012 at 2:43 PM, Alon Nisser alonis...@gmail.com wrote:

 thanks for the answer carl
 so if I have two versions of python on my computer can I install 2
 versions of mod_wsgi?


 On Tuesday, March 20, 2012 5:41:02 PM UTC+2, Carl Nobile wrote:

 Alon,

 If you install a mod_wsgi mod that is compiled with Python 2.6 then all
 your apps need to use Python 2.6 for all the apps that run with it. never
 use any version of Python that mod_wsgi was not compiled against.

 ~Carl

 On Tue, Mar 20, 2012 at 8:59 AM, Alon Nisser wrote:

 on my linux (ubunto 11) installation I have running both python 2.7 and
 2.6
 I want to install and configure mod_wsgi for my localhost running apache
 (to do some debugging.. I can't figure out with a bottle.py deployment to
 openshift who uses mod_wsgi)
 the virtualenv I want to run the application from is using python 2.6
 should I install the specifc 2.6 mod_wsgi (which seems from looking in
 the guide more of a fuss, since it isn't the default python version in my
 installation)in order with the virtualenv
 or would the default installation (probably with python 2.7) would
 suffice for running the wsgi app in the virtenv?
 thanks for the help!



  --
 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/-/TFgjcGnZLcQJhttps://groups.google.com/d/msg/modwsgi/-/TFgjcGnZLcQJ
 .
 To post to this group, send email to modwsgi@googlegroups.com.
 To unsubscribe from this group, send email to modwsgi+unsubscribe@**
 googlegroups.com modwsgi%2bunsubscr...@googlegroups.com.
 For more options, visit this group at http://groups.google.com/**
 group/modwsgi?hl=en http://groups.google.com/group/modwsgi?hl=en.




 --
 --**--**
 ---
 Carl J. Nobile (Software Engineer)

 --**--**
 ---

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

 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.




-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
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: Please, help me install mod_wsgi!

2011-12-14 Thread Carl Nobile
Roman,

As Graham said giving us the Linux distro that you are using would be
helpful.

However, in general it will still be another two or so years before Python
3.x will be widely used, many web frameworks can not use it yet. Django for
instance is almost there, but there are no stable releases yet that can use
Python 3.x. So my recommendation is to not use anything that requires
Python 3.x at this time. So if indeed mod_wsgi 3.1 requires Python 3.1 I
would not use it, leave it for the people that are experimenting with
Python 3.x. Graham can give you a version that would still work with the
Python 2.x code base, which is where most applications still live.

Now if you are determined to use the latest mod_wsgi and therefore Python
3.x then it can be installed, but be careful of the distro that you use and
how you install it or it can break you whole Linux install because so many
distros use Python for much of their administrative work and won't run on
Python 3.x. RedHat/Fedora is the worst offender to my knowledge their
version of Python is old even by version 2.x standards. You will most
likely need to have two installs of Python on your machine. Then use
virtual environments to run your apps using Python 3.x code.

I work for a large publishing company and we have not started using Python
3.x yet, so don't rush into it if you do not really have to.

~Carl

On Wed, Dec 14, 2011 at 7:51 PM, Graham Dumpleton 
graham.dumple...@gmail.com wrote:

 On 15 December 2011 11:10, Роман Сорокин sorokin...@mail.ru wrote:
  Hello, I'm Roman.
  I'm beginner in Python, and I have some problem with installation
 mod_wsgi
  3.3 on Linux (it has error) and on Windows (Apache don't want startup),
  I tried install mod_wsgi 3.1 on Linux, but it requiers python-dev 3.1
 pack,
  I don't know where from i can download it, research of links of Google
 don't
  give me anything useful. Please, give me workin version mod_wsgi or
  python-dev 3.1!

 I have forwarded your questions onto the mod_wsgi mailing list.
 Details of list at:


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

 I have done this because I don't use Linux in any serious way so don't
 know very well the specifics of Linux packaging for different distros
 or appropriate commands to install them. Other people on the list
 therefore can better help you with the questions or point you to a
 summarising blog post of what is required for your specific distro.
 You will though need to indicate what Linux distro you are using. Also
 post what commands you have used so far to install it along with the
 specific error messages you are getting.

 Am also not a user of Windows either, but generally a startup problem
 with Apache/mod_wsgi on Windows is because of one of the following:

 - Using a 64 bit Apache with 32 bit mod_wsgi.so from download site.
 You can't mix 32/64 bit and need to use a 32 bit Apache.
 - Using a 64 bit Python with 32 bit mod_wsgi.so from download site.
 You can't mix 32/64 bit and need to use a 32 bit Python.
 - Python was installed for current user only. You must install Python
 for all users when installing it and not just the current user.

 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.




-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
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] Performance hit with timestamp read/app reload

2011-06-17 Thread Carl Nobile
If my understanding is correct mod_wsgi only checks the hook file.
Matter-of-fact that means if you touch this file mod_wsgi will reload all
other files--great for development, but onlu in daemon mode. In the usual
case mod_wsgi will not look at any files other than the hook file--it loads
all files into memory the first time around then never looks at them again
unless of cause you change or touch the hook file or reload Apache.

Graham could go into more specifics about this I am sure.

~Carl

On Fri, Jun 17, 2011 at 8:02 PM, Guy guy.knig...@gmail.com wrote:

 I've searched the web but can't find any references to the following
 question which leads me to ask it here. Can anyone tell me if there's
 any notable performance hit due to mod_wsgi's reload behaviour when it
 reads the timestamp of the .wsgi application file and reloads the app
 if it has changed?

 I'm fairly new to the world of mod_wsgi and this question comes from
 my experience using PHP's APC module, which has a directive that can
 disable file checking on each request (apc.stat). I have no idea if
 mod_wsgi operates in the same way, but it would seem to me that it
 must do a filesystem check in order to identify if the timestamp has
 changed. If someone could confirm or disconfirm this I'd appreciate
 it.

 Thanks,
 Guy

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




-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
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] extra threads per process

2011-04-28 Thread Carl Nobile
I haven't actually given this any thought before, but my best bet is that
they are there so the process has something to clone when creating a new
thread after killing an old thread. There is always a main thread sitting
around also which would explain the (threads +1) * num processes + 1 threads
you are seeing.

Graham would be the authority on all this, so he may chime in a bit later.

~Carl

On Thu, Apr 28, 2011 at 2:58 PM, Brian D brian.dewe...@gmail.com wrote:

 Using Apache 2.2.14, mod_wsgi 3.3, and WSGIDaemonProcess name
 processes=2 threads=1 etc, I've noticed that there are actually 3
 threads running in each mod_wsgi process, 4 if you count the main
 thread.  Does anyone know what these extra threads are for?

 Brian

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




-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
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] Django “Script timed out before returning headers”

2011-04-14 Thread Carl Nobile
It looks like you are running a single process with 50 threads, I think you
should use more processes with less threads something like this:

WSGIDaemonProcess site-1 user=django group=django processes=5 threads=10
maximum-requests=1000
WSGIProcessGroup site-1
WSGIScriptAlias / /somepath/django.wsgi /somepath/django.wsgi

The 'maximum-requests=1000' will kill each thread after a 1000 requests and
create a new one, this helps to keep memory leaks to a minimum.

~Carl

On Thu, Apr 14, 2011 at 3:18 PM, Chase chase.seib...@gmail.com wrote:

 I have a custom Django app that's becoming unresponsive
 intermittently. About once every couple of days between three servers,
 serving about 10,000 requests a day. When it happens, it never
 recovers. I can leave it there for hours, and it will not server any
 more requests.


 In the apache logs, I see see the following:

 Apr 13 11:45:07 www3 apache2[27590]: **successful view render here**
 ...
 Apr 13 11:47:11 www3 apache2[24032]: [error] server is within
 MinSpareThreads of MaxClients, consider raising the MaxClients setting
 Apr 13 11:47:43 www3 apache2[24032]: [error] server reached MaxClients
 setting, consider raising the MaxClients setting
 ...
 Apr 13 11:50:34 www3 apache2[27617]: [error] [client 10.177.0.204]
 Script timed out before returning headers: django.wsgi
 (repeated 100 times, exactly)


 I am running:

 apache version 2.2, using the worker MPM
 wsgi version 2.8
 SELinux NOT installed
 lxml package being used, infrequently
 Ubuntu 10.04


 apache config:

 WSGIDaemonProcess site-1 user=django group=django threads=50
 WSGIProcessGroup site-1
 WSGIScriptAlias / /somepath/django.wsgi /somepath/django.wsgi


 wsgi config:

 import os, sys
 sys.path.append('/home/django')
 os.environ['DJANGO_SETTINGS_MODULE'] = 'myapp.settings'
 import django.core.handlers.wsgi
 application = django.core.handlers.wsgi.WSGIHandler()


 When this happens, I can kill the wsgi process and the server will
 recover.

 ps aux|grep django # process is running as user django
 django   27590  5.3 17.4 908024 178760 ?   Sl   Apr12  76:09 /usr/
 sbin/apache2 -k start
 kill -9 27590


 This leads me to believe that the problem is a known issue:

 (deadlock-timeout) Defines the maximum number of seconds allowed to
 pass before the daemon process is shutdown and restarted after a
 potential deadlock on the Python GIL has been detected. The default is
 300 seconds. This option exists to combat the problem of a daemon
 process freezing as the result of a rouge Python C extension module
 which doesn't properly release the Python GIL when entering into a
 blocking or long running operation.


 However, I'm not sure why this condition is not clearing
 automatically. I do see that the script timeout occurs exactly 5
 minutes after the last successful page render, so the deadlock-timeout
 is getting triggered. But it does not actually kill the process.

 I'm thinking of switching to MPM/prefork, but I'm not sure if that
 should have any effect, given that I'm in daemon mode already.

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




-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
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] PyCon 2011 Atlanta

2011-03-14 Thread Carl Nobile
I was at PyCon 2011 in Atlanta, GA USA. Some good news for mod_wsgi.
As it seems most people are considering mod_wsgi the default standard
if you are looking for a stable production system. I heard this said
over and over again but the most poignant comment was from Jacob Moss
of Django fame, and this is a paraphrase, 'if you want a stable system
that doesn't wake you up at 3 in the morning use mod_wsgi'.

Anyway, this is all I wanted to say, I think this is encouraging news
and should make Graham proud of his work with mod_wsgi.

~Carl

-- 
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] PyCon 2011 Atlanta

2011-03-14 Thread Carl Nobile
Graham,

I didn't know that you were/are there. Darn!! We drove down from Knoxville
TN on Tuesday night and had to return Sunday, the four of us are all back in
Knoxville now. You could come up to Knoxville and visit us if you have the
time. We're about 215 miles north of Atlanta.

~Carl

On Mon, Mar 14, 2011 at 4:03 PM, Graham Dumpleton 
graham.dumple...@gmail.com wrote:

 On 14 March 2011 15:58, Carl Nobile carl.nob...@gmail.com wrote:
  I was at PyCon 2011 in Atlanta, GA USA. Some good news for mod_wsgi.
  As it seems most people are considering mod_wsgi the default standard
  if you are looking for a stable production system. I heard this said
  over and over again but the most poignant comment was from Jacob Moss
  of Django fame, and this is a paraphrase, 'if you want a stable system
  that doesn't wake you up at 3 in the morning use mod_wsgi'.
 
  Anyway, this is all I wanted to say, I think this is encouraging news
  and should make Graham proud of his work with mod_wsgi.

 Did you come up and say hello to me? I really don't remember. :-)

 And yes, PyCon has been quite an eye opener around how much people are
 relying on it and how it is regarded. Makes me guilty that I am
 neglecting it a bit at the moment while I focus on my work at
 NewRelic. But then, the way I see it right now the stuff I am doing at
 NewRelic is going to be just as important and of great benefit to the
 Python web community.

 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.




-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
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] PyCon 2011 Atlanta

2011-03-14 Thread Carl Nobile
LOL

Hey I drove in Scotland a few years ago on the wrong side of the road and on
very narrow roads to boot, the roads here in the States are much wider thank
God.

No problem, I figured as much, sorry I missed you though.

~Carl

On Mon, Mar 14, 2011 at 4:16 PM, Graham Dumpleton 
graham.dumple...@gmail.com wrote:

 On 14 March 2011 16:11, Carl Nobile carl.nob...@gmail.com wrote:
  Graham,
 
  I didn't know that you were/are there. Darn!! We drove down from
 Knoxville
  TN on Tuesday night and had to return Sunday, the four of us are all back
 in
  Knoxville now. You could come up to Knoxville and visit us if you have
 the
  time. We're about 215 miles north of Atlanta.

 Would miss the sprints then and too valuable for me as far as access
 to Django developers who can help with integrating my stuff for work
 into Django. :-)

 I also would be dangerous on the roads here as you all drive on the
 wrong side of the road.

 Graham

  ~Carl
 
  On Mon, Mar 14, 2011 at 4:03 PM, Graham Dumpleton
  graham.dumple...@gmail.com wrote:
 
  On 14 March 2011 15:58, Carl Nobile carl.nob...@gmail.com wrote:
   I was at PyCon 2011 in Atlanta, GA USA. Some good news for mod_wsgi.
   As it seems most people are considering mod_wsgi the default standard
   if you are looking for a stable production system. I heard this said
   over and over again but the most poignant comment was from Jacob Moss
   of Django fame, and this is a paraphrase, 'if you want a stable system
   that doesn't wake you up at 3 in the morning use mod_wsgi'.
  
   Anyway, this is all I wanted to say, I think this is encouraging news
   and should make Graham proud of his work with mod_wsgi.
 
  Did you come up and say hello to me? I really don't remember. :-)
 
  And yes, PyCon has been quite an eye opener around how much people are
  relying on it and how it is regarded. Makes me guilty that I am
  neglecting it a bit at the moment while I focus on my work at
  NewRelic. But then, the way I see it right now the stuff I am doing at
  NewRelic is going to be just as important and of great benefit to the
  Python web community.
 
  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.
 
 
 
 
  --
 
 ---
  Carl J. Nobile (Software Engineer)
  carl.nob...@gmail.com
 
 ---
 
  --
  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.




-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
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] PyCon 2011 Atlanta

2011-03-14 Thread Carl Nobile
We do nothing but Django here though we are thinking of added other
frameworks into the mix, that may be better in a web service environment,
but Django will always be our framework of choice on our online news sites.
I work for E.W. Scripps Publication.

About DjangoCon, I'm not sure the company will pay for another convention
this year unhappily.

~Carl

On Mon, Mar 14, 2011 at 4:31 PM, Graham Dumpleton 
graham.dumple...@gmail.com wrote:

 On 14 March 2011 16:21, Carl Nobile carl.nob...@gmail.com wrote:
  LOL
 
  Hey I drove in Scotland a few years ago on the wrong side of the road and
 on
  very narrow roads to boot, the roads here in the States are much wider
 thank
  God.

 Yeah, about 4 lanes wider, which is part of the problem. We don't have
 such huge roads where I come from. Didn't bring my international
 driving licence anyway. :-)

  No problem, I figured as much, sorry I missed you though.

 Chance I may make it to DjangoCon later in the year if things work
 out. Can't remember if you are a big Django user or not. Recollect you
 probably aren't.

 Graham

  ~Carl
 
  On Mon, Mar 14, 2011 at 4:16 PM, Graham Dumpleton
  graham.dumple...@gmail.com wrote:
 
  On 14 March 2011 16:11, Carl Nobile carl.nob...@gmail.com wrote:
   Graham,
  
   I didn't know that you were/are there. Darn!! We drove down from
   Knoxville
   TN on Tuesday night and had to return Sunday, the four of us are all
   back in
   Knoxville now. You could come up to Knoxville and visit us if you have
   the
   time. We're about 215 miles north of Atlanta.
 
  Would miss the sprints then and too valuable for me as far as access
  to Django developers who can help with integrating my stuff for work
  into Django. :-)
 
  I also would be dangerous on the roads here as you all drive on the
  wrong side of the road.
 
  Graham
 
   ~Carl
  
   On Mon, Mar 14, 2011 at 4:03 PM, Graham Dumpleton
   graham.dumple...@gmail.com wrote:
  
   On 14 March 2011 15:58, Carl Nobile carl.nob...@gmail.com wrote:
I was at PyCon 2011 in Atlanta, GA USA. Some good news for
 mod_wsgi.
As it seems most people are considering mod_wsgi the default
 standard
if you are looking for a stable production system. I heard this
 said
over and over again but the most poignant comment was from Jacob
 Moss
of Django fame, and this is a paraphrase, 'if you want a stable
system
that doesn't wake you up at 3 in the morning use mod_wsgi'.
   
Anyway, this is all I wanted to say, I think this is encouraging
 news
and should make Graham proud of his work with mod_wsgi.
  
   Did you come up and say hello to me? I really don't remember. :-)
  
   And yes, PyCon has been quite an eye opener around how much people
 are
   relying on it and how it is regarded. Makes me guilty that I am
   neglecting it a bit at the moment while I focus on my work at
   NewRelic. But then, the way I see it right now the stuff I am doing
 at
   NewRelic is going to be just as important and of great benefit to the
   Python web community.
  
   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.
  
  
  
  
   --
  
  
 ---
   Carl J. Nobile (Software Engineer)
   carl.nob...@gmail.com
  
  
 ---
  
   --
   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.
 
 
 
 
  --
 
 ---
  Carl J. Nobile (Software Engineer)
  carl.nob...@gmail.com
 
 ---
 
  --
  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

Re: [modwsgi] Signal Handlers

2011-03-07 Thread Carl Nobile
Jason,

Python, threads, and signals are always problematic. If I remember correctly
the parent thread is the only thread that receives the signal, in order to
get the remaining threads to respond to the signal the parent thread needs
to kill it's own sub-threads. It's been a while since I have had to do this
however. Also, mod_wsgi doesn't use python threads it uses libpthread.so, so
I'm also not sure how this plays into the mix either.

Long story short I remember Graham saying that there are issues with using
signals. Try and look through old posts for comments about this issue.

~Carl

On Mon, Mar 7, 2011 at 11:16 AM, Jason Connor jason.con...@gmail.comwrote:

 Hi All,

 Some background: I'm writing a large rest server application using web.py
 and mod_wsgi. I've deployed the application as a wsgi daemon with 1 process
 and multiple threads. This allows me to use a global task queue for running
 asynchronous tasks.

 I'm currently trying to implement a server-side debugger by sending a
 signal to the wsgi application (sigusr2). I've turned off the signal, stdin,
 and stdout restrictions (WSGIRestrict(Signal|Stdin|Stdout) Off). I've setup
 a signal handler in the main thread using an import script. The callback
 opens and attaches to 2 named pipes in /tmp. The command line script that
 sends the signal also opens the pipes.

 However, once I send the signal, nothing happens. The wsgi application
 completely ignores and continues to answer requests. If I don't set the
 signal handler, when I deliver the signal the application gets interrupted
 and mod_wsgi conveniently restarts it. I'm having a hard time figuring out
 what is going on as there is no messages logged by apache or even my app
 (I've got logging in the signal handler callback).

 Disclaimer: I've read a few threads in this group on this topic. And I've
 made use of
  * sending extra http request to try and deliver the signal
  * start a background thread that wakes up every so often and then goes
 back to sleep to trigger the signal delivery

 Any comments by anyone with experience delivering signals to a wsgi daemon
 process are welcome. I'm finally out of ideas and would love a new angle to
 attack this problem from.

 Thank you,
 Jason L Connor

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




-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
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] The workflow of mod_wsgi

2011-01-07 Thread Carl Nobile
你好

You should just try and write a few simple apps as explained in
Graham's documentation. This is the best way to get yourself used to
the workflow as you described it.

Essentially mod_wsgi just implements the WSGI protocol as explained in
PEP 333 (http://www.python.org/dev/peps/pep-0333/) and hooks you into
apache. This is just the Python standard way of interfacing with web
servers. mod_wsgi is not the only WSGI implementation, but it's
probably your best choice when using apache or nigix.

~Carl

On Fri, Jan 7, 2011 at 12:12 PM, Zheng smile...@gmail.com wrote:
 Hi,

 I have just started to use Python to do web programming. I will use
 mod_wsgi and Apache.

 To understand mod_wsgi better, I read the wiki documents on the
 official site. Although these documents explain their individual
 topics extremely well, I am kind of still missing the big picture
 about how mod_wsgi works.

 I think once I understand the workflow of mod_wsgi, I will be able to
 understand better concepts like Python sub-interpreter and the issues
 like reloading WSGI applications without restarting the server.

 Assume using daemon processes with multiple processes and multiple
 threads within each process, could anyone explain the workflow of
 mod_wsgi, from the very beginning that the first request comes in
 until the response gets sent? How does mod_wsgi spawn the processes
 and threads, call the Python interpreter, load the modules?
 Please, show me the picture of the workflow.

 Your help is very much appreciated.

 Zheng

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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.





-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modw...@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] How to close connection immediately

2010-12-22 Thread Carl Nobile
As far as I know there is now way to prevent this from happening,
however you could send a HEAD request with the Content-Length and the
Expect headers in it, do your test on the server side then send a 100
Continue if the content length is OK or a 417 Expectation Failed if
not OK. Look at RFC-2616 the HTTP standards document and also look at
'RESTful Web Services' from O'Reilly books.

This is not, strictly speaking, a mod_wsgi question and should have
been asked elsewhere, but it was easy enough to answer so I did.

~Carl

On Wed, Dec 22, 2010 at 9:42 AM, Stanislav Ievlev
stanislav.iev...@gmail.com wrote:
 Greetings!

 I've wrote a simple wsgi application that checks a content-length of
 the incoming POST requests and sends an error immediately if request
 was too long. Unfortunately, apache continues to read the whole
 incoming message from browser.

 Is it possible to close connection immediately after I send a reply?

 ---
 With best regards
 Stanislav Ievlev.

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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.





-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modw...@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: Periodic exceptions with Django app using mod_wsgi

2010-12-10 Thread Carl Nobile
About the NFS mounts. Yes, we moved all the Django code off of the NFS
mounts because of the time lags especially with the template
rendering. We use six app servers with identical instances of Django
and our apps (20 sites each) on them. We only use the NFS mounts for
logs and data that is not often accessed by our apps. These sites do
not as of yet use mod_wsgi, because of their age (still on Django
0.90) and the effort to change to mod_wsgi out weighs the benefit, but
we are in the process of building a new CMS with the latest version of
Django at which time we will use mod_wsgi.

Large sites just don't perform well when run from an NFS mount at
least this has been our experience.

~Carl

On Fri, Dec 10, 2010 at 6:16 AM, Graham Dumpleton
graham.dumple...@gmail.com wrote:
 Sorry, just ignore what I said. I missed that in:

   WSGIScriptAlias /django-project1
 /path/to/django/stuff/django-project1/apache/apache.wsgi
    WSGIScriptAlias /django-project2
 /path/to/django/stuff/django-project2/apache/apache.wsgi
    WSGIScriptAlias /django-project3
 /path/to/django/stuff/django-project3/apache/apache.wsgi
    WSGIScriptAlias /django-project4
 /path/to/django/stuff/django-project4/apache/apache.wsgi

 that they were actually for different Django instances. I thought they
 were all point at the same and you were trying to map only certain sub
 URLs of one site such that something else could still own the root URL
 of the site.

 Graham

 On 10 December 2010 22:09, Haes haes...@gmail.com wrote:
 On Dec 10, 11:49 am, Haes haes...@gmail.com wrote:
 On Dec 9, 10:33 pm, Graham Dumpleton graham.dumple...@gmail.com
 wrote:

  BTW, if all your Django instances are actually the same, you should
  really force them to run in same sub interpreter, otherwise you could
  be using up much more memory than you need based on your multiple
  WSGIScriptAlias directives. Ie., try setting 'WSGIApplicationGroup
  %{GLOBAL}'. This has nothing to do with your issue however.

 Would I need to specify 'WSGIApplicationGroup %{GLOBAL}' in both
 virtualhosts (http, https) that have the same WSGIProcessGroup in
 order to make sure they all run in the same sub interpreter? The https
 virtualhost is basically the same as the http vhost (from my first
 post) minus the WSGIDaemonProcess directive.

 Ok, I guess I missunderstood the WSGIApplicationGroup directive,
 somehow. When adding a WSGIApplicationGroup, those four different WSGI
 Django applications were more served more or less randomly, regardless
 what WSGIScriptAlias'ed URL was used to access them.

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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 modw...@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.





-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modw...@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: Periodic exceptions with Django app using mod_wsgi

2010-12-10 Thread Carl Nobile
Yes, the issues we had had nothing to do with mod_wsgi as I intimated,
but many people often think it is a mod_wsgi issue so I wanted to
clear that up. It even gets worse if you have FUSE mixed into the file
system. Having different app servers hitting the same file each
thinking they are getting the NFS lock can be disastrous or trying to
access the file and NFS hasn't made it available yet.

~Carl

On Fri, Dec 10, 2010 at 11:12 PM, Graham Dumpleton
graham.dumple...@gmail.com wrote:
 For the record, the only issue I know in relation to NFS is that there
 is a potential on some platforms that wsgi.file_wrapper, which uses
 kernel sendfile() to not work when used with files on a NFS partition.

 I don't know what platforms or what NFS implementations. Just know
 from what is happening in Apache and that they are disabling
 sendfile() support as default for static file handling because of the
 problems that can arise.

 In mod_wsgi 4.X, use of sendfile() by wsgi.file_wrapper is off by
 default and needs to be enabled explicitly. Use of sendfile() was from
 memory always off for daemon mode anyway, although in mod_wsgi 4.X you
 will be able to enable it for daemon mode if you have tested it and
 confident it works for you. The daemon mode problem was more to do
 with using sendfile() over a UNIX socket rather than an INET socket,
 and not NFS.

 Graham

 On 11 December 2010 04:59, Carl Nobile carl.nob...@gmail.com wrote:
 About the NFS mounts. Yes, we moved all the Django code off of the NFS
 mounts because of the time lags especially with the template
 rendering. We use six app servers with identical instances of Django
 and our apps (20 sites each) on them. We only use the NFS mounts for
 logs and data that is not often accessed by our apps. These sites do
 not as of yet use mod_wsgi, because of their age (still on Django
 0.90) and the effort to change to mod_wsgi out weighs the benefit, but
 we are in the process of building a new CMS with the latest version of
 Django at which time we will use mod_wsgi.

 Large sites just don't perform well when run from an NFS mount at
 least this has been our experience.

 ~Carl

 On Fri, Dec 10, 2010 at 6:16 AM, Graham Dumpleton
 graham.dumple...@gmail.com wrote:
 Sorry, just ignore what I said. I missed that in:

   WSGIScriptAlias /django-project1
 /path/to/django/stuff/django-project1/apache/apache.wsgi
    WSGIScriptAlias /django-project2
 /path/to/django/stuff/django-project2/apache/apache.wsgi
    WSGIScriptAlias /django-project3
 /path/to/django/stuff/django-project3/apache/apache.wsgi
    WSGIScriptAlias /django-project4
 /path/to/django/stuff/django-project4/apache/apache.wsgi

 that they were actually for different Django instances. I thought they
 were all point at the same and you were trying to map only certain sub
 URLs of one site such that something else could still own the root URL
 of the site.

 Graham

 On 10 December 2010 22:09, Haes haes...@gmail.com wrote:
 On Dec 10, 11:49 am, Haes haes...@gmail.com wrote:
 On Dec 9, 10:33 pm, Graham Dumpleton graham.dumple...@gmail.com
 wrote:

  BTW, if all your Django instances are actually the same, you should
  really force them to run in same sub interpreter, otherwise you could
  be using up much more memory than you need based on your multiple
  WSGIScriptAlias directives. Ie., try setting 'WSGIApplicationGroup
  %{GLOBAL}'. This has nothing to do with your issue however.

 Would I need to specify 'WSGIApplicationGroup %{GLOBAL}' in both
 virtualhosts (http, https) that have the same WSGIProcessGroup in
 order to make sure they all run in the same sub interpreter? The https
 virtualhost is basically the same as the http vhost (from my first
 post) minus the WSGIDaemonProcess directive.

 Ok, I guess I missunderstood the WSGIApplicationGroup directive,
 somehow. When adding a WSGIApplicationGroup, those four different WSGI
 Django applications were more served more or less randomly, regardless
 what WSGIScriptAlias'ed URL was used to access them.

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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 modw...@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.





 --
 ---
 Carl J. Nobile (Software Engineer)
 carl.nob...@gmail.com
 ---

 --
 You received this message because you are subscribed to the Google

Re: [modwsgi] Periodic exceptions with Django app using mod_wsgi

2010-12-09 Thread Carl Nobile
By any chance are you reading or writing files to an NFS mount? I have
found this to have no end of problems when using Django because of the
delay that NFS inserts with the availability of newly changed data
between app servers.

~Carl

On Thu, Dec 9, 2010 at 10:47 AM, Haes haes...@gmail.com wrote:
 Hi,

 I am getting the following two Apache log errors on all my Django
 (v1.2.3) apps served by mod_wsgi, periodically (a couple of times a
 day):

 [Thu Dec 09 01:55:51 2010] [error] [client xxx]  mod_wsgi (pid=6141):
 Exception occurred processing WSGI script '/path/to/apache.wsgi'
 [Thu Dec 09 01:55:51 2010] [error] [client xxx]  IOError: failed to
 write data

 When it once happened to me, I just got an empty page on my browser.
 Just touch-ing the wsgi script [1] didn't resolve the issue but
 reloading Apache did.

 Any idea's what could cause this error?


 This is on Debian Lenny, Apache 2.2.9 and mod_wsgi 2.8. The Apache
 virtualhost hosts an old, big PHP application, where some parts are
 rewritten in Django and served as different projects, see [2].

 [1] Django wsgi source: http://pastebin.com/NhshyUC6
 [2] Apache config: http://pastebin.com/CuWqxBL2

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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.





-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modw...@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: Different Daemon Processes in one Container?

2010-12-04 Thread Carl Nobile
You can use %{RESOURCE} but, you will still need to create two
VirtualHosts. From reading the docs it seems that %{RESOURCE} just
gives you a group name that includes the host name and port and the
path to and including wsgi hook script tacked on the end.

~Carl

On Sat, Dec 4, 2010 at 4:33 PM, Damjan gdam...@gmail.com wrote:

 I would like to run two WGSI applications in different process groups.
 However, they should be accessible washttp://bla/app1andhttp://bla/app2.

 How do I configure this?

 AFAIK, and from reading the documentation on WSGI application groups
 http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIApplicationGroup

 By default (%{RESOURCE}) your two applications will be in different
 process groups since they have different SCRIPT_NAME

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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 modw...@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] Change of job. Impacts to mod_wsgi.

2010-11-30 Thread Carl Nobile
Graham,

Good luck with the new position. Don't feel bad about having a lack
of motivation this happens to all of use from time to time. I will
have to do some research on New Relic.

~Carl

On Tue, Nov 30, 2010 at 7:53 PM, Graham Dumpleton
graham.dumple...@gmail.com wrote:
 Some will know that I was leaving my existing job after 8 and 1/2
 years and was looking for a new job. Well that time has come and I
 finished up with my existing job yesterday. It was because of trying
 to tie up all the loose ends on that job, that have been neglecting
 mod_wsgi for some time. There was also somewhat a lack of motivation
 as well.

 Hopefully that will now change as I start today in my new job. I still
 have to work out how I fit in doing work on mod_wsgi, but the new job
 is going to entail some serious programming and so expect a renewed
 enthusiasm to come from that. Working from home for this new job will
 also hopefully give me a lot more flexibility to schedule my time so I
 can do stuff with mod_wsgi again.

 What is the job? Well, I wasn't sure whether I was going to be able to
 say for the time being at least, but turns out there isn't an issue. I
 therefore can tell you all that am going to work for a company called
 'New Relic'.

 I'll not say exactly what I will be doing, but if you know anything
 about what New Relic does or go read about their products, you can see
 what this could mean to the Python web community. It will also help me
 in being able to answer all those questions from people about how best
 to configure Apache/mod_wsgi for best performance. So, even if I am
 still slow in respect of further development on mod_wsgi, working on
 this other stuff will more than make up for it.

 As you can imagine, I am quite excited about this. :-)

 Graham

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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.





-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modw...@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] Where to start Python's file loggers?

2010-11-29 Thread Carl Nobile
You need to initialize logging in the WSGI hook file, because the
settings are lazily loaded. In other words you could start logging
before the logger got instantiated.

I usually write a separate module with my logging code in it and call
it in the WSGI hook file. I also found that using the logging config
file mechanism didn't work correctly, so dynamically set up logging.

Also don't put the logs in the /var/log path as root or adm are
usually the only users that can write to it. In production we use an
NFS mount for all logs and in testing I put the logs in the Django
project environment. If you are using daemon mode with mod_wsgi the
logs will be written out with that user so your files need to all be
set to that user also.

~Carl

On Mon, Nov 29, 2010 at 8:52 AM, sstein...@gmail.com
sstein...@gmail.com wrote:
 I know that Django 1.3 adds Python logging (finally), but I'm using 1.2, for 
 the moment.

 I attempted to initialize logging in setup.py, but found that log files were 
 being created with root privs.  The two that are www-data I did by hand:

 -rw-r- 1 root            0 Nov 28 21:03 tbp_dc.log
 -rw-r- 1 www-data   548580 Nov 28 21:03 tbp_dc.log.1
 -rw-r--r-- 1 www-data    40651 Nov 21 20:50 tbp_dc.log.2.gz

 So, it seems that, until Django's all running (i.e. handling an actual 
 request?) it's running as root.

 Then, when it switches to www-data, I can't write to the log files.

 Django 1.3 handles initialization of loggers in the Settings class 
 initialization in django.conf.__init__.py but I'm a little unclear as to 
 exactly when this Settings() object is created.

 If the user's still root when this is called, Django 1.3 has the same problem 
 I have; the logs won't actually be writable.

 Does anyone have any insight as to where this initialization can safely be 
 done i.e. when I've already switched to being www-data?

 Thanks,

 S
 aka/ssteinerX
 aka/Steve Steiner



 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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.





-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modw...@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] Where to start Python's file loggers?

2010-11-29 Thread Carl Nobile
The only safe place is in the wsgi hook file in 1.2 or before. If
Django 1.3 is able to do it in the settings then you will need to
mimic how Django 1.3 does it. Settings are all in an object, so you
may be able to override the base class LazyObject
(utils/functional.py) which it used in LazySettings
(conf/__init__.py). I have never done this so you are on your own
here.

~Carl

On Mon, Nov 29, 2010 at 10:43 AM, sstein...@gmail.com
sstein...@gmail.com wrote:

 On Nov 29, 2010, at 9:51 AM, Carl Nobile wrote:

 Thanks for the quick response.

 You need to initialize logging in the WSGI hook file, because the
 settings are lazily loaded. In other words you could start logging
 before the logger got instantiated.

 Hmmm, but I want the settings to be in my settings module to be forward 
 compatible with Django 1.3.  That means I have to be initializing *after* the 
 settings are loaded.  Django 1.3 does this in the Settings() class __init__.  
 I'm not clear on when the user switch is made, but, if the Django 1.3 
 approach works, the actual Settings() class must be instantiated after the 
 user switch.

 I usually write a separate module with my logging code in it and call
 it in the WSGI hook file. I also found that using the logging config
 file mechanism didn't work correctly, so dynamically set up logging.

 See above.  The whole idea is to be Django 1.3 compatible by just removing my 
 hand-initialization of logging and letting Django's Settings() init do it.

 Also don't put the logs in the /var/log path as root or adm are usually the 
 only users that can write to it.

 I temporarily changed the permissions to let www-data write to it; the 
 problem is that the file is created as root if I initialize the logging in 
 settings.py.

 I'm not sure at what point the current user is switched to www-data so that 
 creating the log will happen as that user.

 In production we use an NFS mount for all logs and in testing I put the logs 
 in the Django
 project environment. If you are using daemon mode with mod_wsgi the logs 
 will be written out with that user so your files need to all be set to that 
 user also.

 The www-data user is trying to write the logs, but they've been created by 
 root and are not writable.

 So, is there a safe place to initialize logging after the user switch has 
 been made?

 I'll move the log files to someplace outside /var/log that's owned by the 
 right user, too, but I've got to get them created *after* settings are loaded 
 and *after* the user switch is done.

 Thanks!

 S



 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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.





-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modw...@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] Apache 2.2.17, Mod_Wsgi 3.3 - Missing Runtime Definition of Symbols ap_cleanup_scoreboard and ap_accept_lock_mech

2010-11-19 Thread Carl Nobile
Are you sure that when you did # make install as root user that it
actually put the mod_wsgi.so file into
/usr/local/apache2/modules/mod_wsgi.so?

~Carl

On Fri, Nov 19, 2010 at 6:52 AM, Guddu anurag.choura...@gmail.com wrote:
 Dear modwsgi Team,

 I hope you could help me with a mod_wsgi load error upon startup of
 apache. This is affecting one of our site Go Live and I would
 appreciate any help

 offered in this regard. I am willing to try out code changes on my
 machine and rebuilding and retesting if someone could send me the
 changes source files.

 The error upon startup of Apache is as follows

 root [zibal]% ./usr/local/apache2/bin/apachectl restart
 httpd: Syntax error on line 53 of /usr/local/apache2/conf/httpd.conf:
 Cannot load /usr/local/apache2/modules/mod_wsgi.so into server: rtld:
 0712-001 Symbol

 ap_cleanup_scoreboard was referenced\n      from module /usr/local/
 apache2/modules/mod_wsgi.so(), but a runtime definition\n      of the
 symbol was not

 found.\nrtld: 0712-001 Symbol ap_accept_lock_mech was referenced
 \n      from module /usr/local/apache2/modules/mod_wsgi.so(), but a
 runtime definition\n

  of the symbol was not found.


 I built Apaxhe 2.2.17 and Mod_Wsgi 3.3 using the source and the
 compiler was gcc-4.2.

 Here are the AIX Server Details

 Here is the Apache Build Information
 =

 root [zibal]% ./usr/local/apache2/bin/httpd -V
 Server version: Apache/2.2.17 (Unix)
 Server built:   Nov 18 2010 05:04:25
 Server's Module Magic Number: 20051115:25
 Server loaded:  APR 1.4.2, APR-Util 1.3.10
 Compiled using: APR 1.4.2, APR-Util 1.3.10
 Architecture:   32-bit
 Server MPM:     Prefork
  threaded:     no
    forked:     yes (variable process count)
 Server compiled with
  -D APACHE_MPM_DIR=server/mpm/prefork
  -D APR_HAS_SENDFILE
  -D APR_HAS_MMAP
  -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
  -D APR_USE_SYSVSEM_SERIALIZE
  -D APR_USE_PTHREAD_SERIALIZE
  -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
  -D APR_HAS_OTHER_CHILD
  -D AP_HAVE_RELIABLE_PIPED_LOGS
  -D DYNAMIC_MODULE_LIMIT=128
  -D HTTPD_ROOT=/usr/local/apache2
  -D SUEXEC_BIN=/usr/local/apache2/bin/suexec
  -D DEFAULT_PIDLOG=logs/httpd.pid
  -D DEFAULT_SCOREBOARD=logs/apache_runtime_status
  -D DEFAULT_LOCKFILE=logs/accept.lock
  -D DEFAULT_ERRORLOG=logs/error_log
  -D AP_TYPES_CONFIG_FILE=conf/mime.types
  -D SERVER_CONFIG_FILE=conf/httpd.conf

 Contents of config.nice file are as follows

 
 #! /bin/sh
 #
 # Created by configure

 CC=gcc; export CC
 ./configure \
 CC=gcc \
 $@
 



 Information about Apache Modules Loaded
 ===

 root [zibal]% ./usr/local/apache2/bin/httpd -l
 Compiled in modules:
  core.c
  mod_authn_file.c
  mod_authn_default.c
  mod_authz_host.c
  mod_authz_groupfile.c
  mod_authz_user.c
  mod_authz_default.c
  mod_auth_basic.c
  mod_include.c
  mod_filter.c
  mod_log_config.c
  mod_env.c
  mod_setenvif.c
  mod_version.c
  prefork.c
  http_core.c
  mod_mime.c
  mod_status.c
  mod_autoindex.c
  mod_asis.c
  mod_cgi.c
  mod_negotiation.c
  mod_dir.c
  mod_actions.c
  mod_userdir.c
  mod_alias.c
  mod_so.c


 In httpd.conf, i only have the following LoadModule Statement
 =
 LoadModule wsgi_module modules/mod_wsgi.so

 Information about Global Accept Mutex
 =
 Valid accept mutexes for this platform and MPM are: default, fcntl,
 sysvsem, posixsem, pthread.

 Please let me know if I should provide some additional information.

 Appreciate your help on this.

 Regards,
 Guddu

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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.





-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modw...@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] want to write wsgi module (https) returning string of an unkown length

2010-11-14 Thread Carl Nobile
This is really a WSGI question which is explained in the PEP 0333 spec below.

http://www.python.org/dev/peps/pep-0333/

What you want to do uses the HTTP chunk response.

The spec shows how to write an iterator that creates a list that would
be sent out.

~Carl

On Sun, Nov 14, 2010 at 8:29 PM, Gelonida gelon...@gmail.com wrote:
 Hi,

 I'd like to write an application, which generates https output of an
 unkown length

 It will basically be a python function
 yielding a number of strings.


 What do I have to return as Content-Length ???

 0,
 -1,
 not send the Content-Length Header?

 something else?


 Currently I have a wrapper function collecting the strings, calculation
 their size and returning a list of all entries.

 Is ths really the only solution?


 thanks in advance for suggestions / ideas


 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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.





-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modw...@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] want to write wsgi module (https) returning string of an unkown length

2010-11-14 Thread Carl Nobile
Opps, Graham you are right the iterator which I mentioned wouldn't be
needed if all it did was create a list that got sent out. However, the
PEP0333 also does have an example of an iterator in it done correctly.

How is not setting the Content-Length not taking advantage of HTTP/1.1
chunk encoding? Wouldn't, and this is an assumption, apache or
whatever the server is add the chunk-size field to the header as
explained in RFC2616 Chapter 3.6.1?

~Carl

On Sun, Nov 14, 2010 at 9:50 PM, Graham Dumpleton
graham.dumple...@gmail.com wrote:
 On 15 November 2010 12:37, Carl Nobile carl.nob...@gmail.com wrote:
 This is really a WSGI question which is explained in the PEP 0333 spec below.

 http://www.python.org/dev/peps/pep-0333/

 What you want to do uses the HTTP chunk response.

 Technically it is wrong to refer to it as chunked response as WSGI
 specification doesn't deal with issue of chunked responses in as much
 as that term is used in HTTP.

 Anyway, the short of it is that you should simply not set a
 Content-Length response header.

 Rather than return an array of strings, you would use yield to return
 successive blocks of data for the response. Alternatively, you write a
 custom iterable with appropriate next() method for returning next
 block of data. In other words, use a generator like object.

 You can find a lot of articles on WSGI referenced from:

  http://www.wsgi.org/wsgi/Learn_WSGI

 Graham

 The spec shows how to write an iterator that creates a list that would
 be sent out.

 ~Carl

 On Sun, Nov 14, 2010 at 8:29 PM, Gelonida gelon...@gmail.com wrote:
 Hi,

 I'd like to write an application, which generates https output of an
 unkown length

 It will basically be a python function
 yielding a number of strings.


 What do I have to return as Content-Length ???

 0,
 -1,
 not send the Content-Length Header?

 something else?


 Currently I have a wrapper function collecting the strings, calculation
 their size and returning a list of all entries.

 Is ths really the only solution?


 thanks in advance for suggestions / ideas


 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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.





 --
 ---
 Carl J. Nobile (Software Engineer)
 carl.nob...@gmail.com
 ---

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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 modw...@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.





-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modw...@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] Error for Importing Module

2010-11-10 Thread Carl Nobile
You don't have your paths set up correctly. In your wsgi hook file you
need to import everything you will need to bring up Django correctly.
You need to import the django dir; any local site-packages that are
not part of python; plus set the DJANGO_SETTINGS_MODULE environment
var.

You can use:

PATH = os.path.dirname(__file__)

to start with. This will give you the path to your wsgi hook file.
Then from this you can find all the dirs that need to be in your path.

not sys.path.count(PATH_TO_SET) and sys.path.insert(0, PATH_TO_SET)

The above line will set any path you want into the Python paths. 1st
it checks that the path has not already been set then sets it if it
isn't set. Set the path to Django, your app, then any local packages
in this order. The last one set becomes the 1st in the Python path.
Finally set:

os.environ['DJANGO_SETTINGS_MODULE'] = 'your_app_path.settings'

You will need to import os, sys at the top of your hook file.

~Carl

On Wed, Nov 10, 2010 at 8:09 AM, Lalit Chattar lalitjain1...@gmail.com wrote:
 ImportError: No module named django.core.handlers.wsgi

 i m new in django. i m using wsgi with python 2.7 but it gives some
 error which i mentioned above..

 but this module already installed

 please help me.

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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.





-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modw...@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] error building mod_wsgi for python2.6 on centos x86_64

2010-11-06 Thread Carl Nobile
/usr/local/include/python2.6/pyport.h:685:2: error: #error LONG_BIT
definition appears wrong for platform (bad gcc/glibc config?).

Seems to be complaining that there is something wrong with the version
of glibc on your box. Sometimes on 64 bit machines there is also a 32
bit version of glibc, could you be pointing to it for some reason? I
see you are using a non CentOS standard version of Python, could this
be messing up your paths for other things?

~Carl

On Sat, Nov 6, 2010 at 10:46 AM, Vishwajeet dextrou...@gmail.com wrote:
 Hello,
 I am facing this problem while building mod_wsgi on centos x, I went
 through the documentation as well i tried to search on the web but
 none of the solutions helped me.
 I have compiled python from source and it's running perfectly fine.

 Any help in this regard is highly appreciated, I am stuck with this
 problem since morning, I have previously done the same and it has
 worked for me the only difference now is its on amazon ec2

 /usr/sbin/apxs -c -I/usr/local/include/python2.6 -DNDEBUG   mod_wsgi.c
 -L/usr/local/lib -L/usr/local/lib/python2.6/config  -lpython2.6 -
 lpthread -ldl  -lutil -lm
 /usr/lib/apr-1/build/libtool --silent --mode=compile gcc -prefer-pic -
 O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-
 protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -
 fasynchronous-unwind-tables -fno-strict-aliasing  -DLINUX=2 -
 D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -pthread -I/usr/
 include/httpd  -I/usr/include/apr-1   -I/usr/include/apr-1  -I/usr/
 local/include/python2.6 -DNDEBUG  -c -o mod_wsgi.lo mod_wsgi.c 
 touch mod_wsgi.slo
 In file included from /usr/local/include/python2.6/Python.h:58,
                 from mod_wsgi.c:135:
 /usr/local/include/python2.6/pyport.h:685:2: error: #error LONG_BIT
 definition appears wrong for platform (bad gcc/glibc config?).
 mod_wsgi.c: In function 'wsgi_server_group':
 mod_wsgi.c:949: warning: unused variable 'value'
 mod_wsgi.c: In function 'Log_writelines':
 mod_wsgi.c:1732: warning: unused variable 'msg'
 mod_wsgi.c: In function 'Adapter_output':
 mod_wsgi.c:3010: warning: unused variable 'n'
 mod_wsgi.c: In function 'Adapter_file_wrapper':
 mod_wsgi.c:4024: warning: unused variable 'result'
 mod_wsgi.c: In function 'wsgi_python_term':
 mod_wsgi.c:5631: warning: unused variable 'tstate'
 mod_wsgi.c:5630: warning: unused variable 'interp'
 mod_wsgi.c: In function 'wsgi_python_child_init':
 mod_wsgi.c:6760: warning: unused variable 'l'
 mod_wsgi.c:6658: warning: unused variable 'interp'
 mod_wsgi.c: In function 'wsgi_add_import_script':
 mod_wsgi.c:7411: warning: unused variable 'error'
 mod_wsgi.c: In function 'wsgi_add_handler_script':
 mod_wsgi.c:7859: warning: unused variable 'dconfig'
 mod_wsgi.c:7858: warning: unused variable 'sconfig'
 mod_wsgi.c: In function 'wsgi_hook_handler':
 mod_wsgi.c:8905: warning: suggest parentheses around assignment used
 as truth value
 mod_wsgi.c:8907: warning: suggest parentheses around assignment used
 as truth value
 mod_wsgi.c:8909: warning: suggest parentheses around assignment used
 as truth value
 mod_wsgi.c:8913: warning: suggest parentheses around assignment used
 as truth value
 mod_wsgi.c:8933: warning: suggest parentheses around assignment used
 as truth value
 mod_wsgi.c:8935: warning: suggest parentheses around assignment used
 as truth value
 mod_wsgi.c:8938: warning: suggest parentheses around assignment used
 as truth value
 mod_wsgi.c: In function 'wsgi_daemon_worker':
 mod_wsgi.c:10227: warning: unused variable 'duration'
 mod_wsgi.c:10226: warning: unused variable 'start'
 mod_wsgi.c: In function 'wsgi_hook_daemon_handler':
 mod_wsgi.c:12423: warning: unused variable 'i'
 mod_wsgi.c:12421: warning: unused variable 'elts'
 mod_wsgi.c:12420: warning: unused variable 'head'
 apxs:Error: Command failed with rc=65536
 .
 make: *** [mod_wsgi.la] Error 1

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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.





-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modw...@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: error building mod_wsgi for python2.6 on centos x86_64

2010-11-06 Thread Carl Nobile
You can use ldd on the python executable like so:

$ ldd /usr/bin/python
linux-vdso.so.1 =  (0x7fff6bbb4000)
libpthread.so.0 = /lib/libpthread.so.0 (0x7f3b8562b000)
libdl.so.2 = /lib/libdl.so.2 (0x7f3b85427000)
libutil.so.1 = /lib/libutil.so.1 (0x7f3b85223000)
libssl.so.0.9.8 = /lib/libssl.so.0.9.8 (0x7f3b84fd1000)
libcrypto.so.0.9.8 = /lib/libcrypto.so.0.9.8 (0x7f3b84c41000)
libz.so.1 = /lib/libz.so.1 (0x7f3b84a29000)
libm.so.6 = /lib/libm.so.6 (0x7f3b847a6000)
libc.so.6 = /lib/libc.so.6 (0x7f3b84423000)
/lib64/ld-linux-x86-64.so.2 (0x7f3b8586b000)

Notice the last line it indicates that the Python executable that I am
using is 64bit since it is pulling in the /lib64/ld-linux-x86-64.so.2
shared object. Your's may be the 32bit version.

~Carl

On Sat, Nov 6, 2010 at 7:01 PM, Vishwajeet dextrou...@gmail.com wrote:


 On Nov 6, 8:51 pm, Carl Nobile carl.nob...@gmail.com wrote:
 /usr/local/include/python2.6/pyport.h:685:2: error: #error LONG_BIT
 definition appears wrong for platform (bad gcc/glibc config?).

 Seems to be complaining that there is something wrong with the version
 of glibc on your box. Sometimes on 64 bit machines there is also a 32
 bit version of glibc, could you be pointing to it for some reason?

 How do I find that out ?

I see you are using a non CentOS standard version of Python, could this
 be messing up your paths for other things?

 I have similar setup working on three machines, I picked the .so file
 from one of the setups and moved to ec2 instance and it seems to be
 working fine.


 ~Carl



 On Sat, Nov 6, 2010 at 10:46 AM, Vishwajeet dextrou...@gmail.com wrote:
  Hello,
  I am facing this problem while building mod_wsgi on centos x, I went
  through the documentation as well i tried to search on the web but
  none of the solutions helped me.
  I have compiled python from source and it's running perfectly fine.

  Any help in this regard is highly appreciated, I am stuck with this
  problem since morning, I have previously done the same and it has
  worked for me the only difference now is its on amazon ec2

  /usr/sbin/apxs -c -I/usr/local/include/python2.6 -DNDEBUG   mod_wsgi.c
  -L/usr/local/lib -L/usr/local/lib/python2.6/config  -lpython2.6 -
  lpthread -ldl  -lutil -lm
  /usr/lib/apr-1/build/libtool --silent --mode=compile gcc -prefer-pic -
  O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-
  protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -
  fasynchronous-unwind-tables -fno-strict-aliasing  -DLINUX=2 -
  D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -pthread -I/usr/
  include/httpd  -I/usr/include/apr-1   -I/usr/include/apr-1  -I/usr/
  local/include/python2.6 -DNDEBUG  -c -o mod_wsgi.lo mod_wsgi.c 
  touch mod_wsgi.slo
  In file included from /usr/local/include/python2.6/Python.h:58,
                  from mod_wsgi.c:135:
  /usr/local/include/python2.6/pyport.h:685:2: error: #error LONG_BIT
  definition appears wrong for platform (bad gcc/glibc config?).
  mod_wsgi.c: In function 'wsgi_server_group':
  mod_wsgi.c:949: warning: unused variable 'value'
  mod_wsgi.c: In function 'Log_writelines':
  mod_wsgi.c:1732: warning: unused variable 'msg'
  mod_wsgi.c: In function 'Adapter_output':
  mod_wsgi.c:3010: warning: unused variable 'n'
  mod_wsgi.c: In function 'Adapter_file_wrapper':
  mod_wsgi.c:4024: warning: unused variable 'result'
  mod_wsgi.c: In function 'wsgi_python_term':
  mod_wsgi.c:5631: warning: unused variable 'tstate'
  mod_wsgi.c:5630: warning: unused variable 'interp'
  mod_wsgi.c: In function 'wsgi_python_child_init':
  mod_wsgi.c:6760: warning: unused variable 'l'
  mod_wsgi.c:6658: warning: unused variable 'interp'
  mod_wsgi.c: In function 'wsgi_add_import_script':
  mod_wsgi.c:7411: warning: unused variable 'error'
  mod_wsgi.c: In function 'wsgi_add_handler_script':
  mod_wsgi.c:7859: warning: unused variable 'dconfig'
  mod_wsgi.c:7858: warning: unused variable 'sconfig'
  mod_wsgi.c: In function 'wsgi_hook_handler':
  mod_wsgi.c:8905: warning: suggest parentheses around assignment used
  as truth value
  mod_wsgi.c:8907: warning: suggest parentheses around assignment used
  as truth value
  mod_wsgi.c:8909: warning: suggest parentheses around assignment used
  as truth value
  mod_wsgi.c:8913: warning: suggest parentheses around assignment used
  as truth value
  mod_wsgi.c:8933: warning: suggest parentheses around assignment used
  as truth value
  mod_wsgi.c:8935: warning: suggest parentheses around assignment used
  as truth value
  mod_wsgi.c:8938: warning: suggest parentheses around assignment used
  as truth value
  mod_wsgi.c: In function 'wsgi_daemon_worker':
  mod_wsgi.c:10227: warning: unused variable 'duration'
  mod_wsgi.c:10226: warning: unused variable 'start'
  mod_wsgi.c: In function 'wsgi_hook_daemon_handler':
  mod_wsgi.c:12423: warning: unused variable 'i'
  mod_wsgi.c

Re: [modwsgi] Some compile warnings in trunk

2010-10-19 Thread Carl Nobile
Graham,

Well what _POSIX_C_SOURCE and _XOPEN_SOURCE are set to in features.h
is not very straight forward. This is what I found in the header docs:

  _POSIX_C_SOURCE  If ==1, like _POSIX_SOURCE; if =2 add IEEE Std 1003.2;
if =199309L, add IEEE Std 1003.1b-1993;
if =199506L, add IEEE Std 1003.1c-1995;
if =200112L, all of IEEE 1003.1-2004
if =200809L, all of IEEE 1003.1-2008
   _XOPEN_SOURCEIncludes POSIX and XPG things.  Set to 500 if
Single Unix conformance is wanted, to 600 for the
sixth revision, to 700 for the seventh revision.

/usr/include/python2.6/pyconfig.h:

/* Define to activate features from IEEE Stds 1003.1-2001 */
#define _POSIX_C_SOURCE 200112L

/* Define to the level of X/Open that your system supports */
#define _XOPEN_SOURCE 600

---

It looks like _XOPEN_SOURCE is being set to 700 and _POSIX_C_SOURCE
200809L in features.h. I'm assuming that _GNU_SOURCE is defined since
this is an Ubuntu server running on two Xion hyper-treading 32bit
processors which data back to about 2004. It looks like from the order
of the error message that the Python definition are winning out with
slightly older features assuming the compiler is actually allowing the
redefinition of these defs. Well mod_wsgi seems to be working fine, so
I'm not really worried about this. I have a stock binary install of
Python, so the Python sources are just used to build mod_wsgi.

/* If _GNU_SOURCE was defined by the user, turn on all the other features.  */
#ifdef _GNU_SOURCE
# undef  _ISOC99_SOURCE
# define _ISOC99_SOURCE 1
# undef  _POSIX_SOURCE
# define _POSIX_SOURCE  1
# undef  _POSIX_C_SOURCE
# define _POSIX_C_SOURCE200809L
# undef  _XOPEN_SOURCE
# define _XOPEN_SOURCE  700
# undef  _XOPEN_SOURCE_EXTENDED
# define _XOPEN_SOURCE_EXTENDED 1
# undef  _LARGEFILE64_SOURCE
# define _LARGEFILE64_SOURCE1
# undef  _BSD_SOURCE
# define _BSD_SOURCE1
# undef  _SVID_SOURCE
# define _SVID_SOURCE   1
# undef  _ATFILE_SOURCE
# define _ATFILE_SOURCE 1
#endif

~Carl

On Tue, Oct 19, 2010 at 7:25 AM, Graham Dumpleton
graham.dumple...@gmail.com wrote:
 On 13 October 2010 05:38, Carl Nobile carl.nob...@gmail.com wrote:
 Graham, I realize this is not a big issue, but I have noticed compiler
 warning while compiling the latest trunk revision 1703. You usually
 have pristine compiles, so it caught my attention.

 $ make
 /usr/bin/apxs2 -c -I/usr/include/python2.6 -DNDEBUG   mod_wsgi.c -L/
 usr/lib -L/usr/lib/python2.6/config  -lpython2.6 -lpthread -ldl  -
 lutil -lm
 /usr/share/apr-1.0/build/libtool --silent --mode=compile --tag=disable-
 static x86_64-linux-gnu-gcc -prefer-pic -DLINUX=2 -D_FORTIFY_SOURCE=2 -
 D_GNU_SOURCE -D_REENTRANT -I/usr/include/apr-1.0 -I/usr/include/
 openssl -I/usr/include/xmltok -pthread     -I/usr/include/apache2  -I/
 usr/include/apr-1.0   -I/usr/include/apr-1.0  -I/usr/include/python2.6
 -DNDEBUG  -c -o mod_wsgi.lo mod_wsgi.c  touch mod_wsgi.slo
 In file included from /usr/include/python2.6/Python.h:8,
                 from mod_wsgi.c:142:
 /usr/include/python2.6/pyconfig.h:1031:1: warning: _POSIX_C_SOURCE
 redefined
 In file included from /usr/include/sys/types.h:27,
                 from /usr/include/apr-1.0/apr.h:131,
                 from /usr/include/apache2/ap_config.h:25,
                 from /usr/include/apache2/httpd.h:43,
                 from mod_wsgi.c:34:
 /usr/include/features.h:158:1: warning: this is the location of the
 previous definition
 In file included from /usr/include/python2.6/Python.h:8,
                 from mod_wsgi.c:142:
 /usr/include/python2.6/pyconfig.h:1040:1: warning: _XOPEN_SOURCE
 redefined
 In file included from /usr/include/sys/types.h:27,
                 from /usr/include/apr-1.0/apr.h:131,
                 from /usr/include/apache2/ap_config.h:25,
                 from /usr/include/apache2/httpd.h:43,
                 from mod_wsgi.c:34:
 /usr/include/features.h:160:1: warning: this is the location of the
 previous definition
 /usr/share/apr-1.0/build/libtool --silent --mode=link --tag=disable-
 static x86_64-linux-gnu-gcc -o mod_wsgi.la  -rpath /usr/lib/apache2/
 modules -module -avoid-version    mod_wsgi.lo -L/usr/lib -L/usr/lib/
 python2.6/config -lpython2.6 -lpthread -ldl -lutil -lm

 Most likely because -D_GNU_SOURCE is being defined on compiler command
 which is causing features.h to explicitly define _POSIX_C_SOURCE and
 _XOPEN_SOURCE to some value.

 The Python header files are also defining the same and so preprocessor
 will complain.

 Usually not much you can do about this sort of problem and I guess you
 hope that which ever one ends up winning out doesn't cause some sort
 of incompatibility if they each use different versions.

 What values are each of these variables set to in features.h and pyconfig.h?

 Graham

 --
 You received this message because you are subscribed

Re: [modwsgi] Apache hangs with mod_wsgi 3.3

2010-10-19 Thread Carl Nobile
Any messages in your apache logs? This is a long shot, but I have seen
issues like this when fuse is used on top of an NFS mount though it
has never brought the server to a complete halt as it seems to have
with you.

~Carl

On Tue, Oct 19, 2010 at 9:54 AM, Patrick Michael Kane
patrick.k...@gmail.com wrote:
 Hey all:

 We're running a Django site using Apache+mod_wsgi.  The stack is
 pretty typical: Apache 2.2.14, mod_wsgi 3.3, Python 2.6.1.  We're
 running single-threaded using DaemonProcess (WSGIDaemonProcess staging
 threads=1 processes=8 maximum-requests=10 python-path=[path] display-
 name=%{GROUP}).

 We're seeing an issue where the Apache server will stop responding to
 all requests (even non-WSGI ones) after a fairly large number of
 requests.  When we strace the wsgi processes, they are all in poll(),
 waiting to be talked to:

 poll([{fd=3, events=POLLIN}], 1, -1...

 When we look at the httpds, they are blocking on connect to the
 mod_wsgi unix socket:

 connect(69, {sa_family=AF_FILE, path=/home/actionkit/releases/stable/
 apache/logs/.1873.28.7.sock}, 110

 A restart fixes it and then the problem goes away for a few days to a
 week.  We're seeing the same behavior across 3 identical webservers.

 The problem happens once every few days.

 If folks have any ideas on the cause, I'm all ears.  Alternatively, if
 there's additional steps we can take to debug that would be helpful,
 let me know.

 Thanks!

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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.





-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modw...@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] Getting “(2)No such file or director y” errrors when running apache/django/mod_wsgi web site.

2010-10-14 Thread Carl Nobile
I have seen this issue before it is usually caused by permission
changes in the path leading to the socket file. You can test this by
setting the socket file to be put into /tmp. If it starts to work
correctly check the path to the old location and be sure apache can
write to every directory in it.

~Carl

On Wed, Oct 13, 2010 at 7:30 PM, Chintan Tank tankchin...@gmail.com wrote:
 Since past 2 days I have been getting the following error -

 (2)No such file or directory: mod_wsgi (pid=2709): Unable to connect
 to WSGI daemon process 'my_site' on '/var/run/apache2/wsgi.
 2688.2.1.sock' after multiple attempts.

 Since it was working before, I dont know why the error has been
 caused. I have tried following without success -

   1. Providing WSGISocketPrefix 
 http://www.mail-archive.com/python-l...@python.org/msg180917.html
   2. Kill all the apache daemons manually  then restarting the
 server.
   3. I have made sure that the mod_wsgi exists in the location
 pointed to in the httpd.conf

 Any help or pointers towards this will be great.

 I am at my wit's end, especially this was working just 2 days back  I
 cant recall making any system updates. Not sure if this is relevant
 but I did run apache  django dev server on this machine. But mostly
 never in parallel.

 P.S. My httpd.conf snippet

 WSGIDaemonProcess my_site python-path=/usr/local/code/pinax/pinax-env/
 lib/python2.6/site-packages threads=25 user=daemon group=daemon
 WSGIProcessGroup my_site


 WSGIScriptAlias / /usr/local/code/my_site/deploy/pinax.wsgi
 #WSGISocketPrefix /var/run/apache2/wsgi


 Directory /usr/local/code/my_site/deploy
    Order deny,allow
    Allow from all
 /Directory

 Directory /usr/local/my_site_db
    Order deny,allow
    Allow from all
 /Directory

 Please help.

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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.





-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modw...@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] Getting “(2)No such file or director y” errrors when running apache/django/mod_wsgi web site.

2010-10-14 Thread Carl Nobile
Below is a link to the docs where Graham gives some solutions to this issue.

http://code.google.com/p/modwsgi/wiki/ConfigurationIssues#Location_Of_UNIX_Sockets

~Carl

On Thu, Oct 14, 2010 at 10:32 AM, Graham Dumpleton
graham.dumple...@gmail.com wrote:


 It is ability of Apache user to read files created, not write them. When 
 being created the process is run as root, so no problem at that point.

 That error can occur for other reasons as well.

 On really bad Internet from my phone  right now, so can't elaborate.

 On 14/10/2010, at 9:19 PM, Carl Nobile carl.nob...@gmail.com wrote:

 I have seen this issue before it is usually caused by permission
 changes in the path leading to the socket file. You can test this by
 setting the socket file to be put into /tmp. If it starts to work
 correctly check the path to the old location and be sure apache can
 write to every directory in it.

 ~Carl

 On Wed, Oct 13, 2010 at 7:30 PM, Chintan Tank tankchin...@gmail.com wrote:
 Since past 2 days I have been getting the following error -

 (2)No such file or directory: mod_wsgi (pid=2709): Unable to connect
 to WSGI daemon process 'my_site' on '/var/run/apache2/wsgi.
 2688.2.1.sock' after multiple attempts.

 Since it was working before, I dont know why the error has been
 caused. I have tried following without success -

   1. Providing WSGISocketPrefix 
 http://www.mail-archive.com/python-l...@python.org/msg180917.html
   2. Kill all the apache daemons manually  then restarting the
 server.
   3. I have made sure that the mod_wsgi exists in the location
 pointed to in the httpd.conf

 Any help or pointers towards this will be great.

 I am at my wit's end, especially this was working just 2 days back  I
 cant recall making any system updates. Not sure if this is relevant
 but I did run apache  django dev server on this machine. But mostly
 never in parallel.

 P.S. My httpd.conf snippet

 WSGIDaemonProcess my_site python-path=/usr/local/code/pinax/pinax-env/
 lib/python2.6/site-packages threads=25 user=daemon group=daemon
 WSGIProcessGroup my_site


 WSGIScriptAlias / /usr/local/code/my_site/deploy/pinax.wsgi
 #WSGISocketPrefix /var/run/apache2/wsgi


 Directory /usr/local/code/my_site/deploy
    Order deny,allow
    Allow from all
 /Directory

 Directory /usr/local/my_site_db
    Order deny,allow
    Allow from all
 /Directory

 Please help.

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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.





 --
 ---
 Carl J. Nobile (Software Engineer)
 carl.nob...@gmail.com
 ---

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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 modw...@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.





-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modw...@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] Occasionally fails with no traces except broken connection

2010-10-12 Thread Carl Nobile
You say all other sites are working, but do any of these sites use mod_wsgi?

~Carl

On Tue, Oct 12, 2010 at 11:55 AM, anatoly techtonik techto...@gmail.com wrote:
 Hi,

 I am running Trac under mod_wsgi on Debian Lenny in daemon mode. It
 fails quite often when editing wiki pages. Chrome shows:

 Error 101 (net::ERR_CONNECTION_RESET): Unknown error.

 All other sites work ok, so it's not a problem with my internet
 connection. The SSH session to the same host is stable while I've
 managed to catch about 3 connection reset errors with Trac/mod_wsgi.
 The strange thing is that I can't see any error in Trac or Apache
 error logs. Looks like request is just not handled.

 How can I debug the issue?

 Thanks.

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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.





-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modw...@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] Some compile warnings in trunk

2010-10-12 Thread Carl Nobile
Graham, I realize this is not a big issue, but I have noticed compiler
warning while compiling the latest trunk revision 1703. You usually
have pristine compiles, so it caught my attention.

$ make
/usr/bin/apxs2 -c -I/usr/include/python2.6 -DNDEBUG   mod_wsgi.c -L/
usr/lib -L/usr/lib/python2.6/config  -lpython2.6 -lpthread -ldl  -
lutil -lm
/usr/share/apr-1.0/build/libtool --silent --mode=compile --tag=disable-
static x86_64-linux-gnu-gcc -prefer-pic -DLINUX=2 -D_FORTIFY_SOURCE=2 -
D_GNU_SOURCE -D_REENTRANT -I/usr/include/apr-1.0 -I/usr/include/
openssl -I/usr/include/xmltok -pthread -I/usr/include/apache2  -I/
usr/include/apr-1.0   -I/usr/include/apr-1.0  -I/usr/include/python2.6
-DNDEBUG  -c -o mod_wsgi.lo mod_wsgi.c  touch mod_wsgi.slo
In file included from /usr/include/python2.6/Python.h:8,
 from mod_wsgi.c:142:
/usr/include/python2.6/pyconfig.h:1031:1: warning: _POSIX_C_SOURCE
redefined
In file included from /usr/include/sys/types.h:27,
 from /usr/include/apr-1.0/apr.h:131,
 from /usr/include/apache2/ap_config.h:25,
 from /usr/include/apache2/httpd.h:43,
 from mod_wsgi.c:34:
/usr/include/features.h:158:1: warning: this is the location of the
previous definition
In file included from /usr/include/python2.6/Python.h:8,
 from mod_wsgi.c:142:
/usr/include/python2.6/pyconfig.h:1040:1: warning: _XOPEN_SOURCE
redefined
In file included from /usr/include/sys/types.h:27,
 from /usr/include/apr-1.0/apr.h:131,
 from /usr/include/apache2/ap_config.h:25,
 from /usr/include/apache2/httpd.h:43,
 from mod_wsgi.c:34:
/usr/include/features.h:160:1: warning: this is the location of the
previous definition
/usr/share/apr-1.0/build/libtool --silent --mode=link --tag=disable-
static x86_64-linux-gnu-gcc -o mod_wsgi.la  -rpath /usr/lib/apache2/
modules -module -avoid-versionmod_wsgi.lo -L/usr/lib -L/usr/lib/
python2.6/config -lpython2.6 -lpthread -ldl -lutil -lm

~Carl

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modw...@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] Occasionally fails with no traces except broken connection

2010-10-12 Thread Carl Nobile
First I wouldn't set the DocumentRoot to anything.
Then I would try to see if it worked normally on port 80 by commenting
out all the SSL stuff. Maybe temporarily use a local network address
if you are concerned with security.
Is the path to the log file really /var/trac/log? I would think it
should be /var/log/trac.

~Carl

On Tue, Oct 12, 2010 at 6:31 PM, anatoly techtonik techto...@gmail.com wrote:
 Daemon mode. There is also mod_php5 module on this Apache2 server.

 VirtualHost *:443
   ServerName trac.example.com
   DocumentRoot /var/trac/static/htdocs
   ErrorLog /var/trac/log/error.log
   LogLevel notice

   Alias /chrome /var/trac/static/htdocs
   Directory /var/trac/static/htdocs
      Order allow,deny
      Allow from all
   /Directory


   WSGIDaemonProcess example-trac user=trac group=trac umask=0026
 home=/var/trac display-name=wsgi:trac
   WSGIProcessGroup example-trac

   WSGIScriptAlias / /var/trac/static/cgi-bin/trac.wsgi

   Directory /var/trac/static/cgi-bin
      # this is needed for Subversion bindings
      #WSGIApplicationGroup %{GLOBAL}

      Order allow,deny
      Allow from all
   /Directory

   SSLEngine On
   SSLProtocol all
   SSLCertificateFile /etc/apache2/ssl.crt/example.com.crt
   SSLCertificateKeyFile /etc/apache2/ssl.key/example.com.key
 /VirtualHost

 --
 anatoly t.



 On Tue, Oct 12, 2010 at 10:28 PM, Carl Nobile carl.nob...@gmail.com wrote:
 Are you using daemon or embedded mode? Is PHP being used?

 I hope you are using daemon mode as embedded mode will have tons of
 issues with other mods on the system PHP being one.

 Include your apache conf for Trac please.

 ~Carl

 On Tue, Oct 12, 2010 at 3:11 PM, anatoly techtonik techto...@gmail.com 
 wrote:
 Only Trac is using mod_wsgi, although there are some other sites
 handled by the same Apache2 instance, but I don't work with them to
 know if they fail or not.
 --
 anatoly t.



 On Tue, Oct 12, 2010 at 9:26 PM, Carl Nobile carl.nob...@gmail.com wrote:
 You say all other sites are working, but do any of these sites use 
 mod_wsgi?

 ~Carl

 On Tue, Oct 12, 2010 at 11:55 AM, anatoly techtonik techto...@gmail.com 
 wrote:
 Hi,

 I am running Trac under mod_wsgi on Debian Lenny in daemon mode. It
 fails quite often when editing wiki pages. Chrome shows:

 Error 101 (net::ERR_CONNECTION_RESET): Unknown error.

 All other sites work ok, so it's not a problem with my internet
 connection. The SSH session to the same host is stable while I've
 managed to catch about 3 connection reset errors with Trac/mod_wsgi.
 The strange thing is that I can't see any error in Trac or Apache
 error logs. Looks like request is just not handled.

 How can I debug the issue?

 Thanks.

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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.





 --
 ---
 Carl J. Nobile (Software Engineer)
 carl.nob...@gmail.com
 ---

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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 modw...@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.





 --
 ---
 Carl J. Nobile (Software Engineer)
 carl.nob...@gmail.com
 ---

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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 modw...@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.





-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com

Re: [modwsgi] Re: mod_wsgi with python stackless

2010-10-09 Thread Carl Nobile
I just had a thought, did you compile mod_wsgi with stackless? You
cannot just change the python version that mod_wsgi uses after it has
been compiled. You must use the exact version of python that mod_wsgi
was built with when you run your apps.

~Carl

On Fri, Oct 8, 2010 at 6:27 AM, crumble herve.coatan...@gmail.com wrote:
 As a matter of fact I need channels, tasks and pickling of tasks.
 My goal is to run nagare (http://www.nagare.org) applications, right
 now I run them with apache using mod_fastcgi and flup.

 I managed to change www-data path (I modified /etc/apache/envvars) now
 my wsgi script displays:

 /opt/stackless-2.7-maint/lib/python27.zip
 /opt/stackless-2.7-maint/lib/python2.7
 /opt/stackless-2.7-maint/lib/python2.7/plat-linux2
 /opt/stackless-2.7-maint/lib/python2.7/lib-tk
 /opt/stackless-2.7-maint/lib/python2.7/lib-old
 /opt/stackless-2.7-maint/lib/python2.7/lib-dynload
 /opt/stackless-2.7-maint/lib/python2.7/site-packages 2.7

 Stackless 3.1b3 060516 (release27-maint:85288M, Oct 6 2010, 17:11:34)
 [GCC 4.4.5]

 /opt/stackless-2.7-maint

 /opt/stackless-2.7-maint/bin/python


 But still no luck with import stackless, I guess I'll stick with
 fastcgi or I'll give a try to another webserver.

 On 7 oct, 18:55, Carl Nobile carl.nob...@gmail.com wrote:
 Will your code need to be spawning a lot of threads on its own? Would
 a process model do just as well. Guido has not, at least to my
 knowledge, approved any way of getting around the GIL issues which
 would make me very hesitant to use a fork of Python. I didn't
 understand what stackless python was until I did a search for it just
 now.

 Graham is away and has limited access to the net as he told us a week
 or so ago, but I'm sure when he is able to he can comment on this. He
 may have ran into this issue before.

 I don't think changing Apache's env path will help much matter-of-fact
 it may break things. You should be able to do what you need in the
 mod_wsgi/apache config.

 ~Carl

 On Thu, Oct 7, 2010 at 11:25 AM, crumble herve.coatan...@gmail.com wrote:
  I have no need for 2.7, what i need is stackless python actually.
  But I assumed having a version number different from system one would
  shed the light on linking errors I would miss otherwise.

  Right now I'm trying to change www-data user's PATH so that apache
  will find the right python executable.

  On 7 oct, 16:56, Carl Nobile carl.nob...@gmail.com wrote:
  It's always easier to work with the version that come with your
  platform, and in production environments that's what we do. There will
  not be enough different between 2.6 and 2.7 to make much difference.
  Is there a reason you need to have a virtual env?

  To get the python executable on the command line for the virtual env
  you will have to add it to your PATH in your .bashrc (assuming you are
  using bash).

  ~Carl

  On Thu, Oct 7, 2010 at 10:37 AM, crumble herve.coatan...@gmail.com 
  wrote:
   As I understand it, /opt/stackless-2.7-maint is my BASELINE
   environment not just a package, the python I run is, /opt/
   stackless-2.7-maint/bin/python. It is no symlink or venv python.

   I thought in that case WSGIPythonHome would be /opt/stackless-2.7-
   maint, any idea what the Python BASELINE environment should be ?

   I guess you're right, I had it configured the wrong way because
   sys.executable gives me /usr/bin/python. Which is weid as /usr/bin/
   python is a vanilla 2.6 python, that comes with Ubuntu.

   --
   Crumble

   On 7 oct, 15:40, Carl Nobile carl.nob...@gmail.com wrote:
   It seems to be that WSGIPythonHome needs to point to your Python
   BASELINE environment not a single package. Any package you need to use
   needs to be in the BASELINE env or added to the env in your wsgi hook
   file. I personally never use WSGIPythonHome as it is generally not
   needed in any of the sites I have built, but it seems from the docs
   that you have it configured wrong.

   ~Carl

   On Thu, Oct 7, 2010 at 9:19 AM, crumble herve.coatan...@gmail.com 
   wrote:
I managed to compile and install mod_wsgi (3.3) against python 2.7
stackless using --with-python configure option (I don't have any 
other
python2.7 on my machine)

I'm using Ubuntu 10.10 RC with apache 2.2.16 without mod_python.

ldd on mod_wsgi.so module gives:

   linux-vdso.so.1 =  (0x7fff94fff000)
   libpython2.7.so.1.0 = /opt/stackless-2.7-maint/lib/
libpython2.7.so.1.0 (0x7f548f477000)
   libpthread.so.0 = /lib/libpthread.so.0 (0x7f548f25a000)
   libdl.so.2 = /lib/libdl.so.2 (0x7f548f055000)
   libutil.so.1 = /lib/libutil.so.1 (0x7f548ee52000)
   libm.so.6 = /lib/libm.so.6 (0x7f548ebcf000)
   libc.so.6 = /lib/libc.so.6 (0x7f548e84b000)
   /lib64/ld-linux-x86-64.so.2 (0x7f548fad1000)

As stated in Installation Issue documentation I used WSGIPythonHome
directive the following way:
-- apache.conf
LogLevel info

WSGIPythonHome /opt

Re: [modwsgi] Initial problem with mod_wsgi under XAMPP/Win7_64Bit

2010-10-09 Thread Carl Nobile
Are you sure that the .so shouldn't be a .dll. Only UNIX/Linux systems
us .so file and windows uses .dll files. This just looks a bit unusual
to me, but I have never used mod_wsgi on windows.

~Carl

On Sat, Oct 9, 2010 at 9:00 AM, m4rquis m4rq...@gmail.com wrote:
 Hello, community,

 at first I wish to thank you for your help and for modwsgi! We use it
 in a small web project with django.

 Everything runs smooth under *NIX but my development system (Windows
 7, 64Bit, XAMPP 1.7.3 with Apache 2.2.14 32 Bit) seems to have a
 strange problem with modwsgi (mod_wsgi-win32-ap22py27-3.3.so - Apache
 2.2 / Python 2.7):

 Apache claims that it cannot find the .so-Module!? But it resides in
 the correct path!? I have no idea what's the reason for this problem.
 Hopefully you can help?

 httpd.conf says:
 LoadModule wsgi_module modules/mod_wsgi.so

 mod_wsgi.so is in 'C:\xampp\apache\modules' where the other modules
 are.

 The error message is:
 httpd.exe: Syntax error on line 133 of C:/xampp/apache/conf/
 httpd.conf: Cannot load C:/xampp/apache/mod_wsgi.so into server: The
 specified module could not be found.

 Thanks alot for your help and advice!

 Martin

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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.





-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modw...@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] Seg fault with mod_php

2010-10-08 Thread Carl Nobile
In general mod_wsgi will not work well with mod_php or mod_python, try
configuring your mod_wsgi apps to use daemon mode this may bring
better luck.

~Carl

On Fri, Oct 8, 2010 at 6:01 PM, Kropotkin justinwyl...@googlemail.com wrote:
 Just trying to install mod_wsgi 3.3. on my system
 Apache 2.0.52 in prefork mode on RedHat Linux with PHP 5.2.13

 My httpd processes start, they appear to take up no memory, have
 'defunct' next to them and then go away. In the logs I find lines like
 this: child pid 12103 exit signal Segmentation fault (11). I think
 this is not when mod_wsgi is being loaded but on the first request.

 The conflict is with mod_php. When I remove that all is fine. I tried
 removing all my PHP extensions but that did not fix it.

 I did have python 2.3.4 installed and mod_wsgi would not compile
 against that but I installed 2.6 and ran configure with this ./
 configure --with-python=/path/to/my/python2.6] and compile seemed to
 be fine - I got the so.

 Not sure where to go next

 Thanks for any steers

 Justin Wyllie

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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.





-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modw...@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] Seg fault with mod_php

2010-10-08 Thread Carl Nobile
Look at this thread:
http://groups.google.com/group/modwsgi/browse_thread/thread/2e84f9ae0b5ac0c4/f98f9f5b35ff8200?lnk=gstq=mod_php+and+mod_wsgi#f98f9f5b35ff8200

~Carl

On Fri, Oct 8, 2010 at 6:40 PM, Carl Nobile carl.nob...@gmail.com wrote:
 In general mod_wsgi will not work well with mod_php or mod_python, try
 configuring your mod_wsgi apps to use daemon mode this may bring
 better luck.

 ~Carl

 On Fri, Oct 8, 2010 at 6:01 PM, Kropotkin justinwyl...@googlemail.com wrote:
 Just trying to install mod_wsgi 3.3. on my system
 Apache 2.0.52 in prefork mode on RedHat Linux with PHP 5.2.13

 My httpd processes start, they appear to take up no memory, have
 'defunct' next to them and then go away. In the logs I find lines like
 this: child pid 12103 exit signal Segmentation fault (11). I think
 this is not when mod_wsgi is being loaded but on the first request.

 The conflict is with mod_php. When I remove that all is fine. I tried
 removing all my PHP extensions but that did not fix it.

 I did have python 2.3.4 installed and mod_wsgi would not compile
 against that but I installed 2.6 and ran configure with this ./
 configure --with-python=/path/to/my/python2.6] and compile seemed to
 be fine - I got the so.

 Not sure where to go next

 Thanks for any steers

 Justin Wyllie

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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.





 --
 ---
 Carl J. Nobile (Software Engineer)
 carl.nob...@gmail.com
 ---




-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modw...@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] Mod wsgi issue in amazon ec2 32 bit ubuntu lucid

2010-10-07 Thread Carl Nobile
It looks like you have compiled mod_wsgi with one version of Python
and are using another version of Python in apache during run time.

~Carl

On Thu, Oct 7, 2010 at 2:32 AM, Serendipity udn...@gmail.com wrote:
 I am able to install mod_wsgi and apache properly using the
 appropriate sudo  apt-get commands.
 But when i start the server and try to access a django page i get the
 error

  ImportError: path/lib/python2.6/lib-dynload/datetime.so: wrong ELF
 class: ELFCLASS64

 Not sure how to resolve this.

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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 modw...@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] mod_wsgi with python stackless

2010-10-07 Thread Carl Nobile
It seems to be that WSGIPythonHome needs to point to your Python
BASELINE environment not a single package. Any package you need to use
needs to be in the BASELINE env or added to the env in your wsgi hook
file. I personally never use WSGIPythonHome as it is generally not
needed in any of the sites I have built, but it seems from the docs
that you have it configured wrong.

~Carl

On Thu, Oct 7, 2010 at 9:19 AM, crumble herve.coatan...@gmail.com wrote:
 I managed to compile and install mod_wsgi (3.3) against python 2.7
 stackless using --with-python configure option (I don't have any other
 python2.7 on my machine)

 I'm using Ubuntu 10.10 RC with apache 2.2.16 without mod_python.

 ldd on mod_wsgi.so module gives:

    linux-vdso.so.1 =  (0x7fff94fff000)
    libpython2.7.so.1.0 = /opt/stackless-2.7-maint/lib/
 libpython2.7.so.1.0 (0x7f548f477000)
    libpthread.so.0 = /lib/libpthread.so.0 (0x7f548f25a000)
    libdl.so.2 = /lib/libdl.so.2 (0x7f548f055000)
    libutil.so.1 = /lib/libutil.so.1 (0x7f548ee52000)
    libm.so.6 = /lib/libm.so.6 (0x7f548ebcf000)
    libc.so.6 = /lib/libc.so.6 (0x7f548e84b000)
    /lib64/ld-linux-x86-64.so.2 (0x7f548fad1000)


 As stated in Installation Issue documentation I used WSGIPythonHome
 directive the following way:
 -- apache.conf
 LogLevel info

 WSGIPythonHome /opt/stackless-2.7-maint

 VirtualHost *:80
        ServerName test_wsgi
        WSGIScriptAlias /hello_world some_path/hello_world.wsgi
 /VirtualHost


 Finally, here is my WSGI script
 -- hello_world.wsgi
 import os
 import sys
 #import stackless

 def application(environ, start_response):
    status = '200 OK'
    response_headers = [('Content-type','text/html')]
    start_response(status, response_headers)

    body = html
    body
    %s
    hr
    %s
    hr
    %s
    hr
    %s
    /body
 /html % ('br'.join(sys.path), sys.version, sys.prefix,
 sys.executable)

    return [body]

 At that point everything seems alright http://test_wsgi/hello_world
 giving the following:

 /opt/stackless-2.7-maint/lib/python27.zip
 /opt/stackless-2.7-maint/lib/python2.7
 /opt/stackless-2.7-maint/lib/python2.7/plat-linux2
 /opt/stackless-2.7-maint/lib/python2.7/lib-tk
 /opt/stackless-2.7-maint/lib/python2.7/lib-old
 /opt/stackless-2.7-maint/lib/python2.7/lib-dynload
 /opt/stackless-2.7-maint/lib/python2.7/site-packages 2.7

 Stackless 3.1b3 060516 (release27-maint:85288M, Oct 6 2010, 17:11:34)
 [GCC 4.4.5]

 /opt/stackless-2.7-maint

 /usr/bin/python

 The problem occurs when I uncomment import stackless line. I get an
 Internal Server Error with the following in apache log:


 [Thu Oct 07 15:14:09 2010] [info] [client 127.0.0.1] mod_wsgi
 (pid=6457, process='', application='test_wsgi|/hello_world'):
 Reloading WSGI script 'some path/hello_world.wsgi'.
 [Thu Oct 07 15:14:09 2010] [error] [client 127.0.0.1] mod_wsgi
 (pid=6457): Target WSGI script 'some path/hello_world.wsgi' cannot
 be loaded as Python module.
 [Thu Oct 07 15:14:09 2010] [error] [client 127.0.0.1] mod_wsgi
 (pid=6457): Exception occurred processing WSGI script 'some path/
 hello_world.wsgi'.
 [Thu Oct 07 15:14:09 2010] [error] [client 127.0.0.1] Traceback (most
 recent call last):
 [Thu Oct 07 15:14:09 2010] [error] [client 127.0.0.1]   File some
 path/hello_world.wsgi, line 4, in module
 [Thu Oct 07 15:14:09 2010] [error] [client 127.0.0.1]     import
 stackless
 [Thu Oct 07 15:14:09 2010] [error] [client 127.0.0.1] ImportError: No
 module named stackless

 I don't why the import is not working.

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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.





-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modw...@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 with python stackless

2010-10-07 Thread Carl Nobile
It's always easier to work with the version that come with your
platform, and in production environments that's what we do. There will
not be enough different between 2.6 and 2.7 to make much difference.
Is there a reason you need to have a virtual env?

To get the python executable on the command line for the virtual env
you will have to add it to your PATH in your .bashrc (assuming you are
using bash).

~Carl

On Thu, Oct 7, 2010 at 10:37 AM, crumble herve.coatan...@gmail.com wrote:
 As I understand it, /opt/stackless-2.7-maint is my BASELINE
 environment not just a package, the python I run is, /opt/
 stackless-2.7-maint/bin/python. It is no symlink or venv python.

 I thought in that case WSGIPythonHome would be /opt/stackless-2.7-
 maint, any idea what the Python BASELINE environment should be ?

 I guess you're right, I had it configured the wrong way because
 sys.executable gives me /usr/bin/python. Which is weid as /usr/bin/
 python is a vanilla 2.6 python, that comes with Ubuntu.

 --
 Crumble

 On 7 oct, 15:40, Carl Nobile carl.nob...@gmail.com wrote:
 It seems to be that WSGIPythonHome needs to point to your Python
 BASELINE environment not a single package. Any package you need to use
 needs to be in the BASELINE env or added to the env in your wsgi hook
 file. I personally never use WSGIPythonHome as it is generally not
 needed in any of the sites I have built, but it seems from the docs
 that you have it configured wrong.

 ~Carl



 On Thu, Oct 7, 2010 at 9:19 AM, crumble herve.coatan...@gmail.com wrote:
  I managed to compile and install mod_wsgi (3.3) against python 2.7
  stackless using --with-python configure option (I don't have any other
  python2.7 on my machine)

  I'm using Ubuntu 10.10 RC with apache 2.2.16 without mod_python.

  ldd on mod_wsgi.so module gives:

     linux-vdso.so.1 =  (0x7fff94fff000)
     libpython2.7.so.1.0 = /opt/stackless-2.7-maint/lib/
  libpython2.7.so.1.0 (0x7f548f477000)
     libpthread.so.0 = /lib/libpthread.so.0 (0x7f548f25a000)
     libdl.so.2 = /lib/libdl.so.2 (0x7f548f055000)
     libutil.so.1 = /lib/libutil.so.1 (0x7f548ee52000)
     libm.so.6 = /lib/libm.so.6 (0x7f548ebcf000)
     libc.so.6 = /lib/libc.so.6 (0x7f548e84b000)
     /lib64/ld-linux-x86-64.so.2 (0x7f548fad1000)

  As stated in Installation Issue documentation I used WSGIPythonHome
  directive the following way:
  -- apache.conf
  LogLevel info

  WSGIPythonHome /opt/stackless-2.7-maint

  VirtualHost *:80
         ServerName test_wsgi
         WSGIScriptAlias /hello_world some_path/hello_world.wsgi
  /VirtualHost

  Finally, here is my WSGI script
  -- hello_world.wsgi
  import os
  import sys
  #import stackless

  def application(environ, start_response):
     status = '200 OK'
     response_headers = [('Content-type','text/html')]
     start_response(status, response_headers)

     body = html
     body
     %s
     hr
     %s
     hr
     %s
     hr
     %s
     /body
  /html % ('br'.join(sys.path), sys.version, sys.prefix,
  sys.executable)

     return [body]

  At that point everything seems alrighthttp://test_wsgi/hello_world
  giving the following:

  /opt/stackless-2.7-maint/lib/python27.zip
  /opt/stackless-2.7-maint/lib/python2.7
  /opt/stackless-2.7-maint/lib/python2.7/plat-linux2
  /opt/stackless-2.7-maint/lib/python2.7/lib-tk
  /opt/stackless-2.7-maint/lib/python2.7/lib-old
  /opt/stackless-2.7-maint/lib/python2.7/lib-dynload
  /opt/stackless-2.7-maint/lib/python2.7/site-packages 2.7

  Stackless 3.1b3 060516 (release27-maint:85288M, Oct 6 2010, 17:11:34)
  [GCC 4.4.5]

  /opt/stackless-2.7-maint

  /usr/bin/python

  The problem occurs when I uncomment import stackless line. I get an
  Internal Server Error with the following in apache log:

  [Thu Oct 07 15:14:09 2010] [info] [client 127.0.0.1] mod_wsgi
  (pid=6457, process='', application='test_wsgi|/hello_world'):
  Reloading WSGI script 'some path/hello_world.wsgi'.
  [Thu Oct 07 15:14:09 2010] [error] [client 127.0.0.1] mod_wsgi
  (pid=6457): Target WSGI script 'some path/hello_world.wsgi' cannot
  be loaded as Python module.
  [Thu Oct 07 15:14:09 2010] [error] [client 127.0.0.1] mod_wsgi
  (pid=6457): Exception occurred processing WSGI script 'some path/
  hello_world.wsgi'.
  [Thu Oct 07 15:14:09 2010] [error] [client 127.0.0.1] Traceback (most
  recent call last):
  [Thu Oct 07 15:14:09 2010] [error] [client 127.0.0.1]   File some
  path/hello_world.wsgi, line 4, in module
  [Thu Oct 07 15:14:09 2010] [error] [client 127.0.0.1]     import
  stackless
  [Thu Oct 07 15:14:09 2010] [error] [client 127.0.0.1] ImportError: No
  module named stackless

  I don't why the import is not working.

  --
  You received this message because you are subscribed to the Google Groups 
  modwsgi group.
  To post to this group, send email to modw...@googlegroups.com.
  To unsubscribe from this group, send email to 
  modwsgi+unsubscr...@googlegroups.com.
  For more options, visit this group

Re: [modwsgi] Re: mod_wsgi with python stackless

2010-10-07 Thread Carl Nobile
Will your code need to be spawning a lot of threads on its own? Would
a process model do just as well. Guido has not, at least to my
knowledge, approved any way of getting around the GIL issues which
would make me very hesitant to use a fork of Python. I didn't
understand what stackless python was until I did a search for it just
now.

Graham is away and has limited access to the net as he told us a week
or so ago, but I'm sure when he is able to he can comment on this. He
may have ran into this issue before.

I don't think changing Apache's env path will help much matter-of-fact
it may break things. You should be able to do what you need in the
mod_wsgi/apache config.

~Carl

On Thu, Oct 7, 2010 at 11:25 AM, crumble herve.coatan...@gmail.com wrote:
 I have no need for 2.7, what i need is stackless python actually.
 But I assumed having a version number different from system one would
 shed the light on linking errors I would miss otherwise.

 Right now I'm trying to change www-data user's PATH so that apache
 will find the right python executable.

 On 7 oct, 16:56, Carl Nobile carl.nob...@gmail.com wrote:
 It's always easier to work with the version that come with your
 platform, and in production environments that's what we do. There will
 not be enough different between 2.6 and 2.7 to make much difference.
 Is there a reason you need to have a virtual env?

 To get the python executable on the command line for the virtual env
 you will have to add it to your PATH in your .bashrc (assuming you are
 using bash).

 ~Carl



 On Thu, Oct 7, 2010 at 10:37 AM, crumble herve.coatan...@gmail.com wrote:
  As I understand it, /opt/stackless-2.7-maint is my BASELINE
  environment not just a package, the python I run is, /opt/
  stackless-2.7-maint/bin/python. It is no symlink or venv python.

  I thought in that case WSGIPythonHome would be /opt/stackless-2.7-
  maint, any idea what the Python BASELINE environment should be ?

  I guess you're right, I had it configured the wrong way because
  sys.executable gives me /usr/bin/python. Which is weid as /usr/bin/
  python is a vanilla 2.6 python, that comes with Ubuntu.

  --
  Crumble

  On 7 oct, 15:40, Carl Nobile carl.nob...@gmail.com wrote:
  It seems to be that WSGIPythonHome needs to point to your Python
  BASELINE environment not a single package. Any package you need to use
  needs to be in the BASELINE env or added to the env in your wsgi hook
  file. I personally never use WSGIPythonHome as it is generally not
  needed in any of the sites I have built, but it seems from the docs
  that you have it configured wrong.

  ~Carl

  On Thu, Oct 7, 2010 at 9:19 AM, crumble herve.coatan...@gmail.com wrote:
   I managed to compile and install mod_wsgi (3.3) against python 2.7
   stackless using --with-python configure option (I don't have any other
   python2.7 on my machine)

   I'm using Ubuntu 10.10 RC with apache 2.2.16 without mod_python.

   ldd on mod_wsgi.so module gives:

      linux-vdso.so.1 =  (0x7fff94fff000)
      libpython2.7.so.1.0 = /opt/stackless-2.7-maint/lib/
   libpython2.7.so.1.0 (0x7f548f477000)
      libpthread.so.0 = /lib/libpthread.so.0 (0x7f548f25a000)
      libdl.so.2 = /lib/libdl.so.2 (0x7f548f055000)
      libutil.so.1 = /lib/libutil.so.1 (0x7f548ee52000)
      libm.so.6 = /lib/libm.so.6 (0x7f548ebcf000)
      libc.so.6 = /lib/libc.so.6 (0x7f548e84b000)
      /lib64/ld-linux-x86-64.so.2 (0x7f548fad1000)

   As stated in Installation Issue documentation I used WSGIPythonHome
   directive the following way:
   -- apache.conf
   LogLevel info

   WSGIPythonHome /opt/stackless-2.7-maint

   VirtualHost *:80
          ServerName test_wsgi
          WSGIScriptAlias /hello_world some_path/hello_world.wsgi
   /VirtualHost

   Finally, here is my WSGI script
   -- hello_world.wsgi
   import os
   import sys
   #import stackless

   def application(environ, start_response):
      status = '200 OK'
      response_headers = [('Content-type','text/html')]
      start_response(status, response_headers)

      body = html
      body
      %s
      hr
      %s
      hr
      %s
      hr
      %s
      /body
   /html % ('br'.join(sys.path), sys.version, sys.prefix,
   sys.executable)

      return [body]

   At that point everything seems alrighthttp://test_wsgi/hello_world
   giving the following:

   /opt/stackless-2.7-maint/lib/python27.zip
   /opt/stackless-2.7-maint/lib/python2.7
   /opt/stackless-2.7-maint/lib/python2.7/plat-linux2
   /opt/stackless-2.7-maint/lib/python2.7/lib-tk
   /opt/stackless-2.7-maint/lib/python2.7/lib-old
   /opt/stackless-2.7-maint/lib/python2.7/lib-dynload
   /opt/stackless-2.7-maint/lib/python2.7/site-packages 2.7

   Stackless 3.1b3 060516 (release27-maint:85288M, Oct 6 2010, 17:11:34)
   [GCC 4.4.5]

   /opt/stackless-2.7-maint

   /usr/bin/python

   The problem occurs when I uncomment import stackless line. I get an
   Internal Server Error with the following in apache log:

   [Thu

Re: [modwsgi] rename myapp.wsgi to index.wsgi

2010-09-29 Thread Carl Nobile
Remove this line DocumentRoot /home/dev/wsgi-scripts

you don't want anybody getting to your wsgi scripts. I realize this is
your test environment, but it's bad practice.

You need to access the virtual host you setup with the port number on
it. The ip address alone will bring you to whatever is the
DocumentRoot for port 80.

~Carl

On Wed, Sep 29, 2010 at 9:56 AM, nitin chandra nitinchand...@gmail.com wrote:
 sorry my bad ...

 its

 https://192.168.1.6

 Index of /

    * index.wsgi
    * myapp.wsgi-3
    * myapp.wsgi~
    * myapp.wsgi~~

 from browser

 Reg
 Nitin

 On Wed, Sep 29, 2010 at 7:21 PM, nitin chandra nitinchand...@gmail.com 
 wrote:
 and i was typing

 https://192.168.1.6:8081      to access the wsgi script (in html)

 Nitin

 On Wed, Sep 29, 2010 at 7:20 PM, nitin chandra nitinchand...@gmail.com 
 wrote:
 Hi Graham,

 my httpd.conf has the following line (abridged)

 ServerRoot /opt/apache2215
 Listen 192.168.1.6:8081
 LoadModule wsgi_module modules/mod_wsgi.so
 ServerName www.healthcare.in
 DocumentRoot /home/dev/wsgi-scripts

 Directory /
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
 /Directory

 Directory /home/dev/wsgi-scripts
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
 /Directory

 # Virtual hosts
 Include conf/extra/httpd-vhosts.conf

 # Secure (SSL/TLS) connections
 Include conf/extra/httpd-ssl.conf

 IfModule ssl_module
 SSLRandomSeed startup builtin
 SSLRandomSeed connect builtin
 /IfModule


 THIS is httpd-vhost.conf

 NameVirtualHost 192.168.1.6:8081

 VirtualHost 192.168.1.6:8081
    ServerName www.healthcare.in
    ServerAlias healthcare.in

    WSGIDaemonProcess healthcare.in processes=6 threads=15 
 display-name=%{GROUP}
    WSGIProcessGroup healthcare.in

    WSGIScriptAlias / /home/dev/wsgi-scripts/index.wsgi

    Directory /home/dev/wsgi-scripts
       Order allow,deny
       Allow from all
    /Directory
 /VirtualHost


 this is the httpd-ssl.conf

 Listen 192.168.1.6:443

 VirtualHost _default_:443
 DocumentRoot /home/dev/wsgi-scripts
 ServerName www.healthcare.in:443
 ServerAdmin y...@healthcare.in
 ErrorLog /opt/apache2215/logs/error_log
 TransferLog /opt/apache2215/logs/access_log

 SSLEngine on

 SSLCertificateFile /etc/cups/ssl/server.crt
 SSLCertificateKeyFile /etc/cups/ssl/server.key

 ...
 ...
 /VirtualHost

 THIS is my /etc/hosts

 127.0.0.1       localhost
 127.0.1.1       dev-desktop
 192.168.1.6     www.healthcare.in

 The following is  the DIR listing of /home/dev/wsgi-scripts

 d...@dev-desktop:~$ ls -alh wsgi-scripts/
 total 24K
 drwxr-xrwx  2 dev dev 4.0K 2010-09-28 16:23 .
 drwxr-xr-x 46 dev dev 4.0K 2010-09-28 16:58 ..
 -rw-r--rwx  1 dev dev  327 2010-09-03 00:46 index.wsgi
 -rw-r--r-x  1 dev dev  318 2010-09-02 23:32 myapp.wsgi~
 -rw-r--r-x  1 dev dev  316 2010-09-02 19:20 myapp.wsgi~~
 -rwxr-xr-x  1 dev dev  169 2010-09-02 23:35 myapp.wsgi-3
 d...@dev-desktop:~$

 That 'index.wsgi' was earlier 'myapp.wsgi' (which was, earlier, working)

 Nitin



 On Wed, Sep 29, 2010 at 6:50 PM, Graham Dumpleton
 graham.dumple...@gmail.com wrote:
 On Wednesday, September 29, 2010, nitin chandra nitinchand...@gmail.com 
 wrote:
 Hello All,

 I renamed the test wsgi script from 'myapp.wsgi. to index.wsgi' for
 application entry point, it did not load as it did previously, ie.
 Hello World

 Now it shows the dir listing, in which 'index.wsgi' is one of the file 
 listed.

 File permissions are the same.

 And the apache config are same in both the cases.

 How to resolve this ?

 Post the parts of your Apache configuration related to mod_wsgi.

 Need this information to be able to help you.

 Also indicate for that configuration what URL you are using to access
 the site so can see how that matches against the configuration.

 The more information the better, else will need to get out the crystal 
 ball.

 Graham

 Thanks

 Nitin

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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 modw...@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 modw...@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] rename myapp.wsgi to index.wsgi

2010-09-29 Thread Carl Nobile
Other than what I mentioned before I see nothing wrong with your
config Graham may find something I missed. Are you sure you haven't
changed the contents of the index.wsgi file and broke it? Have you
checked the paths leading up to and including your wsgi-scripts dir to
have the execute and read bits set?

~Carl

On Wed, Sep 29, 2010 at 10:52 AM, nitin chandra nitinchand...@gmail.com wrote:
 Thanks Carl,

 but it did not work ...  :(

 Nitin

 On Wed, Sep 29, 2010 at 7:33 PM, Carl Nobile carl.nob...@gmail.com wrote:
 Remove this line DocumentRoot /home/dev/wsgi-scripts

 you don't want anybody getting to your wsgi scripts. I realize this is
 your test environment, but it's bad practice.

 You need to access the virtual host you setup with the port number on
 it. The ip address alone will bring you to whatever is the
 DocumentRoot for port 80.

 ~Carl


 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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.





-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modw...@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] rename myapp.wsgi to index.wsgi

2010-09-29 Thread Carl Nobile
Nitin,

You still need to access the site by using the port.

https://192.168.1.6:8081

Directory /home/dev/wsgi-scripts
   Options Indexes FollowSymLinks
   AllowOverride None
   Order allow,deny
   Allow from all
/Directory

The above should stay as above, because it is what keeps people out of
the wsgi-scripts dir.

I'm not sure that you need AllowOverride None, but everything else is okay.

~Carl

On Wed, Sep 29, 2010 at 2:53 PM, nitin chandra nitinchand...@gmail.com wrote:
 ok ... so i took advice from Carl, and also changed DocumentRoot back
 to '/opt/apache2215/htdocs' and in my enthusiasm went a little extra
 and changed this also to the original, Directory
 /opt/apache2215/htdocs /Directory.

 and renamed index.wsgi to myapp.wsgi and

 https://192.168.1.6

 403 Forbidden

 You don't have permission to access / on this server.

  well need more thinking and analysis. But now the config is now
 the original what it was working 

 and in vhost setting of Alias is back to original

    WSGIScriptAlias / /home/dev/wsgi-scripts/myapp.wsgi


 The following contents have remain the same in both 'index.wsgi' or in
 'myapp.wsgi'

 d...@dev-desktop:~/wsgi-scripts$ cat myapp.wsgi

 def application(environ, start_response):
    status = '200 OK'
    output = 'Hello World!, This file is in /home/dev/wsgi-scripts directory'

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

    return [output]

 d...@dev-desktop:~/wsgi-scripts$

 Any suggestion pl?

 Thanks

 Nitin


 On Wed, Sep 29, 2010 at 9:08 PM, Carl Nobile carl.nob...@gmail.com wrote:
 Other than what I mentioned before I see nothing wrong with your
 config Graham may find something I missed. Are you sure you haven't
 changed the contents of the index.wsgi file and broke it? Have you
 checked the paths leading up to and including your wsgi-scripts dir to
 have the execute and read bits set?

 ~Carl

 On Wed, Sep 29, 2010 at 10:52 AM, nitin chandra nitinchand...@gmail.com 
 wrote:
 Thanks Carl,

 but it did not work ...  :(

 Nitin


 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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.





-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modw...@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] disable mod_wsgi

2010-09-27 Thread Carl Nobile
You need to remove this line from where ever it has been put in your
httpd.conf file then bounce apache.

LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi.so

Can I ask why you are no longer using mod_wsgi?

~Carl

On Mon, Sep 27, 2010 at 5:30 AM, ashy ashwinmo...@gmail.com wrote:
 Hi All,

 I had installed mod_wsgi for python, so as to serve django pages using
 apache. But now I do not want to use mod_wsgi. Is there an option to
 disable mod_wsgi,

 I have removed the following segment from the apache conf file

        WSGIScriptAlias / /home/user/djangoprojects/test/apache/
 django.wsgi

        Directory /home/user/djangoprojects/test
        Order deny,allow
        Allow from all
        /Directory

 But still getting errors in apache error log files.

 [Mon Sep 27 02:06:32 2010] [error] [client 10.1.4.193] Target WSGI
 script not found or unable to stat: /home/user/djangoprojects/test/
 apache

 Any ideas?

 thanks
    ashy

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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.





-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modw...@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: Another sys.path error.

2010-09-27 Thread Carl Nobile
The error you mentioned above is caused by one of two reasons.

1) The settings.py path was never defined in your wsgi file.
2) the settings.py file itself is broken and cannot be loaded even if
the path to it is correct.

The first is easy to fix just add something like this to your wsgi file:

import os

os.environ['DJANGO_SETTINGS_MODULE'] = path.settings

The second problem can be debuged by trying to load the settings file
in the python interpreter manually and track the error from there.

~Carl

On Mon, Sep 27, 2010 at 9:18 AM, safar objorn safar.obj...@gmail.com wrote:
 I know this isn't safe, but I haven't setup groups yet for the www-admin
 user, I just gave everything in my /home/safar/sites/public/ directory 777
 privileges. Also, /home/ehath/sites/public/blog/ should be
 /home/safar/sites/public/blog/, but either way, it doesn't affect anything.

 On Mon, Sep 27, 2010 at 8:11 AM, safar objorn safar.obj...@gmail.com
 wrote:

 I've searched the logs from the mailing list, I went three pages deep
 before deciding to ask for help. It seems there are several other people who
 have experienced this, and I don't want to think mine is any different, but
 I'm not seeing the solution, and I'm hoping someone here can help me.

 This is the error when retrieving attempting to retrieve the page:

 
 (500) Internal Server Error

 The server encountered an internal error or misconfiguration and was
 unable to complete your request.

 Please contact the server administrator, [no address given] and inform
 them of the time the error occurred, and anything you might have done that
 may have caused the error.

 More information about this error may be available in the server error
 log.
 


 This is the error given by /var/log/apache2/error.log:

 
 [Mon Sep 27 07:54:23 2010] [error] [client 127.0.0.1] raise
 ImportError, Could not import settings '%s' (Is it on sys.path? Does it
 have syntax errors?): %s % (self.SETTINGS_MODULE, e)
 [Mon Sep 27 07:54:23 2010] [error] [client 127.0.0.1] ImportError: Could
 not import settings 'blog.settings' (Is it on sys.path? Does it have syntax
 errors?): No module named blog.settings
 


 This is the contents of my /home/safar/sites/public/blog/apache.py file:

 
 import os, sys

 sys.path.append('/home/safar/sites/public')
 os.environ['DJANGO_SETTINGS_MODULE'] = 'blog.settings'
 import django.core.handlers.wsgi
 application = django.core.handlers.wsgi.WSGIHandler()
 


 Contents of my /etc/apache2/sites-available-default file:

 
 VirtualHost *:80

 SetEnv PYTHON_PATH /home/safar/sites/public/

 WSGIScriptAlias / /home/safar/sites/public/blog/apache/django.wsgi

 Alias /media/ /home/safar/sites/public/blog/media/

 Directory /home/ehath/sites/public/blog/
 Order deny,allow
 Allow from all
 /Directory

 Directory /home/safar/sites/public/blog/media/
 Order deny,allow
 Allow from all
 /Directory

 Directory /home/safar/sites/public/blog/apache
 Order deny,allow
 Allow from all
 /Directory

 /VirtualHost
 

 I wasn't so sure the Directory /home/ehath/sites/public/blog/ was
 necessary but I put it in just because nothing else was working, it
 obviously didn't help. Also, I don't think the SetEnv PYTHON_PATH even does
 anything, I was confused when I put that in, I don't think it's necessary
 either since mod_wsgi can specify this. I've removed both and it still
 doesn't work. I hope someone can helpl, and thank you for your time.

 --
 You received this message because you are subscribed to the Google Groups
 modwsgi group.
 To post to this group, send email to modw...@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.




-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modw...@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] What is the license of the code on Wiki pages?

2010-09-25 Thread Carl Nobile
I'm pretty sure you can, Graham is away for a while, but I think I
remember him mentioning once that the code in the docs fall under the
same license as mod_wsgi.

~Carl

2010/9/24 Tomasz Zieliński tom.ziel...@gmail.com:
 Specifically these two:
 http://code.google.com/p/modwsgi/wiki/ReloadingSourceCode
 http://code.google.com/p/modwsgi/wiki/VirtualEnvironments

 Can I treat them as licensed under the same license as mod_wsgi
 itself?

 --
 Tomasz Zielinski

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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.


---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modw...@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] random? server 500 errors

2010-09-25 Thread Carl Nobile
Not all problems will show up in a log file. Probably the first thing
to do is to post your vhost config and the wsgi hook file for this app
so we can see how you're setup.

~Carl

On Sat, Sep 25, 2010 at 4:38 AM, paulhide paul.h...@gmail.com wrote:
 I have a django app that behaves running with a LAMP setup. I noticed
 the django docs now say that mod_wsgi is the way to go. I ran the
 Hello World; no problems. Then followed the config instructions and
 set up the wsgi script to run the django app. Had a few teething
 problems, including generating an 8 megabyte apache error log file.
 Persevered and got a part of the application working.
 Now what happens is that some urls yield the page expected others give
 Server Error 500. I can't see any rhyme or reason to which work and
 which do not.
 Apache is set up to log at the debug level in both apache2.conf and
 the virtual host file, but the log file gives no clues as to what is
 wrong.
 It seems strange to me that this option is now the reccommended one
 since one does not get anything in the way of debug information
 whereas with mod_python you get a pretty good trace back in the apache
 log file.
 Am I missing something obvious?

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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.





-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modw...@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: random? server 500 errors

2010-09-25 Thread Carl Nobile
Yes, the WSGI standard does not allow anything to go to stdout. Good catch.

~Carl

On Sat, Sep 25, 2010 at 12:45 PM, paulhide paul.h...@gmail.com wrote:
 Thank you very much for your reply and before anyone else wastes their
 time I have to own up to having found the rather embarrasing cause of
 the problem.
 1) there was no debug information because I had checked out the
 production version of the django code (debug = False) instead of the
 development version.
 Once I had loaded the development version I found that:
 2) the random? 500 errors were caused by print statements, these are
 ignored by mod_python, but not by mod_wsgi

 Once again thanks for the reply and please excuse the wasted time.

 Paul Hide

 On Sep 25, 4:59 pm, Carl Nobile carl.nob...@gmail.com wrote:
 Not all problems will show up in a log file. Probably the first thing
 to do is to post your vhost config and the wsgi hook file for this app
 so we can see how you're setup.

 ~Carl



 On Sat, Sep 25, 2010 at 4:38 AM, paulhide paul.h...@gmail.com wrote:
  I have a django app that behaves running with a LAMP setup. I noticed
  the django docs now say that mod_wsgi is the way to go. I ran the
  Hello World; no problems. Then followed the config instructions and
  set up the wsgi script to run the django app. Had a few teething
  problems, including generating an 8 megabyte apache error log file.
  Persevered and got a part of the application working.
  Now what happens is that some urls yield the page expected others give
  Server Error 500. I can't see any rhyme or reason to which work and
  which do not.
  Apache is set up to log at the debug level in both apache2.conf and
  the virtual host file, but the log file gives no clues as to what is
  wrong.
  It seems strange to me that this option is now the reccommended one
  since one does not get anything in the way of debug information
  whereas with mod_python you get a pretty good trace back in the apache
  log file.
  Am I missing something obvious?

  --
  You received this message because you are subscribed to the Google Groups 
  modwsgi group.
  To post to this group, send email to modw...@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.

 --
 ---
 Carl J. Nobile (Software Engineer)
 carl.nob...@gmail.com
 ---

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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.





-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modw...@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: High CPU load for simple django view

2010-09-22 Thread Carl Nobile
Yes you can, mod_wsgi is what creates the daemons and threads not
apache in this case.

~Carl

On Wed, Sep 22, 2010 at 2:48 AM, litterbug brianggro...@gmail.com wrote:
 The issue was that I had inadvertently installed the package apache2-
 mpm-itk instead of apache2-mpm-prefork. apache2-mpm-itk is derived
 from apache2-mpm-prefork, but for some reason, didn't perform well
 when used with mod_wsgi.

 I'm still curious if, when using prefork MPM, I can still run
 multithreaded wsgi (ie processes=1 threads=10)?

 Thanks!
 Brian



 On Sep 21, 2:04 pm, litterbug brianggro...@gmail.com wrote:
 I appreciate the feedback.  I've tried the hello world wsgi program,
 with similar results:

 Using an apache bench concurrency value of 10 (ab -c 10 -n 1
 my_url), I'm still seeing load CPU loads (with top and uptime) above
 3 and 0% idle time (with MaxClients = 3, and processes=3 threads=1)

 I've established that as expected, setting MaxClients = 10, and
 processes=10 threads=1 causes CPU Load to skyrocket, up to 9.  I'm
 running 1 requests, so I'm not just seeing the initial startup CPU
 spike.

 Questions:

 1)Are these simply the result I should expect with an AWS small
 instance (1.7 GB memory, 1 virtual core which according to Amazon is
 1.0-1.2 GHz 2007 Opteron or 2007 Xeon processor) ?

 2)Am I banging on my server too hard? I know it's all about expected
 traffic, but is my apache bench test an unrealistic baseline?

 3)I'm using prefork MPM since apache is also running php, which
 doesn't work with worker MPM.  With prefork MPM, can I still run
 multithreaded wsgi (ie processes=1 threads=10)?  Uncertain if they're
 independent.  In any case, I'm seeing similar results when I try.

 Other ideas?  I'm going to clone my AWS instance in the odd chance
 it's a hardware issue, and also try a large instance to see relative
 performance.

 Thanks,
 Brian

 On Sep 20, 6:18 pm, Graham Dumpleton graham.dumple...@gmail.com
 wrote:

  On 21 September 2010 10:35, litterbug brianggro...@gmail.com wrote:

   Hi -

   I'm load testing a django 1.21/apache (prefork)/mod_wsgi (daemon)
   configuration on an AWS small instance (ubuntu 10.04) with apache
   bench, and seeing extremely high CPU load (using uptime and vmstat) at
   low concurrent requests. Note that I'm using a trivial out-of-box
   django project/app with a simple hello world view (no DBs, etc).

   CPU is at 100% even with an apache bench concurrency value of 2. I'm
   running apache bench from a different AWS instance in the same region/
   zone. Ideas on what's the problem, or how I should continue to debug
   this?

   I'm running mod_wsgi version 2.8-2ubuntu1, since that's what apt-get
   gave me, but I can manually compile if recommended.

   I believe my mod_wsgi config is at fault, since CPU looks fine (almost
   idle) when running against a django dev server. Also, CPU looks fine
   running against a static file served by apache (ie. no django).

   Many more details (including config files) in my serverfault post at
  http://serverfault.com/questions/182672/high-cpu-load-on-django-apach...
   if useful.

  Benchmark it with a WSGI hello world script and see whether that
  behaves normally.

  Your MPM settings are bit broken as well. You have:

  StartServers 2
  MinSpareServers 2
  MaxSpareServers 5
  MaxClients 50
  MaxRequestsPerChild 3000
  ServerLimit 8
  Keepalive off
  HostnameLookups Off

  You have said MaxClients should be 50, yet ServerLimit of 8 means that
  MaxClients will actually be 8. So, not even enough capacity to proxy
  as many as 10 requests to use all daemon processes at once.

  If your Django application is thread safe, would also recommend not
  using multiple single threaded processes, but a single multithreaded
  process instead.

  By using multiple single threaded processes, you are likely seeing the
  startup cost of loading Django and initialising each instance when you
  are doing the testing.

  Suggest at least drop number of daemon processes down to 3. Even that
  will likely still manage to handle adequate requests and you avoid
  start up costs on extra processes you do not need.

   Of note, I'm seeing this in my apache logs:
   [Sun Sep 19 18:04:58 2010] [error] Exception KeyError:
   KeyError(-1218693376,) in module 'threading' from '/usr/lib/python2.6/
   threading.pyc' ignored

  You can ignore it as warning only. Eliminated in mod_wsgi 3.X.

  Graham



 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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.





-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---


Re: [modwsgi] Re: URL displaying plaintext version of .wsgi application file instead of running application file

2010-09-02 Thread Carl Nobile
The reason it did not work in the default file is because you have
more that one virtual host. In this case you need to make a separate
file for each vhost and put them in the sites-available directory and
symlink them to the sites-enabled directory. In this way you have a
different config file for each virtual host. Until now I didn't know
you had more than one virtual host on the box. Sorry maybe I missed an
earlier comment by you, but this is critical information.

I would also recommend you use daemon mode or you will have conflicts
with other hosts on the system.

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

There is an example of how to use daemon mode in the above link.

~Carl

On Thu, Sep 2, 2010 at 11:54 AM, V nu.vs...@gmail.com wrote:
 Hi Graham,

 I'm sorry for the late response. I actually responded to your August
 31 7:13 p.m. message twice, but it seems like it hasn't shown up.

 I originally put my WSGIScriptAlias in httpd.conf, but at Carl's
 suggestion I moved it to /etc/apache2/sites-available/default. Since
 that didn't work, I put it back in httpd.conf.  The WSGIScriptAlias is
 hosted on a virtual host and I do have more than one.

 THe URLs that I have that work by modifying httpd.conf are http://p.ly/L7Qc9
 and http://p.ly/jLsd. The URL that doesn't work (it's not mentioned in
 httpd.conf, but I did modify /etc/apache2/sites-available/default as
 Carl suggested) is http://p.ly/Soa05.

 I know I'm not supposed to be modifying httpd.conf, but if it is
 working now, should I still try to change it?

 On Sep 1, 8:10 pm, Graham Dumpleton graham.dumple...@gmail.com
 wrote:
 On Wednesday, September 1, 2010, V nu.vs...@gmail.com wrote:
  Carl,

  Thank you for showing me another example. However, when I modify the /
  etc/apache2/sites-enabled/default file with the changes you suggested
  (not including the typo, which I think I fixed), I get a page not
  found message. So far, the only way I've been able to run the example
  script has been by modifying httpd.conf as I described in the first
  message in this thread.

  Is there another step that I'm missing?

 You need to provide more information about your Apache configuration.
 Where are you putting the WSGIScriptAlias? Is it in a VirtualHost? Do
 you have more than one virtual host?

 If you have more than one, your request could be going to different
 virtual host.

 So suggest posting more about any virtual host configurations.

 Also need to know exactly what URL you are using in browser.

 Graham



  On Aug 31, 4:41 pm, Carl Nobile carl.nob...@gmail.com wrote:
  Once again don't put anything in the httpd.conf or apache2.conf on Ubuntu.

  Look in the /etc/apache2/sites-available/ directory. You should see a
  file named default this file will be symlinked to
  /etc/apache2/sites-enabled/. If you are only testing and are not
  working on production code you can put your mod_wsgi config in the
  default file. Add something like this:

  WSGIScriptAlias /myapps /var/www/wsgi-scripts/example.wsgi
  Directory /var/www/wsgi-scripts
    Order allow,deny
    Allow from all
  /Directory

  When you want to write production code you will need a more
  complicated config that the above, but this should get you working.

  ~Carl

  On Tue, Aug 31, 2010 at 4:17 PM, V nu.vs...@gmail.com wrote:
   I installed and am currently configuring mod_wsgi on Ubuntu. I
   followed the directions in the Quick Configuration Guide to add the
   line WSGIScriptAlias /myapp /var/www/wsgi-scripts/example.wsgi to /
   etc/apache2/httpd.conf, and also added:

   Directory /var/www/wsgi-scripts
   Order allow,deny
   Allow from all
   /Directory

   but when I go to the specified URL, I just see a plaintext version of
   the code from the test application file example.wsgi. It's like I'm
   viewing the source for the page, on the page. Any suggestions on how I
   might properly configure mod_wsgi would be greatly appreciated.

   --
   You received this message because you are subscribed to the Google 
   Groups modwsgi group.
   To post to this group, send email to modw...@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.

  --
  ---
   
  Carl J. Nobile (Software Engineer)
  carl.nob...@gmail.com
  ---
   

  --
  You received this message because you are subscribed to the Google Groups 
  modwsgi group.
  To post to this group, send email to modw...@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

Re: [modwsgi] Re: URL displaying plaintext version of .wsgi application file instead of running application file

2010-09-01 Thread Carl Nobile
Here are a few thing you can check.

1) Are the directories and files set to a user/group that apache can
read and write to?
2) Are the permissions on the entire tree leading up to your WSGI
script set to read and exec by apache?

What does your WSGI script look like? Please post.

~Carl

On Wed, Sep 1, 2010 at 9:25 AM, V nu.vs...@gmail.com wrote:
 Carl,

 Thank you for showing me another example. However, when I modify the /
 etc/apache2/sites-enabled/default file with the changes you suggested
 (not including the typo, which I think I fixed), I get a page not
 found message. So far, the only way I've been able to run the example
 script has been by modifying httpd.conf as I described in the first
 message in this thread.

 Is there another step that I'm missing?

 On Aug 31, 4:41 pm, Carl Nobile carl.nob...@gmail.com wrote:
 Once again don't put anything in the httpd.conf or apache2.conf on Ubuntu.

 Look in the /etc/apache2/sites-available/ directory. You should see a
 file named default this file will be symlinked to
 /etc/apache2/sites-enabled/. If you are only testing and are not
 working on production code you can put your mod_wsgi config in the
 default file. Add something like this:

 WSGIScriptAlias /myapp /var/www/wsgi-scripts/example.wsgi
 Directory /var/www/wsgi-scripts
   Order allow,deny
   Allow from all
 /Directory

 When you want to write production code you will need a more
 complicated config that the above, but this should get you working.

 ~Carl





 On Tue, Aug 31, 2010 at 4:17 PM, V nu.vs...@gmail.com wrote:
  I installed and am currently configuring mod_wsgi on Ubuntu. I
  followed the directions in the Quick Configuration Guide to add the
  line WSGIScriptAlias /myapp /var/www/wsgi-scripts/example.wsgi to /
  etc/apache2/httpd.conf, and also added:

  Directory /var/www/wsgi-scripts
  Order allow,deny
  Allow from all
  /Directory

  but when I go to the specified URL, I just see a plaintext version of
  the code from the test application file example.wsgi. It's like I'm
  viewing the source for the page, on the page. Any suggestions on how I
  might properly configure mod_wsgi would be greatly appreciated.

  --
  You received this message because you are subscribed to the Google Groups 
  modwsgi group.
  To post to this group, send email to modw...@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.

 --
 --- 
 
 Carl J. Nobile (Software Engineer)
 carl.nob...@gmail.com
 --- 
 

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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.





-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modw...@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: URL displaying plaintext version of .wsgi application file instead of running application file

2010-09-01 Thread Carl Nobile
In the path you are using you would see this when doing an ls -ld on
each directory down your tree.

$ ls -ld /var/
drwxr-xr-x 17 root root 4096 2010-05-26 13:44 /var/
$ ls -ld /var/www/
drwxr-xr-x 2 www-data www-data 23 2010-08-20 14:16 /var/www/

I don't have your exact tree so I cannot go any further, but you will
see the owner and groups are both www-data for anything including and
below the /var/www directory (directory trees go down from root '/').
The permissions are drwxr-xr-x for directories and the permissions for
a file will be different as in -rw-r--r--. If you see anything
different you may need to fix it depending on what you are seeing.
There are a few variations that would work and some that will not work
properly.

This is really very basic UNIX admin knowledge here. I would suggest
picking up a book on UNIX/Linux admin,  you will need it when doing
anything at all.

~Carl

On Wed, Sep 1, 2010 at 1:41 PM, V nu.vs...@gmail.com wrote:
 Could you explain how I would check for both things on your list?

 My WSGI script is the one from the Quick Configuration Guide:

 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)

    return [output]

 On Sep 1, 9:55 am, Carl Nobile carl.nob...@gmail.com wrote:
 Here are a few thing you can check.

 1) Are the directories and files set to a user/group that apache can
 read and write to?
 2) Are the permissions on the entire tree leading up to your WSGI
 script set to read and exec by apache?

 What does your WSGI script look like? Please post.

 ~Carl





 On Wed, Sep 1, 2010 at 9:25 AM, V nu.vs...@gmail.com wrote:
  Carl,

  Thank you for showing me another example. However, when I modify the /
  etc/apache2/sites-enabled/default file with the changes you suggested
  (not including the typo, which I think I fixed), I get a page not
  found message. So far, the only way I've been able to run the example
  script has been by modifying httpd.conf as I described in the first
  message in this thread.

  Is there another step that I'm missing?

  On Aug 31, 4:41 pm, Carl Nobile carl.nob...@gmail.com wrote:
  Once again don't put anything in the httpd.conf or apache2.conf on Ubuntu.

  Look in the /etc/apache2/sites-available/ directory. You should see a
  file named default this file will be symlinked to
  /etc/apache2/sites-enabled/. If you are only testing and are not
  working on production code you can put your mod_wsgi config in the
  default file. Add something like this:

  WSGIScriptAlias /myapp /var/www/wsgi-scripts/example.wsgi
  Directory /var/www/wsgi-scripts
    Order allow,deny
    Allow from all
  /Directory

  When you want to write production code you will need a more
  complicated config that the above, but this should get you working.

  ~Carl

  On Tue, Aug 31, 2010 at 4:17 PM, V nu.vs...@gmail.com wrote:
   I installed and am currently configuring mod_wsgi on Ubuntu. I
   followed the directions in the Quick Configuration Guide to add the
   line WSGIScriptAlias /myapp /var/www/wsgi-scripts/example.wsgi to /
   etc/apache2/httpd.conf, and also added:

   Directory /var/www/wsgi-scripts
   Order allow,deny
   Allow from all
   /Directory

   but when I go to the specified URL, I just see a plaintext version of
   the code from the test application file example.wsgi. It's like I'm
   viewing the source for the page, on the page. Any suggestions on how I
   might properly configure mod_wsgi would be greatly appreciated.

   --
   You received this message because you are subscribed to the Google 
   Groups modwsgi group.
   To post to this group, send email to modw...@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.

  --
  ---
   
  Carl J. Nobile (Software Engineer)
  carl.nob...@gmail.com
  ---
   

  --
  You received this message because you are subscribed to the Google Groups 
  modwsgi group.
  To post to this group, send email to modw...@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.

 --
 --- 
 
 Carl J. Nobile (Software Engineer)
 carl.nob...@gmail.com
 --- 
 

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@googlegroups.com.
 To unsubscribe from

Re: [modwsgi] configuration issues with LoadModule wsgi-module mod_wsgi.so

2010-08-31 Thread Carl Nobile
On Ubuntu don't put anything in your httpd.conf or apache2.conf files.
Ubuntu does thing differently. Make a file called mod_wsgi.load and do
the following:

Assuming you are in root and you have already installed mod_wsgi.

# cd /etc/apache2/mods-available/
# nano mod_wsgi.load

With this single line in it.

LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi.so

Then:

# cd /etc/apache2/mods-enabled/
# ln -s ../mods-available/mod_wsgi.load
# service apache2 restart

Done

~Carl

On Tue, Aug 31, 2010 at 9:09 AM, V nu.vs...@gmail.com wrote:
 Hi,

 I successfully installed mod_wsgi on Ubuntu and am having some issues
 with configuration. I have added the line LoadModule wsgi-module /usr/
 lib/apache2/modules/mod_wsgi.so into /etc/apache2/httpd.conf. When I
 restart the Apache server using /etc/init.d/apache2 stop and /etc/
 init.d/apache2 start, I get this message:

  * Starting web server apache2
 [Tue Aug 31 12:58:33 2010] [warn] module wsgi_module is already
 loaded, skipping
 apache2: Syntax error on line 207 of /etc/apache2/apache2.conf: Syntax
 error on line 3 of /etc/apache2/httpd.conf: Can't locate API module
 structure `wsgi-module' in file /usr/lib/apache2/modules/mod_wsgi.so: /
 usr/lib/apache2/modules/mod_wsgi.so: undefined symbol: wsgi-module
   ...fail!

 How can I make sure symbol: wsgi-module is defined? Any suggestions
 would be greatly appreciated.

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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.





-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modw...@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: configuration issues with LoadModule wsgi-module mod_wsgi.so

2010-08-31 Thread Carl Nobile
Great, good luck.

~Carl

On Tue, Aug 31, 2010 at 10:26 AM, V nu.vs...@gmail.com wrote:
 It worked. Thank you so much, Carl!

 On Aug 31, 10:04 am, Carl Nobile carl.nob...@gmail.com wrote:
 On Ubuntu don't put anything in your httpd.conf or apache2.conf files.
 Ubuntu does thing differently. Make a file called mod_wsgi.load and do
 the following:

 Assuming you are in root and you have already installed mod_wsgi.

 # cd /etc/apache2/mods-available/
 # nano mod_wsgi.load

 With this single line in it.

 LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi.so

 Then:

 # cd /etc/apache2/mods-enabled/
 # ln -s ../mods-available/mod_wsgi.load
 # service apache2 restart

 Done

 ~Carl





 On Tue, Aug 31, 2010 at 9:09 AM, V nu.vs...@gmail.com wrote:
  Hi,

  I successfully installed mod_wsgi on Ubuntu and am having some issues
  with configuration. I have added the line LoadModule wsgi-module /usr/
  lib/apache2/modules/mod_wsgi.so into /etc/apache2/httpd.conf. When I
  restart the Apache server using /etc/init.d/apache2 stop and /etc/
  init.d/apache2 start, I get this message:

   * Starting web server apache2
  [Tue Aug 31 12:58:33 2010] [warn] module wsgi_module is already
  loaded, skipping
  apache2: Syntax error on line 207 of /etc/apache2/apache2.conf: Syntax
  error on line 3 of /etc/apache2/httpd.conf: Can't locate API module
  structure `wsgi-module' in file /usr/lib/apache2/modules/mod_wsgi.so: /
  usr/lib/apache2/modules/mod_wsgi.so: undefined symbol: wsgi-module
    ...fail!

  How can I make sure symbol: wsgi-module is defined? Any suggestions
  would be greatly appreciated.

  --
  You received this message because you are subscribed to the Google Groups 
  modwsgi group.
  To post to this group, send email to modw...@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.

 --
 --- 
 
 Carl J. Nobile (Software Engineer)
 carl.nob...@gmail.com
 --- 
 

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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.





-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modw...@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] URL displaying plaintext version of .wsgi application file instead of running application file

2010-08-31 Thread Carl Nobile
Once again don't put anything in the httpd.conf or apache2.conf on Ubuntu.

Look in the /etc/apache2/sites-available/ directory. You should see a
file named default this file will be symlinked to
/etc/apache2/sites-enabled/. If you are only testing and are not
working on production code you can put your mod_wsgi config in the
default file. Add something like this:

WSGIScriptAlias /myapps /var/www/wsgi-scripts/example.wsgi
Directory /var/www/wsgi-scripts
  Order allow,deny
  Allow from all
/Directory

When you want to write production code you will need a more
complicated config that the above, but this should get you working.

~Carl

On Tue, Aug 31, 2010 at 4:17 PM, V nu.vs...@gmail.com wrote:
 I installed and am currently configuring mod_wsgi on Ubuntu. I
 followed the directions in the Quick Configuration Guide to add the
 line WSGIScriptAlias /myapp /var/www/wsgi-scripts/example.wsgi to /
 etc/apache2/httpd.conf, and also added:

 Directory /var/www/wsgi-scripts
 Order allow,deny
 Allow from all
 /Directory

 but when I go to the specified URL, I just see a plaintext version of
 the code from the test application file example.wsgi. It's like I'm
 viewing the source for the page, on the page. Any suggestions on how I
 might properly configure mod_wsgi would be greatly appreciated.

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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.





-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modw...@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: URL displaying plaintext version of .wsgi application file instead of running application file

2010-08-31 Thread Carl Nobile
I always try to portray the principles involved the details are really
unimportant, what I typed was a typo not intentional, sorry.

On Tue, Aug 31, 2010 at 7:13 PM, Graham Dumpleton
graham.dumple...@gmail.com wrote:
 On 1 September 2010 06:40, V nu.vs...@gmail.com wrote:
 I just realized that instead of going to the URL ending in /
 example.wsgi I should have just ended it with /example. I'm sorry to
 have inconvenienced you.

 Actually, based on what configuration your mail said you had, it
 should have been '/myapp'.

 FWIW. It is always very important to quote the exact configuration you
 are using and specify the actual URL you are using when making a
 request when asking about problems. This helps identify issues
 quicker. So many times in the past people have changed the
 configuration when posting as they were worried about revealing some
 aspect of how they have set it up over security concerns. All it does
 it make it much harder to debug as you sometimes the modified version
 is correct, but their original is still wrong. :-(

 Graham

 On Aug 31, 4:17 pm, V nu.vs...@gmail.com wrote:
 I installed and am currently configuring mod_wsgi on Ubuntu. I
 followed the directions in the Quick Configuration Guide to add the
 line WSGIScriptAlias /myapp /var/www/wsgi-scripts/example.wsgi to /
 etc/apache2/httpd.conf, and also added:

 Directory /var/www/wsgi-scripts
 Order allow,deny
 Allow from all
 /Directory

 but when I go to the specified URL, I just see a plaintext version of
 the code from the test application file example.wsgi. It's like I'm
 viewing the source for the page, on the page. Any suggestions on how I
 might properly configure mod_wsgi would be greatly appreciated.

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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 modw...@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.





-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modw...@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] Switching from mod_python to mod_wsgi

2010-08-29 Thread Carl Nobile
Hi Krishnan,

It is best to read the docs as mod_python and mod_wsgi are very
different in operation.  As Graham says read the PEP-0333 WSGI spec
first. Mod_wsgi is much easier to write for than mod_python, but
converting your code to mod_wsgi is not straight forward. You should
find however, that rethinking your application for mod_wsgi is the
best way to go and easier that a straight conversion from mod_python.
The link below takes you the the docs.

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

~Carl

On Sun, Aug 29, 2010 at 11:33 AM, krishnan m tcekrishnan...@gmail.com wrote:

 Hi all,

   I have written web interfaces under mod_python.Now i want to
 switch over to mod_wsgi standard.Then what are all the possible changes
 occur between those to standards.Thanks.

 --
 Work with Passion will always yields Success

 --
 You received this message because you are subscribed to the Google Groups
 modwsgi group.
 To post to this group, send email to modw...@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.




-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modw...@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: Silly question

2010-08-06 Thread Carl Nobile
The built in web server in Django has issues. If you write your code
to work only with the built in server it may not work correctly when
you need to go to production. Djangos web server does a lot of setup
for you completely hidden from your eyes, and may not work without
some fiddling when you go to mod_wsgi/apache. My rule of thumb is if
you are writing code that will eventually see the light of day in a
production environment then setup the WSGI stuff first and develop in
a real mod_wsgi/apache environment so there will not be any surprises
when you go live.

~Carl

On Fri, Aug 6, 2010 at 8:17 AM, jujule julien.bouquil...@gmail.com wrote:
 Hi

 For developing with django you should use the builtin dev server which
 auto reload source code.

 python manage.py runserver 0.0.0.0:4242


 On 1 juil, 12:39, Marian Bucur mariantheb...@gmail.com wrote:
 Hey Rob,

 No, I haven`t tried that script yet, but if you say it`s fast, then
 I`m gonna try it.

 Thank you guys for the suggestions

 On Jun 29, 11:13 pm, Rob Yates ryates...@gmail.com wrote:



  On 6/29/10 4:08 PM, Marian Bucur wrote: I am on Windows...

   One way or another, it`s still an Apache restart and still time
   consuming...
   Too bad there`s no fast way :(

  Marian,
  Have you tried the monitor script as Graham suggested?  I use it for
  development and I'm quite happy with it.  I don't even have to touch the
  .wsgi file anymore - the process restart is automatic and fast.

  -Rob

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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.





-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modw...@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] running wsgi script on server apache without mod_wsgi

2010-07-10 Thread Carl Nobile
You can not have mod_python and mod_wsgi running on the same server
without running into a lot of issues.

~Carl

On Sat, Jul 10, 2010 at 6:43 AM, Gelonida gelon...@gmail.com wrote:
 Hi,


 I'm working on a few .wsgi scripts, which shall be running on a few
 different servers.

 All but one suport mod_wsgi.
 The last one supports only mod_python.

 Is there any trick, such, that I can run my wsgi scripts on this server?

 Would the penalty be huge?

 TIA

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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.





-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modw...@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] Serving single app from Django

2010-07-07 Thread Carl Nobile
Ben is right this is something you need to setup correctly in your
django urls.py file. Each group of urls referring to one app in this
file would need to have a separate line in the INSTALLED_APPS var in
the settings.py file. You can put separate urls.py files in each app
and have them referenced in the root urls.py file to keep things
separate. Look at the Django doc on how to do all this. The only URL
that would be in the apache conf would be the one to the mod_wsgi hook
file which should be the same for all the django apps in your project.

~Carl

On Wed, Jul 7, 2010 at 5:00 PM, Ben Timby bti...@gmail.com wrote:
 This is really more of a Django question. What you want to do is
 disable the unwanted apps.

 First remove them from INSTALLED_APPS in settings.py, then remove
 their URL mappings from urls.py.

 Otherwise, you can use apache to restrict access to these locations
 using Limit statements, if you want them accessible only to certain
 users etc.

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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.





-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modw...@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] Forms

2010-07-06 Thread Carl Nobile
 you will need to do a bit of extra setup
 to tell it where stuff installed. For that, see my talk slides and
 video as mentioned at:

  http://groups.google.com/group/modwsgi/browse_frm/thread/119ca215ee86888

 Will save me a lot of trouble explaining it.

 Graham

 The problem I've seen with readings on UNIX shells and the like is
 that they are filled with jargon rather than english that a beginner
 can understand.

 Thanks again,

 Bradley


 On Mon, Jul 5, 2010 at 10:08 PM, Graham Dumpleton
 graham.dumple...@gmail.com wrote:
 On 6 July 2010 11:51, Bradley Hintze bradle...@aggiemail.usu.edu 
 wrote:
 Carl,

 What do you mean by

 'It needs to be put in your path. This is usually done by sourcing a
 shell script before you start working.'

 On a UNIX system, it means that the directory containing any
 executable programs you want to be able to run must appear in the PATH
 environment variable.

 The PATH environment variable is consulted by your shell to find
 executables without you needing to give an absolute path name.

 For example, on my system I have:

 $ echo $PATH
 /Users/grahamd/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin

 As is, django-admin.py isn't in my default path. Ie.,

 $ which django-admin.py

 returns nothing.

 Now, if for example django-admin.py was in:

  /Library/Python/2.6/site-packages/Django-1.2/django/bin

 then this directory would need to be added into the PATH environment
 variable. For example:

  PATH=/Library/Python/2.6/site-packages/Django-1.2/django/bin:$PATH

 You could do this by hand, by having it in a special script which you
 source, or be part of your account login scripts (.bashrc for bash
 shell).

 In the case of a virtual environment, the 'django-admin.py' command is
 actually likely to be in the 'bin' directory of the virtual
 environment. Further, the virtual environment supplies an 'activate'
 script which will extend the PATH variable, as well as doing other
 stuff, to list that bin directory in your PATH. To use that activate
 script you 'source' it. Eg for modern shells one can say:

  source myenv/bin/activate

 This should give you a bit of an idea. I suggest you now do some
 reading on UNIX shells, the role of the PATH environment variable and
 the 'source' command in the shell.

 If instead you are on Windows, then sorry, but someone else will need
 to explain that one.

 Graham

 

 Thanks,
 Bradley

 On Fri, Jun 25, 2010 at 5:33 PM, Carl Nobile carl.nob...@gmail.com 
 wrote:
 django-admin.py is in Django-x.x.x/django/bin after expanding the
 zip/tarball, etc.

 It needs to be put in your path. This is usually done by sourcing a
 shell script before you start working. If you are using windows you
 will need to put it permanently in your path.

 ~Carl

 On Fri, Jun 25, 2010 at 4:37 PM, Bradley Hintze
 bradle...@aggiemail.usu.edu wrote:
 Your right in avoiding Django. I installed it and can't follow their
 tutorial because django-admin.py is no where on my machine. haha
 Pylons it is I guess.

 On Fri, Jun 25, 2010 at 3:38 PM, Raoul Snyman 
 raoul.sny...@gmail.com wrote:
 On 25 June 2010 20:59, Bradley Hintze bradle...@aggiemail.usu.edu 
 wrote:
 I just talked to him. He just doesn't know about python frameworks.
 What frame work would you (and all reading this) recommend? 
 Preferably
 one with a startup tutorial that doesn't requie a degree in CS.

 Personally, I use Pylons[0]. It's not one of those do everything
 under the sun frameworks, it is more geared towards providing you
 with a smaller, more flexible platform to work on, but it does mean
 that you might need to write a bit more boilerplate code. If you 
 would
 prefer a system that comes with the kitchen sink included, you can
 look at Django[1] or TurboGears 2.x[2]. Another, even simpler and 
 less
 structured than Pylons WSGI framework is Werkzeug[3].

 Personally I steer clear of Django because it's inflexible, 
 TurboGears
 because I have to write too much in places where I would expect it 
 to
 just work, and Werkzeug because it is not structured enough for me.
 Each framework has it's own pro's and cons.

 [0] http://pylonshq.com/
 [1] http://www.djangoproject.com/
 [2] http://turbogears.org/
 [3] http://dev.pocoo.org/projects/werkzeug/

 --
 Raoul Snyman
 B.Tech Information Technology (Software Engineering)
 E-Mail:   raoul.sny...@gmail.com
 Web:      http://www.saturnlaboratories.co.za/
 Blog:      http://blog.saturnlaboratories.co.za/
 Mobile:   082 550 3754
 Registered Linux User #333298 (http://counter.li.org)

 --
 You received this message because you are subscribed to the Google 
 Groups modwsgi group.
 To post to this group, send email to modw...@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.





 --
 Bradley J. Hintze
 Graduate Student
 Duke University
 School of Medicine
 801-712-8799

 --
 You received

Re: [modwsgi] Forms

2010-07-05 Thread Carl Nobile
The sourced shell script is was talking about would be something like this:

 $ cat setup_settings
PROJECT=inventory
SITE=inventory
DJANGO_APPS=${HOME}/dev/django_apps/apps
DJANGO_HOME=${DJANGO_APPS}/${PROJECT}
DJANGO_PATH=${DJANGO_HOME}/django/bin
export PATH=${DJANGO_PATH}:${PATH}
export PYTHONPATH=${DJANGO_HOME}:${DJANGO_APPS}/site-packages
export DJANGO_SETTINGS_MODULE=${SITE}.settings
unset DJANGO_HOME
unset DJANGO_PATH
unset DJANGO_APPS

The above is for a yet to be published open source inventory
application I am writing. It should be put in the route or your
project (see below) and adjust the path to your liking. You would run
this like so:

$ . setup_settings
or
$ source setup_settings

There is a space between the dot and the script. This is Linux/UNIX
only like I said with windows you need to put the proper path into
your system path manually. The Mac will be the same as Linux in this
case.

I run a variation of this script just before I do any work on a Django
project. Without something like this you won't be able to do much. In
the above and below examples the PROJECT and SITE have the same
meaning. I tend to use the same name for both, but they don't need to
be. The above script will work as is with the below directory layout.
This script is only used while you are working on your project it has
nothing to do with mod_wsgi or anything running in a production
environment.

My project layout follows the path tree below:

# |-- Django-x.x.x  (BASE_DJANGO_PATH)
# `-- apps  (BASE_PACKAGE_PATH)
# |-- site-packages  (SITE_PACKAGES)
# `-- project  (BASE_SITE_PATH)
# |-- db
# |-- logs
# |-- apache  (APACHE_CONF)
# |   |-- app.wsgi
# |   `-- project.conf
# `-- site
# |--__init__.py
# |--settings.py
# |--urls.py
# '-- app
# |--views.py
# |--models.py
# `--tests.py

Using the above layout lets you have many projects all using the same
Django code. You just start a new project in the apps dir.

I hope this helps.

~Carl


On Mon, Jul 5, 2010 at 9:51 PM, Bradley Hintze
bradle...@aggiemail.usu.edu wrote:
 Carl,

 What do you mean by

 'It needs to be put in your path. This is usually done by sourcing a
 shell script before you start working.'

 

 Thanks,
 Bradley

 On Fri, Jun 25, 2010 at 5:33 PM, Carl Nobile carl.nob...@gmail.com wrote:
 django-admin.py is in Django-x.x.x/django/bin after expanding the
 zip/tarball, etc.

 It needs to be put in your path. This is usually done by sourcing a
 shell script before you start working. If you are using windows you
 will need to put it permanently in your path.

 ~Carl

 On Fri, Jun 25, 2010 at 4:37 PM, Bradley Hintze
 bradle...@aggiemail.usu.edu wrote:
 Your right in avoiding Django. I installed it and can't follow their
 tutorial because django-admin.py is no where on my machine. haha
 Pylons it is I guess.

 On Fri, Jun 25, 2010 at 3:38 PM, Raoul Snyman raoul.sny...@gmail.com 
 wrote:
 On 25 June 2010 20:59, Bradley Hintze bradle...@aggiemail.usu.edu wrote:
 I just talked to him. He just doesn't know about python frameworks.
 What frame work would you (and all reading this) recommend? Preferably
 one with a startup tutorial that doesn't requie a degree in CS.

 Personally, I use Pylons[0]. It's not one of those do everything
 under the sun frameworks, it is more geared towards providing you
 with a smaller, more flexible platform to work on, but it does mean
 that you might need to write a bit more boilerplate code. If you would
 prefer a system that comes with the kitchen sink included, you can
 look at Django[1] or TurboGears 2.x[2]. Another, even simpler and less
 structured than Pylons WSGI framework is Werkzeug[3].

 Personally I steer clear of Django because it's inflexible, TurboGears
 because I have to write too much in places where I would expect it to
 just work, and Werkzeug because it is not structured enough for me.
 Each framework has it's own pro's and cons.

 [0] http://pylonshq.com/
 [1] http://www.djangoproject.com/
 [2] http://turbogears.org/
 [3] http://dev.pocoo.org/projects/werkzeug/

 --
 Raoul Snyman
 B.Tech Information Technology (Software Engineering)
 E-Mail:   raoul.sny...@gmail.com
 Web:      http://www.saturnlaboratories.co.za/
 Blog:      http://blog.saturnlaboratories.co.za/
 Mobile:   082 550 3754
 Registered Linux User #333298 (http://counter.li.org)

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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.





 --
 Bradley J. Hintze
 Graduate Student
 Duke University
 School of Medicine
 801-712-8799

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

Re: [modwsgi] Forms

2010-07-05 Thread Carl Nobile
I forgot to mention that I also create a symlink in my project dir to
the django directory in the Django.x.x.x version I am using at the
time. That's why my sourced script points to django in my project
directory.

~Carl

On Mon, Jul 5, 2010 at 10:37 PM, Carl Nobile carl.nob...@gmail.com wrote:
 The sourced shell script is was talking about would be something like this:

  $ cat setup_settings
 PROJECT=inventory
 SITE=inventory
 DJANGO_APPS=${HOME}/dev/django_apps/apps
 DJANGO_HOME=${DJANGO_APPS}/${PROJECT}
 DJANGO_PATH=${DJANGO_HOME}/django/bin
 export PATH=${DJANGO_PATH}:${PATH}
 export PYTHONPATH=${DJANGO_HOME}:${DJANGO_APPS}/site-packages
 export DJANGO_SETTINGS_MODULE=${SITE}.settings
 unset DJANGO_HOME
 unset DJANGO_PATH
 unset DJANGO_APPS

 The above is for a yet to be published open source inventory
 application I am writing. It should be put in the route or your
 project (see below) and adjust the path to your liking. You would run
 this like so:

 $ . setup_settings
 or
 $ source setup_settings

 There is a space between the dot and the script. This is Linux/UNIX
 only like I said with windows you need to put the proper path into
 your system path manually. The Mac will be the same as Linux in this
 case.

 I run a variation of this script just before I do any work on a Django
 project. Without something like this you won't be able to do much. In
 the above and below examples the PROJECT and SITE have the same
 meaning. I tend to use the same name for both, but they don't need to
 be. The above script will work as is with the below directory layout.
 This script is only used while you are working on your project it has
 nothing to do with mod_wsgi or anything running in a production
 environment.

 My project layout follows the path tree below:

 # |-- Django-x.x.x  (BASE_DJANGO_PATH)
 # `-- apps  (BASE_PACKAGE_PATH)
 #     |-- site-packages  (SITE_PACKAGES)
 #     `-- project  (BASE_SITE_PATH)
 #         |-- db
 #         |-- logs
 #         |-- apache  (APACHE_CONF)
 #         |   |-- app.wsgi
 #         |   `-- project.conf
 #         `-- site
 #             |--__init__.py
 #             |--settings.py
 #             |--urls.py
 #             '-- app
 #                 |--views.py
 #                 |--models.py
 #                 `--tests.py

 Using the above layout lets you have many projects all using the same
 Django code. You just start a new project in the apps dir.

 I hope this helps.

 ~Carl


 On Mon, Jul 5, 2010 at 9:51 PM, Bradley Hintze
 bradle...@aggiemail.usu.edu wrote:
 Carl,

 What do you mean by

 'It needs to be put in your path. This is usually done by sourcing a
 shell script before you start working.'

 

 Thanks,
 Bradley

 On Fri, Jun 25, 2010 at 5:33 PM, Carl Nobile carl.nob...@gmail.com wrote:
 django-admin.py is in Django-x.x.x/django/bin after expanding the
 zip/tarball, etc.

 It needs to be put in your path. This is usually done by sourcing a
 shell script before you start working. If you are using windows you
 will need to put it permanently in your path.

 ~Carl

 On Fri, Jun 25, 2010 at 4:37 PM, Bradley Hintze
 bradle...@aggiemail.usu.edu wrote:
 Your right in avoiding Django. I installed it and can't follow their
 tutorial because django-admin.py is no where on my machine. haha
 Pylons it is I guess.

 On Fri, Jun 25, 2010 at 3:38 PM, Raoul Snyman raoul.sny...@gmail.com 
 wrote:
 On 25 June 2010 20:59, Bradley Hintze bradle...@aggiemail.usu.edu wrote:
 I just talked to him. He just doesn't know about python frameworks.
 What frame work would you (and all reading this) recommend? Preferably
 one with a startup tutorial that doesn't requie a degree in CS.

 Personally, I use Pylons[0]. It's not one of those do everything
 under the sun frameworks, it is more geared towards providing you
 with a smaller, more flexible platform to work on, but it does mean
 that you might need to write a bit more boilerplate code. If you would
 prefer a system that comes with the kitchen sink included, you can
 look at Django[1] or TurboGears 2.x[2]. Another, even simpler and less
 structured than Pylons WSGI framework is Werkzeug[3].

 Personally I steer clear of Django because it's inflexible, TurboGears
 because I have to write too much in places where I would expect it to
 just work, and Werkzeug because it is not structured enough for me.
 Each framework has it's own pro's and cons.

 [0] http://pylonshq.com/
 [1] http://www.djangoproject.com/
 [2] http://turbogears.org/
 [3] http://dev.pocoo.org/projects/werkzeug/

 --
 Raoul Snyman
 B.Tech Information Technology (Software Engineering)
 E-Mail:   raoul.sny...@gmail.com
 Web:      http://www.saturnlaboratories.co.za/
 Blog:      http://blog.saturnlaboratories.co.za/
 Mobile:   082 550 3754
 Registered Linux User #333298 (http://counter.li.org)

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@googlegroups.com.
 To unsubscribe

Re: [modwsgi] Hosting

2010-07-04 Thread Carl Nobile
I'm in the US and I use http://www.slicehost.com/ they charge $20 a
month for their minimum setup which has been fine for me for over a
year and a half. My machine has been up for over 570 days with no
issues. Many of the engineers I work with use SliceHost we all feel
they have a good track record.

~Carl

On Sun, Jul 4, 2010 at 7:12 AM, Graham Dumpleton
graham.dumple...@gmail.com wrote:
 On 4 July 2010 18:51, Shivek Khurana shiv...@gmail.com wrote:
 I need a web host that supports mod_wsgi.
 I'm not able to find one. Django is a big no no.

 What do you mean by 'Django is a big no no'? Do you mean you cant find
 a cheap hosting provider who will let you run Django?

 I need some really cheap hosting.

 Cheap usually means that support for Python is crap or non existent.
 If you aren't prepared to pay a bit extra, then you are going to be
 out of luck as far as finding respectable Python web hosting,
 especially any that uses mod_wsgi given that mod_wsgi doesn't target
 the really cheap low end hosting market.

 If you are truly not prepared to pay the money required, because
 perhaps you are only playing, then I suggest you look at Google App
 Engine instead for WSGI hosting.

 Beyond that, as far as giving you an indication of what sort of money
 you would need to spend to get reasonable Python web hosting, have a
 look at what WebFaction charges.

 Graham

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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.





-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modw...@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] Forms

2010-06-25 Thread Carl Nobile
django-admin.py is in Django-x.x.x/django/bin after expanding the
zip/tarball, etc.

It needs to be put in your path. This is usually done by sourcing a
shell script before you start working. If you are using windows you
will need to put it permanently in your path.

~Carl

On Fri, Jun 25, 2010 at 4:37 PM, Bradley Hintze
bradle...@aggiemail.usu.edu wrote:
 Your right in avoiding Django. I installed it and can't follow their
 tutorial because django-admin.py is no where on my machine. haha
 Pylons it is I guess.

 On Fri, Jun 25, 2010 at 3:38 PM, Raoul Snyman raoul.sny...@gmail.com wrote:
 On 25 June 2010 20:59, Bradley Hintze bradle...@aggiemail.usu.edu wrote:
 I just talked to him. He just doesn't know about python frameworks.
 What frame work would you (and all reading this) recommend? Preferably
 one with a startup tutorial that doesn't requie a degree in CS.

 Personally, I use Pylons[0]. It's not one of those do everything
 under the sun frameworks, it is more geared towards providing you
 with a smaller, more flexible platform to work on, but it does mean
 that you might need to write a bit more boilerplate code. If you would
 prefer a system that comes with the kitchen sink included, you can
 look at Django[1] or TurboGears 2.x[2]. Another, even simpler and less
 structured than Pylons WSGI framework is Werkzeug[3].

 Personally I steer clear of Django because it's inflexible, TurboGears
 because I have to write too much in places where I would expect it to
 just work, and Werkzeug because it is not structured enough for me.
 Each framework has it's own pro's and cons.

 [0] http://pylonshq.com/
 [1] http://www.djangoproject.com/
 [2] http://turbogears.org/
 [3] http://dev.pocoo.org/projects/werkzeug/

 --
 Raoul Snyman
 B.Tech Information Technology (Software Engineering)
 E-Mail:   raoul.sny...@gmail.com
 Web:      http://www.saturnlaboratories.co.za/
 Blog:      http://blog.saturnlaboratories.co.za/
 Mobile:   082 550 3754
 Registered Linux User #333298 (http://counter.li.org)

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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.





 --
 Bradley J. Hintze
 Graduate Student
 Duke University
 School of Medicine
 801-712-8799

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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.





-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modw...@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: Forms

2010-06-25 Thread Carl Nobile
First I would uninstall Django and reinstall it manually from a
tarball where you want it. My rule of thumb is to never uses
distribution installs of frameworks since you have little control of
them. Upgrading to a new version of Django when you want to is not
possible if you use a distribution install. I have written many sites
that are in production environments using Django and I have found it
very easy to work with. Writing WSGI code from scratch is much harder
than you might think. You essentially need to build your own
framework. I wrote a RESTful WSGI framework and it took me months and
it still isn't really done though it is usable.

The bad taste you have with Django is because you installed it with
macports, it's not Django giving you these problems any framework
installed this way will give you issues. I have been working with
Python for over ten years and have seem many frameworks come and go
Django is one of the most stable around.

~Carl

On Fri, Jun 25, 2010 at 10:42 PM, Bradley Hintze
bradle...@aggiemail.usu.edu wrote:
 Does Django have a simple to follow tutorial on passing user input to
 scripts?? I saw the tutorial on the site about making a poll but I'm
 not interested in that. I want to be able to upload files, and get
 input from the user.

 On Fri, Jun 25, 2010 at 10:16 PM, Rob Yates ryates...@gmail.com wrote:
 I'm a bit biased as I'm a full-time Django developer, but your angst should 
 be with macports and not with Django. Django is a single directory that 
 contains no compiled code and following their fantastic documentation is 
 really easy. Granted Django may be a bit more functionality than you need in 
 a framework, but ease of installation and stellar documentation are two of 
 it's strong traits.

 If you feel the need to use a package manager, you really should be using 
 easy_install or even better pip, but not macports. Assuming you're on a 
 recent flavor of OS X, most of what you need is built-in to the o/s anyway.

 -Rob

 On Jun 25, 2010, at 9:35 PM, Bradley Hintze bradle...@aggiemail.usu.edu 
 wrote:

 I am fairly comfortable with unix commands and security, I still have
 a lot to learn though.

 I have a bad taste in my moth for Django as I installed it and
 couldn't find where the files were put, and thus couldn't follow the
 one and only Django tutorial. When I asked on the Django mailing list
 for help I got no response. I restored my machine to a previous
 back-up to get rid of all the Django 'stuff' wherever it was. If I
 could get help installing it correctly I might give it a go.

 The problem that I'm seing is most these frameworks don't give you
 step by step instructions on how to download and install.
 How about pylons? I looked at their site and they have decent
 instructions AND tutorials. Surprisingly, I have yet to come across a
 tutorial outlining how to retrieve user input from a form which should
 be, from my limited view, the primary function of a framework as that
 is the crucial aspect of a dynamic web app. If anyone knows of a good
 tutorial let me know.

 Also, I've seen that some of these frameworks have you staat up their
 own server. Why run their server and apache? Or can theses frameworks
 use apache?


 On Fri, Jun 25, 2010 at 7:02 PM, Damjan gdam...@gmail.com wrote:
 I am making an app where I pass variables and run lots of scripts. I
 don't think a frame work can do what I am trying to do, manual control
 is a must. Plus the framework documentation that I've seen is
 difficult to understand. I was raised as a biochemist not a programmer
 ;) If you can point out an easy to understand frame work I'll
 certainty take a look.

 Since you don't have much experience with Web apps or WSGI, I'd
 strongly suggest to start with some framework.

 Django has pretty good documentation and even if I personally don't
 use it, I think it's very good for newbies. You could also look at
 flask - it has great documentation too, but you need to know more
 about web apps with it - http://flask.pocoo.org/. It's perhaps on the
 opposite end of the spectrum of web frameworks compared to Django, but
 has good documentation too.


 From your comments in this group, I would not suggest you to use plain
 WSGI. You will need to understand and know much more about http, html,
 security issues etc.

 Also, if your application is not going to be heavily visited, you
 might not need mod_wsgi either. Most WSGI frameworks come with their
 own python server.

 And last, learn to use virtualenv and pip, and you will be able to
 pack your entire web application, including Django in a single
 directory.

 And lear some Unix command line interface (or shell), it will really
 make your life easier.

 --
 damjan

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@googlegroups.com.
 To unsubscribe from this group, send email to 
 modwsgi+unsubscr...@googlegroups.com.
 For more options, 

Re: [modwsgi] Re: Problem with Python versions

2010-04-22 Thread Carl Nobile
’ has no member named ‘r’
 mod_wsgi.c:14523: error: ‘AuthObject’ has no member named ‘log’
 mod_wsgi.c:14526: error: ‘PyExc_AttributeError’ undeclared (first use
 in this function)
 mod_wsgi.c:14528: error: ‘AuthObject’ has no member named ‘log’
 mod_wsgi.c:14541: error: expected expression before ‘)’ token
 mod_wsgi.c:14548: error: expected ‘;’ before ‘ap_log_rerror’
 mod_wsgi.c:14553: error: expected ‘;’ before ‘}’ token
 mod_wsgi.c:14558: error: too many arguments to function
 ‘wsgi_log_python_error’
 mod_wsgi.c:14563: error: expected expression before ‘module’
 apxs:Error: Command failed with rc=65536
 .
 make: *** [mod_wsgi.la] Error 1


 On Apr 12, 6:40 pm, Graham Dumpleton graham.dumple...@gmail.com
 wrote:
 On 13 April 2010 05:03, Diego H. hid...@gmail.com wrote:



  I've been compiling the module but gave an error to big for post over
  here, but says something about apsx2.

  apxs:Error: Command failed with rc=65536
  .
  make: *** [mod_wsgi.la] Error 1

  Thats the last part of the error what says to me.

 It is all the bits before that which are important. Post the whole lot.

 At a guess, you probably don't have a the 'dev' package for Python 
 installed.

 Graham

  On Apr 11, 3:33 pm, Carl Nobile carl.nob...@gmail.com wrote:
  You need to recompile mod_wsgi yourself and you will need at least
  version 3 of mod_wsgi or the trunk. You will also need to remove
  mod_python if it is being loaded into apache. You cannot have to
  python dependent modules in apache using different versions of python.

  ~Carl

  On Sun, A you received this message because you are subscribed to the
  Google Groups modwsgi group.

   To post to this group, send email to modw...@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.

  --
  ---
  Carl J. Nobile (Software Engineer)
  carl.nob...@gmail.com
  ---

  --
  You received this message because you are subscribed to the Google Groups 
  modwsgi group.
  To post to this group, send email to modw...@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 modw...@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 modw...@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.





-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modw...@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: AppError: Bad response: 404 Not Found (not 200 OK or 3xx redirect for /)

2010-04-22 Thread Carl Nobile

   # --- End paster-2.log ---

   Carl, thanks for the link you sent. I already took some info from
   there and tried the approach with virtualenv but that didn't work.

   Vitor (noisebleed)

   On 21 Abr, 16:49, Carl Nobile carl.nob...@gmail.com wrote:
   You should use a user and group that are not apache. I usually put
   each project in a different user and group so I know exactly which
   processes and threads are running for a specific project.

   Below is a link I found that may help.

  http://getmediacore.com/blog/turbogears-2-tg2-with-mod_wsgi-and-virtu...

   ~Carl

   On Wed, Apr 21, 2010 at 11:12 AM, noisebleed 
   vitorbrandao...@gmail.com wrote:
I hope so ;)

Updated the vhost file according to your suggestions.

- DocumentRoot /var/www/modwsgi/gatekeeper

- WSGIDaemonProcess gatekeeper threads=10 processes=3
+ WSGIDaemonProcess gatekeeper user=apache group=apache processes=3
threads=10 maximum-requests=1000
WSGIProcessGroup gatekeeper

The docs are really good and I've checked FAQ and the configuration
docs but I'm still searching for that little magic trick that will put
this app flying...

Vitor (noisebleed)

In the meanwhile I've installed TG2 in the server (virtualenv), built
the quickstart project (named to GateKeeper/gatekeeper), changed
gatekeeper.wsgi to read from virtualenv but the results are the same.
Paster serve works here too...

On 21 Abr, 15:28, Carl Nobile carl.nob...@gmail.com wrote:
Vitor,

The first time through is always the roughest. You'll get it working
and the next time you'll be the expert.

I see no major issues, but there are a few thing that you could 
change.

1st don't define DocumentRoot at all. You don't want people accessing
your gatekeeper.wsgi hook file or anything else in there.
2nd you should do something like this with the WSGIDaemonProcess

WSGIDaemonProcess some process user=some user group=some group 
\
                                   processes=3 threads=10 
maximum-requests=1000
WSGIProcessGroup some process

Adding a user and group makes it easy to see what is running in a ps
-ef. Also you should always have a 'maximum-requests', this will 
limit
the number of request any one thread will process thus avoiding 
memory
leaks. All apps leak memory so don't assume your code won't I know 
for
a fact that Python itself leaks memory.

Maybe Graham will find something else. He's the author of mod_wsgi so
he is the definitive source of info on it.

Also you can check the docs for mod_wsgi, Graham is very thorough 
documenter.

   http://code.google.com/p/modwsgi/w/list

~Carl

On Wed, Apr 21, 2010 at 10:08 AM, noisebleed 
vitorbrandao...@gmail.com wrote:
 The file is a bit long (it's using SSL) but the WSGI section is 
 right
 on top. I'm posting everything anyway.
 While testing I've used a Directory /var/www/modwsgi/gatekeeper/
 public/images directive and I was able to browse the images 
 folder
 so I guess everything is fine here. Or isn't?..

 # - vhost begin -

 Listen 5

 IfDefine SSL
 IfModule mod_ssl.c
 ##
 ## SSL Virtual Host Context
 ##
 VirtualHost *:5

        #   General setup for the virtual host
        ServerName gatekeeper.localhost
        ServerAdmin ad...@localhost
        DocumentRoot /var/www/modwsgi/gatekeeper

        WSGIScriptAlias / 
 /var/www/modwsgi/gatekeeper/gatekeeper.wsgi
        Alias /images /var/www/gatekeeper/public/images
        Alias /css /var/www/gatekeeper/public/css
        Alias /files /var/www/gatekeeper/public/files
        Alias /js /var/www/gatekeeper/public/js

        WSGIDaemonProcess gatekeeper threads=10 processes=3
        WSGIProcessGroup gatekeeper
        WSGIPassAuthorization On

        LogLevel debug

        ErrorLog /var/log/apache2/ssl_error_log
        IfModule mod_log_config.c
                TransferLog /var/log/apache2/ssl_access_log
        /IfModule

        #   SSL Engine Switch:
        #   Enable/Disable SSL for this virtual host.
        SSLEngine on
        SSLCipherSuite 
 ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:
 +SSLv2:+EXP:+eNULL
        SSLCertificateFile /etc/ssl/apache2/gatekeeper/server.crt
        SSLCertificateKeyFile /etc/ssl/apache2/gatekeeper/server.pem
        SetEnvIf User-Agent .*MSIE.* nokeepalive ssl-unclean-
 shutdown

        Files ~ \.(cgi|shtml|phtml|php?)$
                SSLOptions +StdEnvVars
        /Files

        IfModule mod_setenvif.c
                SetEnvIf User-Agent .*MSIE.* nokeepalive 
 ssl-unclean-
 shutdown \
                downgrade-1.0 force-response-1.0
        /IfModule

        #   Per-Server Logging:

 ...

 mais informações »

 --
 You

Re: [modwsgi] Re: AppError: Bad response: 404 Not Found (not 200 OK or 3xx redirect for /)

2010-04-21 Thread Carl Nobile
You should use a user and group that are not apache. I usually put
each project in a different user and group so I know exactly which
processes and threads are running for a specific project.

Below is a link I found that may help.

http://getmediacore.com/blog/turbogears-2-tg2-with-mod_wsgi-and-virtual-environments/

~Carl

On Wed, Apr 21, 2010 at 11:12 AM, noisebleed vitorbrandao...@gmail.com wrote:
 I hope so ;)

 Updated the vhost file according to your suggestions.

 - DocumentRoot /var/www/modwsgi/gatekeeper

 - WSGIDaemonProcess gatekeeper threads=10 processes=3
 + WSGIDaemonProcess gatekeeper user=apache group=apache processes=3
 threads=10 maximum-requests=1000
 WSGIProcessGroup gatekeeper

 The docs are really good and I've checked FAQ and the configuration
 docs but I'm still searching for that little magic trick that will put
 this app flying...

 Vitor (noisebleed)

 In the meanwhile I've installed TG2 in the server (virtualenv), built
 the quickstart project (named to GateKeeper/gatekeeper), changed
 gatekeeper.wsgi to read from virtualenv but the results are the same.
 Paster serve works here too...

 On 21 Abr, 15:28, Carl Nobile carl.nob...@gmail.com wrote:
 Vitor,

 The first time through is always the roughest. You'll get it working
 and the next time you'll be the expert.

 I see no major issues, but there are a few thing that you could change.

 1st don't define DocumentRoot at all. You don't want people accessing
 your gatekeeper.wsgi hook file or anything else in there.
 2nd you should do something like this with the WSGIDaemonProcess

 WSGIDaemonProcess some process user=some user group=some group \
                                    processes=3 threads=10 
 maximum-requests=1000
 WSGIProcessGroup some process

 Adding a user and group makes it easy to see what is running in a ps
 -ef. Also you should always have a 'maximum-requests', this will limit
 the number of request any one thread will process thus avoiding memory
 leaks. All apps leak memory so don't assume your code won't I know for
 a fact that Python itself leaks memory.

 Maybe Graham will find something else. He's the author of mod_wsgi so
 he is the definitive source of info on it.

 Also you can check the docs for mod_wsgi, Graham is very thorough documenter.

 http://code.google.com/p/modwsgi/w/list

 ~Carl

 On Wed, Apr 21, 2010 at 10:08 AM, noisebleed vitorbrandao...@gmail.com 
 wrote:
  The file is a bit long (it's using SSL) but the WSGI section is right
  on top. I'm posting everything anyway.
  While testing I've used a Directory /var/www/modwsgi/gatekeeper/
  public/images directive and I was able to browse the images folder
  so I guess everything is fine here. Or isn't?..

  # - vhost begin -

  Listen 5

  IfDefine SSL
  IfModule mod_ssl.c
  ##
  ## SSL Virtual Host Context
  ##
  VirtualHost *:5

         #   General setup for the virtual host
         ServerName gatekeeper.localhost
         ServerAdmin ad...@localhost
         DocumentRoot /var/www/modwsgi/gatekeeper

         WSGIScriptAlias / /var/www/modwsgi/gatekeeper/gatekeeper.wsgi
         Alias /images /var/www/gatekeeper/public/images
         Alias /css /var/www/gatekeeper/public/css
         Alias /files /var/www/gatekeeper/public/files
         Alias /js /var/www/gatekeeper/public/js

         WSGIDaemonProcess gatekeeper threads=10 processes=3
         WSGIProcessGroup gatekeeper
         WSGIPassAuthorization On

         LogLevel debug

         ErrorLog /var/log/apache2/ssl_error_log
         IfModule mod_log_config.c
                 TransferLog /var/log/apache2/ssl_access_log
         /IfModule

         #   SSL Engine Switch:
         #   Enable/Disable SSL for this virtual host.
         SSLEngine on
         SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:
  +SSLv2:+EXP:+eNULL
         SSLCertificateFile /etc/ssl/apache2/gatekeeper/server.crt
         SSLCertificateKeyFile /etc/ssl/apache2/gatekeeper/server.pem
         SetEnvIf User-Agent .*MSIE.* nokeepalive ssl-unclean-
  shutdown

         Files ~ \.(cgi|shtml|phtml|php?)$
                 SSLOptions +StdEnvVars
         /Files

         IfModule mod_setenvif.c
                 SetEnvIf User-Agent .*MSIE.* nokeepalive ssl-unclean-
  shutdown \
                 downgrade-1.0 force-response-1.0
         /IfModule

         #   Per-Server Logging:
         #   The home of a custom SSL log file. Use this when you want
  a
         #   compact non-error SSL logfile on a virtual host basis.
         IfModule mod_log_config.c
                 CustomLog /var/log/apache2/ssl_request_log \
                 %t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \%r\ %b
         /IfModule

         IfModule mod_rewrite.c
                 RewriteEngine On
                 RewriteOptions inherit
         /IfModule

         Directory /var/www/gatekeeper
                 Order allow,deny
                 Allow from all
                 #Allow from 10.17.1.0/24
         /Directory

Re: [modwsgi] Re: AppError: Bad response: 404 Not Found (not 200 OK or 3xx redirect for /)

2010-04-21 Thread Carl Nobile
If there is somebody on the list that knows TG2 then you're in luck,
but I wouldn't run away yet, wait for Graham to be back online he may
be able to point you in the right direction.

BTW You sometime send two exact same posts.

Ciao O senhor, minha portugues e minto mal.

~Carl

On Wed, Apr 21, 2010 at 1:32 PM, noisebleed vitorbrandao...@gmail.com wrote:
 Ok, made some more tests and:

 1)  'paster serve development.ini' inside virtualenv (with source bin/
 activate) works.
 2)  'paster serve production.ini' run by root or apache and using
 python packages in /usr/lib/pyton doesn't work.

 It must be something not set in the global environment (outside
 virtualenv) and/or TG2/Pylons configuration which is outside the scope
 of mod_wsgi. Nevertheless can I still ask for support here about this
 issue?

 I've saved both logs and made a comparison. To this point they have
 the same output:

 # --- Begin paster-1/2.log ---

 [routes.middleware] Matched
 GET /
 [routes.middleware] Route path: '*url', defaults: {'action':
 u'routes_placeholder', 'controller':
 u'root'}
 [routes.middleware] Match dict: {'url': '', 'action':
 u'routes_placeholder', 'controller':
 u'root'}
 [pylons.wsgiapp] Setting up Pylons stacked object
 globals
 [pylons.wsgiapp] Resolved URL to controller:
 u'root'
 [tw.core.resources] Registered static at /tw.forms/
 static
 [tw.core.resources] Registered static/calendar at /tw.forms/static/
 calendar
 [tg.wsgiapp] Found controller, module: 'gatekeeper.controllers.root',
 class:
 'RootController'
 [pylons.wsgiapp] Controller appears to be a class,
 instantiating
 [pylons.wsgiapp] Calling controller class with WSGI interface
 [pylons.controllers.core] Calling '__before__' method (...)

 # --- End paster-1/2.log ---

 After this call I can see different output.

 Virtualenv works:
 # --- Begin paster-1.log ---

 [tg.i18n] Set request language to ['pt-pt', 'pt', 'en', 'en-
 us']
 [tg.i18n] Set request language for FormEncode to ['pt-pt', 'pt', 'en',
 'en-
 us']
 [tg.controllers] No controller-wide authorization
 at /
 [tg.controllers] No controller-wide authorization
 at /
 [pylons.controllers.core] Looking for u'routes_placeholder' method to
 handle the
 request
 [pylons.controllers.core] Calling 'routes_placeholder' method

 # --- End paster-1.log ---

 System-wide doesn't:
 # --- Begin paster-2.log ---

 [tg.i18n] Set request language to ['pt-pt', 'pt', 'en', 'en-us']
 [tg.i18n] Set request language for FormEncode to ['pt-pt', 'pt', 'en',
 'en-us']
 [tg.controllers] No controller-wide authorization at /
 [pylons.controllers.core] Merging pylons.response headers into
 start_response call, status: 404 Not Found
 [auth] no challenge required
 [auth] -- repoze.who request ended (/) --
 [txn.-1238922384] commit
 [tg.configuration] Removing DBSession from current thread

 # --- End paster-2.log ---


 Carl, thanks for the link you sent. I already took some info from
 there and tried the approach with virtualenv but that didn't work.

 Vitor (noisebleed)

 On 21 Abr, 16:49, Carl Nobile carl.nob...@gmail.com wrote:
 You should use a user and group that are not apache. I usually put
 each project in a different user and group so I know exactly which
 processes and threads are running for a specific project.

 Below is a link I found that may help.

 http://getmediacore.com/blog/turbogears-2-tg2-with-mod_wsgi-and-virtu...

 ~Carl

 On Wed, Apr 21, 2010 at 11:12 AM, noisebleed vitorbrandao...@gmail.com 
 wrote:
  I hope so ;)

  Updated the vhost file according to your suggestions.

  - DocumentRoot /var/www/modwsgi/gatekeeper

  - WSGIDaemonProcess gatekeeper threads=10 processes=3
  + WSGIDaemonProcess gatekeeper user=apache group=apache processes=3
  threads=10 maximum-requests=1000
  WSGIProcessGroup gatekeeper

  The docs are really good and I've checked FAQ and the configuration
  docs but I'm still searching for that little magic trick that will put
  this app flying...

  Vitor (noisebleed)

  In the meanwhile I've installed TG2 in the server (virtualenv), built
  the quickstart project (named to GateKeeper/gatekeeper), changed
  gatekeeper.wsgi to read from virtualenv but the results are the same.
  Paster serve works here too...

  On 21 Abr, 15:28, Carl Nobile carl.nob...@gmail.com wrote:
  Vitor,

  The first time through is always the roughest. You'll get it working
  and the next time you'll be the expert.

  I see no major issues, but there are a few thing that you could change.

  1st don't define DocumentRoot at all. You don't want people accessing
  your gatekeeper.wsgi hook file or anything else in there.
  2nd you should do something like this with the WSGIDaemonProcess

  WSGIDaemonProcess some process user=some user group=some group \
                                     processes=3 threads=10 
  maximum-requests=1000
  WSGIProcessGroup some process

  Adding a user and group makes it easy to see what is running in a ps
  -ef. Also you should always have a 'maximum-requests

Re: [modwsgi] AppError: Bad response: 404 Not Found (not 200 OK or 3xx redirect for /)

2010-04-20 Thread Carl Nobile
I'm not sure here, but if you have put the wsgi hook file in the egg
it may not be found by mod_wsgi. This is not my area of expertise,
just an educated guess as to what your issue may be.

~Carl

On Tue, Apr 20, 2010 at 10:42 AM, noisebleed vitorbrandao...@gmail.com wrote:
 Hi all. First message sent to modwsgi mailing list.

 I've built a small web application with TurboGears2 and tested it
 inside a virtualenv (on my personal machine) with paster serve
 development.ini. Works just fine.

 Then I built an Egg and installed system-wide on my server. Defined a
 new Apache2 vhost and configured both Apache and the wsgi script
 created by modwsgideploy. After some adjustments I'm stuck with the
 message in the email subject. When visiting my URL Apache shows 500
 Internal Server Error.

 Here goes an excerpt from Apache error log:

 [info] Initial (No.1) HTTPS request received for child 1 (server
 gatekeeper.localhost:443)
 [info] mod_wsgi (pid=21618): Create interpreter 'gatekeeper.localhost:
 5|'.
 [info] [client 192.168.1.103] mod_wsgi (pid=21618,
 process='gatekeeper', application='gatekeeper.localhost:5|'):
 Loading WSGI script '/var/www/modwsgi/gatekeeper/
 gatekeeper.wsgi'.
 [error] 15:54:44,649 DEBUG [pylons.configuration] Initializing
 configuration, package:
 'gatekeeper'
 [error] 15:54:44,651 DEBUG [pylons.configuration] Pushing process
 configuration
 [error] 15:54:44,681 DEBUG [pylons.configuration] Adding mako engine
 with alias None and {'mako.directories': ['/usr/lib/python2.6/site-
 packages/GateKeeper-0.1dev-py2.6.egg/gatekeeper/templates'],
 'myghty.component_root': [{'templates': '/usr/lib/python2.6/site-
 packages/GateKeeper-0.1dev-py2.6.egg/gatekeeper/templates'}],
 'myghty.data_dir': '/var/www/modwsgi/gatekeeper/data/templates',
 'kid.encoding': 'utf-8', 'kid.assume_encoding': 'utf-8',
 'mako.module_directory': '/var/www/modwsgi/gatekeeper/data/templates',
 'myghty.allow_globals': ['c', 'config', 'g', 'h', 'render', 'request',
 'session', 'translator', 'ungettext', '_', 'N_'],
 'myghty.output_encoding': 'utf-8', 'myghty.raise_error': True,
 'mako.output_encoding': 'utf-8', 'mako.filesystem_checks': True}
 options
 [error] 15:54:44,682 DEBUG [pylons.configuration] Loaded mako template
 engine as the default template
 renderer
 [error] 15:54:44,931 DEBUG [pylons.templating] Initialized Buffet
 object
 [error] 15:54:44,933 DEBUG [pylons.templating] Adding mako template
 language for use with
 Buffet
 [error] 15:54:44,934 DEBUG [routes.middleware] Initialized with method
 overriding = True, and path info altering =
 True
 [error] 15:54:45,025 DEBUG [txn.-1335477392] new
 transaction
 [error] 15:54:45,035 DEBUG [routes.middleware] Matched
 GET /
 [error] 15:54:45,036 DEBUG [routes.middleware] Route path: '*url',
 defaults: {'action': u'routes_placeholder', 'controller':
 u'root'}
 [error] 15:54:45,037 DEBUG [routes.middleware] Match dict: {'url':
 u'/', 'action': u'routes_placeholder', 'controller':
 u'root'}
 [error] 15:54:45,038 DEBUG [pylons.wsgiapp] Setting up Pylons stacked
 object
 globals
 [error] 15:54:45,040 DEBUG [pylons.wsgiapp] Setting up paste testing
 environment
 variables
 [error] 15:54:45,041 DEBUG [pylons.wsgiapp] Resolved URL to
 controller:
 u'root'
 [error] 15:54:45,088 DEBUG [tw.core.resources] Registered static at /
 tw.forms/
 static
 [error] 15:54:45,092 DEBUG [tw.core.resources] Registered static/
 calendar at /tw.forms/static/
 calendar
 [error] 15:54:45,183 DEBUG [tg.wsgiapp] Found controller, module:
 'gatekeeper.controllers.root', class:
 'RootController'
 [error] 15:54:45,184 DEBUG [pylons.wsgiapp] Controller appears to be a
 class, instantiating

 (...)

 [error] 15:54:45,192 INFO  [tg.i18n] Set request language to
 []
 [error] 15:54:45,194 INFO  [tg.i18n] Language []: not supported by
 FormEncode
 [error] 15:54:45,195 DEBUG [tg.controllers] No controller-wide
 authorization
 at /
 [error] 15:54:45,198 DEBUG [pylons.controllers.core] Merging
 pylons.response headers into start_response call, status: 404 Not
 Found
 [error] 15:54:45,201 DEBUG [txn.-1335477392]
 commit
 [error] 15:54:45,202 DEBUG [tg.configuration] Removing DBSession from
 current
 thread
 [error] 15:54:45,203 DEBUG [txn.-1335477392] new
 transaction
 [error] 15:54:45,208 DEBUG [routes.middleware] Matched GET /error/
 document
 [error] 15:54:45,209 DEBUG [routes.middleware] Route path: '*url',
 defaults: {'action': u'routes_placeholder', 'controller':
 u'root'}
 [error] 15:54:45,210 DEBUG [routes.middleware] Match dict: {'url': u'/
 error/document', 'action': u'routes_placeholder', 'controller':
 u'root'}
 [error] 15:54:45,211 DEBUG [pylons.wsgiapp] Setting up Pylons stacked
 object
 globals
 [error] 15:54:45,212 DEBUG [pylons.wsgiapp] Setting up paste testing
 environment
 variables
 [error] 15:54:45,214 DEBUG [pylons.wsgiapp] Resolved URL to
 controller:
 u'root'
 [error] 15:54:45,215 DEBUG [pylons.wsgiapp] Controller appears to be a
 class,
 instantiating
 [error] 15:54:45,216 DEBUG 

Re: [modwsgi] Re: AppError: Bad response: 404 Not Found (not 200 OK or 3xx redirect for /)

2010-04-20 Thread Carl Nobile
There should be one file that has a callable in it that mod_wsgi uses
to start everything. The callqbles name must be 'application' unless
you have set it differently in your apache conf file. This file (the
hook file) I think must be outside the egg or mod_wsgi will not find
it.

~Carl

On Tue, Apr 20, 2010 at 11:30 AM, noisebleed vitorbrandao...@gmail.com wrote:
 Thanks for helping out Carl.

 The wsgi folder is not included in the egg I've built on the personal
 machine. Is that what you're refering to? If not, can you elaborate
 please. I'm still not familiar with a lot of concepts...

 On 20 Abr, 16:23, Carl Nobile carl.nob...@gmail.com wrote:
 I'm not sure here, but if you have put the wsgi hook file in the egg
 it may not be found by mod_wsgi. This is not my area of expertise,
 just an educated guess as to what your issue may be.

 ~Carl



 On Tue, Apr 20, 2010 at 10:42 AM, noisebleed vitorbrandao...@gmail.com 
 wrote:
  Hi all. First message sent to modwsgi mailing list.

  I've built a small web application with TurboGears2 and tested it
  inside a virtualenv (on my personal machine) with paster serve
  development.ini. Works just fine.

  Then I built an Egg and installed system-wide on my server. Defined a
  new Apache2 vhost and configured both Apache and the wsgi script
  created by modwsgideploy. After some adjustments I'm stuck with the
  message in the email subject. When visiting my URL Apache shows 500
  Internal Server Error.

  Here goes an excerpt from Apache error log:

  [info] Initial (No.1) HTTPS request received for child 1 (server
  gatekeeper.localhost:443)
  [info] mod_wsgi (pid=21618): Create interpreter 'gatekeeper.localhost:
  5|'.
  [info] [client 192.168.1.103] mod_wsgi (pid=21618,
  process='gatekeeper', application='gatekeeper.localhost:5|'):
  Loading WSGI script '/var/www/modwsgi/gatekeeper/
  gatekeeper.wsgi'.
  [error] 15:54:44,649 DEBUG [pylons.configuration] Initializing
  configuration, package:
  'gatekeeper'
  [error] 15:54:44,651 DEBUG [pylons.configuration] Pushing process
  configuration
  [error] 15:54:44,681 DEBUG [pylons.configuration] Adding mako engine
  with alias None and {'mako.directories': ['/usr/lib/python2.6/site-
  packages/GateKeeper-0.1dev-py2.6.egg/gatekeeper/templates'],
  'myghty.component_root': [{'templates': '/usr/lib/python2.6/site-
  packages/GateKeeper-0.1dev-py2.6.egg/gatekeeper/templates'}],
  'myghty.data_dir': '/var/www/modwsgi/gatekeeper/data/templates',
  'kid.encoding': 'utf-8', 'kid.assume_encoding': 'utf-8',
  'mako.module_directory': '/var/www/modwsgi/gatekeeper/data/templates',
  'myghty.allow_globals': ['c', 'config', 'g', 'h', 'render', 'request',
  'session', 'translator', 'ungettext', '_', 'N_'],
  'myghty.output_encoding': 'utf-8', 'myghty.raise_error': True,
  'mako.output_encoding': 'utf-8', 'mako.filesystem_checks': True}
  options
  [error] 15:54:44,682 DEBUG [pylons.configuration] Loaded mako template
  engine as the default template
  renderer
  [error] 15:54:44,931 DEBUG [pylons.templating] Initialized Buffet
  object
  [error] 15:54:44,933 DEBUG [pylons.templating] Adding mako template
  language for use with
  Buffet
  [error] 15:54:44,934 DEBUG [routes.middleware] Initialized with method
  overriding = True, and path info altering =
  True
  [error] 15:54:45,025 DEBUG [txn.-1335477392] new
  transaction
  [error] 15:54:45,035 DEBUG [routes.middleware] Matched
  GET /
  [error] 15:54:45,036 DEBUG [routes.middleware] Route path: '*url',
  defaults: {'action': u'routes_placeholder', 'controller':
  u'root'}
  [error] 15:54:45,037 DEBUG [routes.middleware] Match dict: {'url':
  u'/', 'action': u'routes_placeholder', 'controller':
  u'root'}
  [error] 15:54:45,038 DEBUG [pylons.wsgiapp] Setting up Pylons stacked
  object
  globals
  [error] 15:54:45,040 DEBUG [pylons.wsgiapp] Setting up paste testing
  environment
  variables
  [error] 15:54:45,041 DEBUG [pylons.wsgiapp] Resolved URL to
  controller:
  u'root'
  [error] 15:54:45,088 DEBUG [tw.core.resources] Registered static at /
  tw.forms/
  static
  [error] 15:54:45,092 DEBUG [tw.core.resources] Registered static/
  calendar at /tw.forms/static/
  calendar
  [error] 15:54:45,183 DEBUG [tg.wsgiapp] Found controller, module:
  'gatekeeper.controllers.root', class:
  'RootController'
  [error] 15:54:45,184 DEBUG [pylons.wsgiapp] Controller appears to be a
  class, instantiating

  (...)

  [error] 15:54:45,192 INFO  [tg.i18n] Set request language to
  []
  [error] 15:54:45,194 INFO  [tg.i18n] Language []: not supported by
  FormEncode
  [error] 15:54:45,195 DEBUG [tg.controllers] No controller-wide
  authorization
  at /
  [error] 15:54:45,198 DEBUG [pylons.controllers.core] Merging
  pylons.response headers into start_response call, status: 404 Not
  Found
  [error] 15:54:45,201 DEBUG [txn.-1335477392]
  commit
  [error] 15:54:45,202 DEBUG [tg.configuration] Removing DBSession from
  current
  thread
  [error] 15:54:45,203 DEBUG [txn.-1335477392] new

Re: [modwsgi] Re: AppError: Bad response: 404 Not Found (not 200 OK or 3xx redirect for /)

2010-04-20 Thread Carl Nobile
Usually the callable 'application' needs to be the last statement in
your hook file. What are you trying to do with

import paste.fixture
app = paste.fixture.TestApp(application)
app.get(/)

This for some reason this doesn't sit right with me. The 'application'
callable will be seen by mod_wsgi before any code after it can do
anything useful.

Graham, lives in Australia, so he won't be online for a few hours yet.

~Carl

On Tue, Apr 20, 2010 at 12:18 PM, noisebleed vitorbrandao...@gmail.com wrote:
 I have gatekeeper.wsgi outside the egg. This file is known to apache/
 mod_wsgi by setting the following line in the respective vhost config
 file:
 WSGIScriptAlias / /var/www/modwsgi/gatekeeper/gatekeeper.wsgi

 Btw, here is what gatekeeper.wsgi looks like:
 # --
 import os, sys
 sys.path.append('/var/www/gatekeeper')

 os.environ['PYTHON_EGG_CACHE'] = '/var/www/modwsgi/python-eggs'

 from paste.script.util.logging_config import fileConfig
 fileConfig('/var/www/modwsgi/gatekeeper/production.ini')

 from paste.deploy import loadapp
 application = loadapp('config:/var/www/modwsgi/gatekeeper/
 production.ini')

 import paste.fixture
 app = paste.fixture.TestApp(application)
 app.get(/)
 # --

 If you detect something wrong in the above code please make me know ;)

 Just to make it clear:
 * wsgi files are in /var/www/mod_wsgi/gatekeeper/
 * the webapp is in /var/www/gatekeeper (which is a symlink to /usr/lib/
 python2.6/site-packages/GateKeeper-0.1dev-py2.6.egg/gatekeeper).

 Thanks again.

 On 20 Abr, 17:02, Carl Nobile carl.nob...@gmail.com wrote:
 There should be one file that has a callable in it that mod_wsgi uses
 to start everything. The callqbles name must be 'application' unless
 you have set it differently in your apache conf file. This file (the
 hook file) I think must be outside the egg or mod_wsgi will not find
 it.

 ~Carl

 On Tue, Apr 20, 2010 at 11:30 AM, noisebleed vitorbrandao...@gmail.com 
 wrote:
  Thanks for helping out Carl.

  The wsgi folder is not included in the egg I've built on the personal
  machine. Is that what you're refering to? If not, can you elaborate
  please. I'm still not familiar with a lot of concepts...

  On 20 Abr, 16:23, Carl Nobile carl.nob...@gmail.com wrote:
  I'm not sure here, but if you have put the wsgi hook file in the egg
  it may not be found by mod_wsgi. This is not my area of expertise,
  just an educated guess as to what your issue may be.

  ~Carl

  On Tue, Apr 20, 2010 at 10:42 AM, noisebleed vitorbrandao...@gmail.com 
  wrote:
   Hi all. First message sent to modwsgi mailing list.

   I've built a small web application with TurboGears2 and tested it
   inside a virtualenv (on my personal machine) with paster serve
   development.ini. Works just fine.

   Then I built an Egg and installed system-wide on my server. Defined a
   new Apache2 vhost and configured both Apache and the wsgi script
   created by modwsgideploy. After some adjustments I'm stuck with the
   message in the email subject. When visiting my URL Apache shows 500
   Internal Server Error.

   Here goes an excerpt from Apache error log:

   [info] Initial (No.1) HTTPS request received for child 1 (server
   gatekeeper.localhost:443)
   [info] mod_wsgi (pid=21618): Create interpreter 'gatekeeper.localhost:
   5|'.
   [info] [client 192.168.1.103] mod_wsgi (pid=21618,
   process='gatekeeper', application='gatekeeper.localhost:5|'):
   Loading WSGI script '/var/www/modwsgi/gatekeeper/
   gatekeeper.wsgi'.
   [error] 15:54:44,649 DEBUG [pylons.configuration] Initializing
   configuration, package:
   'gatekeeper'
   [error] 15:54:44,651 DEBUG [pylons.configuration] Pushing process
   configuration
   [error] 15:54:44,681 DEBUG [pylons.configuration] Adding mako engine
   with alias None and {'mako.directories': ['/usr/lib/python2.6/site-
   packages/GateKeeper-0.1dev-py2.6.egg/gatekeeper/templates'],
   'myghty.component_root': [{'templates': '/usr/lib/python2.6/site-
   packages/GateKeeper-0.1dev-py2.6.egg/gatekeeper/templates'}],
   'myghty.data_dir': '/var/www/modwsgi/gatekeeper/data/templates',
   'kid.encoding': 'utf-8', 'kid.assume_encoding': 'utf-8',
   'mako.module_directory': '/var/www/modwsgi/gatekeeper/data/templates',
   'myghty.allow_globals': ['c', 'config', 'g', 'h', 'render', 'request',
   'session', 'translator', 'ungettext', '_', 'N_'],
   'myghty.output_encoding': 'utf-8', 'myghty.raise_error': True,
   'mako.output_encoding': 'utf-8', 'mako.filesystem_checks': True}
   options
   [error] 15:54:44,682 DEBUG [pylons.configuration] Loaded mako template
   engine as the default template
   renderer
   [error] 15:54:44,931 DEBUG [pylons.templating] Initialized Buffet
   object
   [error] 15:54:44,933 DEBUG [pylons.templating] Adding mako template
   language for use with
   Buffet
   [error] 15:54:44,934 DEBUG [routes.middleware] Initialized with method
   overriding = True

Re: [modwsgi] Re: AppError: Bad response: 404 Not Found (not 200 OK or 3xx redirect for /)

2010-04-20 Thread Carl Nobile
Tudo bem,

Estou americano, mas eu falo portugues mas ou menus.

I lived in Brazil for a few years, but it's been some time since I
spoke or written Portuguese.

Anyway I don't know much about TurboGears, so I don't know what is
correct for your hook file.

Have you tried to expand the egg and see if it works? If it does then
something is not configured right when it is in the egg.

~Carl

On Tue, Apr 20, 2010 at 2:01 PM, noisebleed vitorbrandao...@gmail.com wrote:
 These 3 lines are taken from the TurboGears2 manual:
 http://turbogears.org/2.0/docs/main/Deployment/modwsgi+virtualenv.html

 # --- Begin Quote ---

 In multiple process load balanced deployments (such as this one) it is
 very possible that a given request will pull resources from multiple
 processes.

 You may want to make sure that the TG controllers are loaded up even
 before the first request comes in to handle this, so you should add:

 import paste.fixture
 app = paste.fixture.TestApp(application)
 app.get(/)

 to the end of the wsgi-script that starts your application.

 This will fetch the index page of your app, thus assuring that it’s
 ready to handle all of your requests immediately. This avoids a
 problem where your controller page is not yet loaded so widgets aren’t
 initialized, but a request comes in for a widget resource the
 ToscaWidgets middleware doesn’t have the widget registered yet.

 # --- End Quote ---


 Without those lines I'm getting 404 Not Found The resource could not
 be found. in Apache and these error messages in the log:

 [error] 19:18:43,857 DEBUG [tg.wsgiapp] Found controller, module:
 'gatekeeper.controllers.root', class:
 'RootController'
 [error] 19:18:43,858 DEBUG [pylons.wsgiapp] Controller appears to be a
 class,
 instantiating
 [error] 19:18:43,860 DEBUG [pylons.wsgiapp] Calling controller class
 with WSGI interface

 (...)

 [error] 19:18:43,879 INFO  [tg.i18n] Set request language to ['pt-pt',
 'pt', 'en', 'en-
 us']
 [error] 19:18:43,882 INFO  [tg.i18n] Set request language for
 FormEncode to ['pt-pt', 'pt', 'en', 'en-
 us']
 [error] 19:18:43,884 DEBUG [tg.controllers] No controller-wide
 authorization
 at /
 [error] 19:18:43,887 DEBUG [pylons.controllers.core] Merging
 pylons.response headers into start_response call, status: 404 Not
 Found
 [error] 19:18:43,889 DEBUG [txn.-1333920912]
 commit
 [error] 19:18:43,890 DEBUG [tg.configuration] Removing DBSession from
 current thread

 I'm on the other side of the world (Portugal) and will be leaving
 office soon, but I'm checking email later. Anyway, what do you think
 of the explanation I've quoted?

 Regards,
  Vitor (noisebleed)

 On 20 Abr, 18:29, Carl Nobile carl.nob...@gmail.com wrote:
 Usually the callable 'application' needs to be the last statement in
 your hook file. What are you trying to do with

 import paste.fixture
 app = paste.fixture.TestApp(application)
 app.get(/)

 This for some reason this doesn't sit right with me. The 'application'
 callable will be seen by mod_wsgi before any code after it can do
 anything useful.

 Graham, lives in Australia, so he won't be online for a few hours yet.

 ~Carl

 On Tue, Apr 20, 2010 at 12:18 PM, noisebleed vitorbrandao...@gmail.com 
 wrote:
  I have gatekeeper.wsgi outside the egg. This file is known to apache/
  mod_wsgi by setting the following line in the respective vhost config
  file:
  WSGIScriptAlias / /var/www/modwsgi/gatekeeper/gatekeeper.wsgi

  Btw, here is what gatekeeper.wsgi looks like:
  # --
  import os, sys
  sys.path.append('/var/www/gatekeeper')

  os.environ['PYTHON_EGG_CACHE'] = '/var/www/modwsgi/python-eggs'

  from paste.script.util.logging_config import fileConfig
  fileConfig('/var/www/modwsgi/gatekeeper/production.ini')

  from paste.deploy import loadapp
  application = loadapp('config:/var/www/modwsgi/gatekeeper/
  production.ini')

  import paste.fixture
  app = paste.fixture.TestApp(application)
  app.get(/)
  # --

  If you detect something wrong in the above code please make me know ;)

  Just to make it clear:
  * wsgi files are in /var/www/mod_wsgi/gatekeeper/
  * the webapp is in /var/www/gatekeeper (which is a symlink to /usr/lib/
  python2.6/site-packages/GateKeeper-0.1dev-py2.6.egg/gatekeeper).

  Thanks again.

  On 20 Abr, 17:02, Carl Nobile carl.nob...@gmail.com wrote:
  There should be one file that has a callable in it that mod_wsgi uses
  to start everything. The callqbles name must be 'application' unless
  you have set it differently in your apache conf file. This file (the
  hook file) I think must be outside the egg or mod_wsgi will not find
  it.

  ~Carl

  On Tue, Apr 20, 2010 at 11:30 AM, noisebleed vitorbrandao...@gmail.com 
  wrote:
   Thanks for helping out Carl.

   The wsgi folder is not included in the egg I've built on the personal
   machine. Is that what you're refering to? If not, can you elaborate
   please. I'm still not familiar with a lot

Re: [modwsgi] Re: mod_wsgi no module error

2010-04-13 Thread Carl Nobile
You will have to recompile all the dependencies that use python
yourself. DO NOT use RPM packages, this includes mod_wsgi. REMOVE all
python dependent RPMs from your system and download the source and
start compiling everything. There may not be all that many, you may
only need to compile mod_wsgi depending on what you have installed.
Make sure you do not have mod_python installed anywhere on the box.

~Carl

On Tue, Apr 13, 2010 at 10:22 AM, MMRUser oshadha.ro...@gmail.com wrote:
 So is there any way getting around this, I need python 2.6 for some
 dependency reasons (with some packages require)..

 On Apr 13, 7:54 pm, Clodoaldo Neto clodoaldo.pi...@gmail.com wrote:
 2010/4/13 MMRUser oshadha.ro...@gmail.com:

  ldd mod_wsgi.so out puts :

         libpython2.4.so.1.0 = /usr/lib64/libpython2.4.so.1.0
  (0x2b6f95177000)
         libpthread.so.0 = /lib64/libpthread.so.0 (0x2b6f954a9000)
         libdl.so.2 = /lib64/libdl.so.2 (0x2b6f956c4000)
         libutil.so.1 = /lib64/libutil.so.1 (0x2b6f958c9000)
         libm.so.6 = /lib64/libm.so.6 (0x2b6f95acc000)
         libc.so.6 = /lib64/libc.so.6 (0x2b6f95d4f000)
         /lib64/ld-linux-x86-64.so.2 (0x003aaec0)

  seems like it's the older version how to correct this one, I used the
  rpm mod_wsgi-3.2-1.el5.x86_64.rpm to install mos_wsgi is that the
  wrong rpm ?..

 If you got it fromhttp://codepoint.net/attachments/mod_wsgithen it
 is built against the default Python install: 2.4

 BTW what is so special about Python 2.5/2.6 that some people must
 prove to the world that their servers run it? The Django site says it
 works with Python 2.4. Redhat 5 as it is can run for years without a
 single glitch and I think that is the main goal for a production
 server, stability. Why would someone want to screw that and ask for a
 life of trouble? If their applications where that demanding they would
 not be running Django or any other morbidly obese framework. Why not
 just shift the server maintenance effort to application development?
 The application users will never know what Python version they are
 running or any other technical details.

 I don't know where people is getting the advice to upgrade Python. I
 think it is plain wrong, especially for not experienced server admins.

 Regards, Clodoaldo



  System:
  Redhat Enterprise Linux 5.4 (64bit)

  On Apr 13, 6:49 pm, Graham Dumpleton graham.dumple...@gmail.com
  wrote:
  On 13 April 2010 22:17, MMRUser oshadha.ro...@gmail.com wrote:

   I'm getting this error on my server log I have two versions of
   Python 2.4 and 2.5 Django is installed in to 2.6 and it's the default
   python on my system, also it can be imported through command line..

   I tried then it raised no module name os
   WSGIPythonHome /usr/local

   [Tue Apr 13 12:04:44 2010] [error] Exception exceptions.ImportError:
   'No module named ate$
   'import site' failed; use -v for traceback

  There is no Python installation under /usr/local of the version that
  mod_wsgi has been compiled against.

  Run:

    ldd mod_wsgi.so

  on the .so file that was generated by built process to work out which
  Python it was compiled against. It possibly isn't the version you want
  to use.

   Fatal Python error: unexpected exception during garbage collection
   [Tue Apr 13 12:04:44 2010] [notice] caught SIGTERM, shutting down
   [Tue Apr 13 12:04:44 2010] [notice] suEXEC mechanism enabled
   (wrapper: /usr/sbin/suexec)
   [Tue Apr 13 12:04:44 2010] [warn] module wsgi_module is already
   loaded, skipping

  You have duplicate LoadModule lines for mod_wsgi. Either you have
  listed it twice by accident, or your snippet configuration file is
  being included more than once for some reason.

  Graham

   [Tue Apr 13 12:04:44 2010] [notice] Digest: generating secret for
   digest authentication .$
   [Tue Apr 13 12:04:44 2010] [notice] Digest: done
   [Tue Apr 13 12:04:44 2010] [notice] Apache/2.2.3 (Red Hat) configured
   -- resuming normal $
   [Tue Apr 13 12:09:03 2010] [error] [client 127.0.0.1] Directory index
   forbidden by Option$
   [Tue Apr 13 12:09:14 2010] [error] [client 127.0.0.1] mod_wsgi
   (pid=24108): Target WSGI s$
   [Tue Apr 13 12:09:14 2010] [error] [client 127.0.0.1] mod_wsgi
   (pid=24108): Exception occ$
   [Tue Apr 13 12:09:14 2010] [error] [client 127.0.0.1] Traceback (most
   recent call last):
   [Tue Apr 13 12:09:14 2010] [error] [client 127.0.0.1]   File /var/www/
   html/testproject/a$
   [Tue Apr 13 12:09:14 2010] [error] [client 127.0.0.1]     import
   django.core.handlers.wsgi
   [Tue Apr 13 12:09:14 2010] [error] [client 127.0.0.1] ImportError: No
   module named django$

   --
   You received this message because you are subscribed to the Google 
   Groups modwsgi group.
   To post to this group, send email to modw...@googlegroups.com.
   To unsubscribe from this group, send email to 
   modwsgi+unsubscr...@googlegroups.com.
   For more options, visit this group 
   

Re: [modwsgi] Re: mod_wsgi redhat installation error

2010-04-13 Thread Carl Nobile
 system 
  /usr/lib/
  apr-1/build/libtool

  Please help me..

  Thanks.

  On Apr 12, 5:01 am, Graham Dumpleton 
  graham.dumple...@gmail.com
  wrote:
  On 12 April 2010 07:23, Clodoaldo Neto 
  clodoaldo.pi...@gmail.com wrote:

   Try as root:

   # yum install python-devel httpd-devel

  The 'httpd' package may only be Apache itself and APR 
  libraries may be
  separate packages, so may need 'devel' versions of apr and 
  aprutil.

  This is based on it wanting to use  '/apr-1/build/libtool'. 
  Ie., wants
  to get libtool out of APR directory.

  If after putting all development packages for Apache, APR and 
  APR-UTIL
  it still doesn't work because '/apr-1/build/libtool' cant be 
  found,
  then start to question whether your apxs isn't configured 
  incorrectly.
  Where did your Apache installation come from?

  Graham

   Regards, Clodoaldo

   2010/4/11 MMRUser oshadha.ro...@gmail.com:
   I'm using Redhat EL see the title .. I wanted to know 
   exact packages
   which will solve this issue.

   On Apr 12, 1:52 am, Carl Nobile carl.nob...@gmail.com 
   wrote:
   What distribution are you using? There are many of them 
   but the most
   common are Red Hat, Ubuntu, Mandriva, etc.

   You will find them listed in whatever package manager you 
   are using.
   If you don't know what I'm talking about then you probably 
   should find
   somebody that does. You need to have some experience with 
   Linux admin
   to be compiling anything on a UNIX/Linux box.

   ~Carl

   On Sun, Apr 11, 2010 at 3:45 PM, MMRUser 
   oshadha.ro...@gmail.com wrote:
Where ?

On Apr 12, 1:36 am, Carl Nobile carl.nob...@gmail.com 
wrote:
These are the development packages for all the 
dependencies used by
mod_python. The package names are different depending 
on which
distribution of Linux you are using. They will usually 
have dev or
devl in the name.

~Carl

On Sun, Apr 11, 2010 at 3:18 PM, MMRUser 
oshadha.ro...@gmail.com wrote:
 Can you be more specific about dev packages ..

 On Apr 12, 1:10 am, Carl Nobile 
 carl.nob...@gmail.com wrote:
 But are the dev packages for all of those on your 
 system? To build
 mod_wsgi you not only need the libs, but you need 
 the dev packages for
 the libs also. This does for python, apache and 
 everything else.

 ~Carl

 On Sun, Apr 11, 2010 at 3:06 PM, MMRUser 
 oshadha.ro...@gmail.com wrote:
  ./configure

  checking for apxs2... no
  checking for apxs... /usr/sbin/apxs
  checking Apache version... 2.2.3
  configure: creating ./config.status
  config.status: creating Makefile

  make

  /usr/sbin/apxs -c -I/usr/local/include/python2.6 
  -DNDEBUG   mod_wsgi.c
  -L/usr/local/lib -L/usr/local/lib/python2.6/config 
   -lpython2.6 -
  lpthread -ldl  -lutil -lm
  /apr-1/build/libtool --silent --mode=compile gcc 
  -prefer-pic -O2 -g -
  pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions 
  -fstack-protector --
  param=ssp-buffer-size=4 -m32 -march=i386 
  -mtune=generic -fasynchronous-
  unwind-tables -fno-strict-aliasing  -DLINUX=2 
  -D_REENTRANT -
  D_GNU_SOURCE -D_LARGEFILE64_SOURCE -pthread 
  -I/usr/include/httpd  -I/
  usr/include/apr-1   -I/usr/include/apr-1  
  -I/usr/local/include/
  python2.6 -DNDEBUG  -c -o mod_wsgi.lo mod_wsgi.c 
   touch mod_wsgi.slo
  sh: /apr-1/build/libtool: No such file or directory
  apxs:Error: Command failed with rc=8323072
  .
  make: *** [mod_wsgi.la] Error 1

  apr is there in my system ..

  mod_wsgi 3.2
  Apache 2.2
  Python 2.6
  apr-1.2.7-11

  Thanks

  --
  You received this message because you are 
  subscribed to the Google Groups modwsgi group.
  To post to this group, send email to 
  modw...@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.

 --
 ---
 Carl J. Nobile (Software Engineer)
 carl.nob...@gmail.com
 ---

 --
 You received this message because you are subscribed 
 to the Google Groups modwsgi group.
 To post to this group, send email

Re: [modwsgi] Re: mod_wsgi no module error

2010-04-13 Thread Carl Nobile
You will have to hunt for it, but here is a download link. Also, if
apxs2 or apxs have any dependencies of their own you will have to
install the RPM for those also. You will know if they complain when
you install them.

http://rpmfind.net/linux/RPM/index.html

~Carl

On Tue, Apr 13, 2010 at 12:56 PM, MMRUser oshadha.ro...@gmail.com wrote:
 Do you know where I can get the proper apxs packages + RPMs, it's not
 in the redhat PM (tried with yum).

 On Apr 13, 10:26 pm, Carl Nobile carl.nob...@gmail.com wrote:
 You still need to have apxs installed with RPMs if they don't depend
 on python themselves. Yes mod_wsgi depends on apxs, but apxs does not
 depend on python from what I can tell.

 You only need to compile packages that themselves depend on python if
 you are changing from python v2.4 to 2.6.

 ~Carl

  Your post from the other issues. Please use this one. 

 I just as a test I tried to compile it and gives me this error

 # ./configure --with-python=/usr/local/bin/python2.6
 checking for apxs2... no
 checking for apxs... no
 checking Apache version... ./configure: line 1704: apxs: command not
 found
 ./configure: line 1704: apxs: command not found
 ./configure: line 1705: apxs: command not found
 ./configure: line 1708: /: is a directory

 ./configure: line 1877: apxs: command not found
 configure: creating ./config.status
 config.status: error: cannot find input file: Makefile.in



 On Tue, Apr 13, 2010 at 11:43 AM, MMRUser oshadha.ro...@gmail.com wrote:
  Ok i'll give a try..

  On Apr 13, 8:40 pm, Carl Nobile carl.nob...@gmail.com wrote:
  You will have to recompile all the dependencies that use python
  yourself. DO NOT use RPM packages, this includes mod_wsgi. REMOVE all
  python dependent RPMs from your system and download the source and
  start compiling everything. There may not be all that many, you may
  only need to compile mod_wsgi depending on what you have installed.
  Make sure you do not have mod_python installed anywhere on the box.

  ~Carl

  On Tue, Apr 13, 2010 at 10:22 AM, MMRUser oshadha.ro...@gmail.com wrote:
   So is there any way getting around this, I need python 2.6 for some
   dependency reasons (with some packages require)..

   On Apr 13, 7:54 pm, Clodoaldo Neto clodoaldo.pi...@gmail.com wrote:
   2010/4/13 MMRUser oshadha.ro...@gmail.com:

ldd mod_wsgi.so out puts :

       libpython2.4.so.1.0 = /usr/lib64/libpython2.4.so.1.0
(0x2b6f95177000)
       libpthread.so.0 = /lib64/libpthread.so.0 (0x2b6f954a9000)
       libdl.so.2 = /lib64/libdl.so.2 (0x2b6f956c4000)
       libutil.so.1 = /lib64/libutil.so.1 (0x2b6f958c9000)
       libm.so.6 = /lib64/libm.so.6 (0x2b6f95acc000)
       libc.so.6 = /lib64/libc.so.6 (0x2b6f95d4f000)
       /lib64/ld-linux-x86-64.so.2 (0x003aaec0)

seems like it's the older version how to correct this one, I used the
rpm mod_wsgi-3.2-1.el5.x86_64.rpm to install mos_wsgi is that the
wrong rpm ?..

   If you got it fromhttp://codepoint.net/attachments/mod_wsgithenit
   is built against the default Python install: 2.4

   BTW what is so special about Python 2.5/2.6 that some people must
   prove to the world that their servers run it? The Django site says it
   works with Python 2.4. Redhat 5 as it is can run for years without a
   single glitch and I think that is the main goal for a production
   server, stability. Why would someone want to screw that and ask for a
   life of trouble? If their applications where that demanding they would
   not be running Django or any other morbidly obese framework. Why not
   just shift the server maintenance effort to application development?
   The application users will never know what Python version they are
   running or any other technical details.

   I don't know where people is getting the advice to upgrade Python. I
   think it is plain wrong, especially for not experienced server admins.

   Regards, Clodoaldo

System:
Redhat Enterprise Linux 5.4 (64bit)

On Apr 13, 6:49 pm, Graham Dumpleton graham.dumple...@gmail.com
wrote:
On 13 April 2010 22:17, MMRUser oshadha.ro...@gmail.com wrote:

 I'm getting this error on my server log I have two versions of
 Python 2.4 and 2.5 Django is installed in to 2.6 and it's the 
 default
 python on my system, also it can be imported through command 
 line..

 I tried then it raised no module name os
 WSGIPythonHome /usr/local

 [Tue Apr 13 12:04:44 2010] [error] Exception 
 exceptions.ImportError:
 'No module named ate$
 'import site' failed; use -v for traceback

There is no Python installation under /usr/local of the version that
mod_wsgi has been compiled against.

Run:

  ldd mod_wsgi.so

on the .so file that was generated by built process to work out 
which
Python it was compiled against. It possibly isn't the version you 
want
to use.

 Fatal Python error: unexpected

Re: [modwsgi] Re: mod_wsgi no module error

2010-04-13 Thread Carl Nobile
Yes, but it will bite you in the butt later if you don't remove the RPM.

# rpm -e package name

To find the package name for the above:

# rpm -qa | grep mod_wsgi

I haven't used these commands in many years because I use a Debian
derived distribution now which uses apt_get or aptitude.

Hope this works for you.

~Carl

On Tue, Apr 13, 2010 at 1:26 PM, MMRUser oshadha.ro...@gmail.com wrote:
 Once more question how do I remove mod wsgi, that I previously
 installed using rpm (mod_wsgi-3.2-1.el5.x86_64.rpm).Can't I just
 remove the mod_wsgi.so in apache's modules..?

 On Apr 13, 11:18 pm, Carl Nobile carl.nob...@gmail.com wrote:
 You will have to hunt for it, but here is a download link. Also, if
 apxs2 or apxs have any dependencies of their own you will have to
 install the RPM for those also. You will know if they complain when
 you install them.

 http://rpmfind.net/linux/RPM/index.html

 ~Carl



 On Tue, Apr 13, 2010 at 12:56 PM, MMRUser oshadha.ro...@gmail.com wrote:
  Do you know where I can get the proper apxs packages + RPMs, it's not
  in the redhat PM (tried with yum).

  On Apr 13, 10:26 pm, Carl Nobile carl.nob...@gmail.com wrote:
  You still need to have apxs installed with RPMs if they don't depend
  on python themselves. Yes mod_wsgi depends on apxs, but apxs does not
  depend on python from what I can tell.

  You only need to compile packages that themselves depend on python if
  you are changing from python v2.4 to 2.6.

  ~Carl

   Your post from the other issues. Please use this one. 

  I just as a test I tried to compile it and gives me this error

  # ./configure --with-python=/usr/local/bin/python2.6
  checking for apxs2... no
  checking for apxs... no
  checking Apache version... ./configure: line 1704: apxs: command not
  found
  ./configure: line 1704: apxs: command not found
  ./configure: line 1705: apxs: command not found
  ./configure: line 1708: /: is a directory

  ./configure: line 1877: apxs: command not found
  configure: creating ./config.status
  config.status: error: cannot find input file: Makefile.in

  On Tue, Apr 13, 2010 at 11:43 AM, MMRUser oshadha.ro...@gmail.com wrote:
   Ok i'll give a try..

   On Apr 13, 8:40 pm, Carl Nobile carl.nob...@gmail.com wrote:
   You will have to recompile all the dependencies that use python
   yourself. DO NOT use RPM packages, this includes mod_wsgi. REMOVE all
   python dependent RPMs from your system and download the source and
   start compiling everything. There may not be all that many, you may
   only need to compile mod_wsgi depending on what you have installed.
   Make sure you do not have mod_python installed anywhere on the box.

   ~Carl

   On Tue, Apr 13, 2010 at 10:22 AM, MMRUser oshadha.ro...@gmail.com 
   wrote:
So is there any way getting around this, I need python 2.6 for some
dependency reasons (with some packages require)..

On Apr 13, 7:54 pm, Clodoaldo Neto clodoaldo.pi...@gmail.com wrote:
2010/4/13 MMRUser oshadha.ro...@gmail.com:

 ldd mod_wsgi.so out puts :

        libpython2.4.so.1.0 = /usr/lib64/libpython2.4.so.1.0
 (0x2b6f95177000)
        libpthread.so.0 = /lib64/libpthread.so.0 
 (0x2b6f954a9000)
        libdl.so.2 = /lib64/libdl.so.2 (0x2b6f956c4000)
        libutil.so.1 = /lib64/libutil.so.1 (0x2b6f958c9000)
        libm.so.6 = /lib64/libm.so.6 (0x2b6f95acc000)
        libc.so.6 = /lib64/libc.so.6 (0x2b6f95d4f000)
        /lib64/ld-linux-x86-64.so.2 (0x003aaec0)

 seems like it's the older version how to correct this one, I used 
 the
 rpm mod_wsgi-3.2-1.el5.x86_64.rpm to install mos_wsgi is that 
 the
 wrong rpm ?..

If you got it fromhttp://codepoint.net/attachments/mod_wsgithenit
is built against the default Python install: 2.4

BTW what is so special about Python 2.5/2.6 that some people must
prove to the world that their servers run it? The Django site says 
it
works with Python 2.4. Redhat 5 as it is can run for years without a
single glitch and I think that is the main goal for a production
server, stability. Why would someone want to screw that and ask for 
a
life of trouble? If their applications where that demanding they 
would
not be running Django or any other morbidly obese framework. Why not
just shift the server maintenance effort to application development?
The application users will never know what Python version they are
running or any other technical details.

I don't know where people is getting the advice to upgrade Python. I
think it is plain wrong, especially for not experienced server 
admins.

Regards, Clodoaldo

 System:
 Redhat Enterprise Linux 5.4 (64bit)

 On Apr 13, 6:49 pm, Graham Dumpleton graham.dumple...@gmail.com
 wrote:
 On 13 April 2010 22:17, MMRUser oshadha.ro...@gmail.com wrote:

  I'm getting this error on my server log I have two

Re: [modwsgi] mod_wsgi redhat installation error

2010-04-11 Thread Carl Nobile
But are the dev packages for all of those on your system? To build
mod_wsgi you not only need the libs, but you need the dev packages for
the libs also. This does for python, apache and everything else.

~Carl

On Sun, Apr 11, 2010 at 3:06 PM, MMRUser oshadha.ro...@gmail.com wrote:
 ./configure

 checking for apxs2... no
 checking for apxs... /usr/sbin/apxs
 checking Apache version... 2.2.3
 configure: creating ./config.status
 config.status: creating Makefile

 make

 /usr/sbin/apxs -c -I/usr/local/include/python2.6 -DNDEBUG   mod_wsgi.c
 -L/usr/local/lib -L/usr/local/lib/python2.6/config  -lpython2.6 -
 lpthread -ldl  -lutil -lm
 /apr-1/build/libtool --silent --mode=compile gcc -prefer-pic -O2 -g -
 pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --
 param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-
 unwind-tables -fno-strict-aliasing  -DLINUX=2 -D_REENTRANT -
 D_GNU_SOURCE -D_LARGEFILE64_SOURCE -pthread -I/usr/include/httpd  -I/
 usr/include/apr-1   -I/usr/include/apr-1  -I/usr/local/include/
 python2.6 -DNDEBUG  -c -o mod_wsgi.lo mod_wsgi.c  touch mod_wsgi.slo
 sh: /apr-1/build/libtool: No such file or directory
 apxs:Error: Command failed with rc=8323072
 .
 make: *** [mod_wsgi.la] Error 1

 apr is there in my system ..

 mod_wsgi 3.2
 Apache 2.2
 Python 2.6
 apr-1.2.7-11

 Thanks

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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.





-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modw...@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] Problem with Python versions

2010-04-11 Thread Carl Nobile
You need to recompile mod_wsgi yourself and you will need at least
version 3 of mod_wsgi or the trunk. You will also need to remove
mod_python if it is being loaded into apache. You cannot have to
python dependent modules in apache using different versions of python.

~Carl

On Sun, A you received this message because you are subscribed to the
Google Groups modwsgi group.
 To post to this group, send email to modw...@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.





-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modw...@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 redhat installation error

2010-04-11 Thread Carl Nobile
These are the development packages for all the dependencies used by
mod_python. The package names are different depending on which
distribution of Linux you are using. They will usually have dev or
devl in the name.

~Carl

On Sun, Apr 11, 2010 at 3:18 PM, MMRUser oshadha.ro...@gmail.com wrote:
 Can you be more specific about dev packages ..

 On Apr 12, 1:10 am, Carl Nobile carl.nob...@gmail.com wrote:
 But are the dev packages for all of those on your system? To build
 mod_wsgi you not only need the libs, but you need the dev packages for
 the libs also. This does for python, apache and everything else.

 ~Carl



 On Sun, Apr 11, 2010 at 3:06 PM, MMRUser oshadha.ro...@gmail.com wrote:
  ./configure

  checking for apxs2... no
  checking for apxs... /usr/sbin/apxs
  checking Apache version... 2.2.3
  configure: creating ./config.status
  config.status: creating Makefile

  make

  /usr/sbin/apxs -c -I/usr/local/include/python2.6 -DNDEBUG   mod_wsgi.c
  -L/usr/local/lib -L/usr/local/lib/python2.6/config  -lpython2.6 -
  lpthread -ldl  -lutil -lm
  /apr-1/build/libtool --silent --mode=compile gcc -prefer-pic -O2 -g -
  pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --
  param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-
  unwind-tables -fno-strict-aliasing  -DLINUX=2 -D_REENTRANT -
  D_GNU_SOURCE -D_LARGEFILE64_SOURCE -pthread -I/usr/include/httpd  -I/
  usr/include/apr-1   -I/usr/include/apr-1  -I/usr/local/include/
  python2.6 -DNDEBUG  -c -o mod_wsgi.lo mod_wsgi.c  touch mod_wsgi.slo
  sh: /apr-1/build/libtool: No such file or directory
  apxs:Error: Command failed with rc=8323072
  .
  make: *** [mod_wsgi.la] Error 1

  apr is there in my system ..

  mod_wsgi 3.2
  Apache 2.2
  Python 2.6
  apr-1.2.7-11

  Thanks

  --
  You received this message because you are subscribed to the Google Groups 
  modwsgi group.
  To post to this group, send email to modw...@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.

 --
 ---
 Carl J. Nobile (Software Engineer)
 carl.nob...@gmail.com
 ---

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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.





-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modw...@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 redhat installation error

2010-04-11 Thread Carl Nobile
What distribution are you using? There are many of them but the most
common are Red Hat, Ubuntu, Mandriva, etc.

You will find them listed in whatever package manager you are using.
If you don't know what I'm talking about then you probably should find
somebody that does. You need to have some experience with Linux admin
to be compiling anything on a UNIX/Linux box.

~Carl

On Sun, Apr 11, 2010 at 3:45 PM, MMRUser oshadha.ro...@gmail.com wrote:
 Where ?

 On Apr 12, 1:36 am, Carl Nobile carl.nob...@gmail.com wrote:
 These are the development packages for all the dependencies used by
 mod_python. The package names are different depending on which
 distribution of Linux you are using. They will usually have dev or
 devl in the name.

 ~Carl



 On Sun, Apr 11, 2010 at 3:18 PM, MMRUser oshadha.ro...@gmail.com wrote:
  Can you be more specific about dev packages ..

  On Apr 12, 1:10 am, Carl Nobile carl.nob...@gmail.com wrote:
  But are the dev packages for all of those on your system? To build
  mod_wsgi you not only need the libs, but you need the dev packages for
  the libs also. This does for python, apache and everything else.

  ~Carl

  On Sun, Apr 11, 2010 at 3:06 PM, MMRUser oshadha.ro...@gmail.com wrote:
   ./configure

   checking for apxs2... no
   checking for apxs... /usr/sbin/apxs
   checking Apache version... 2.2.3
   configure: creating ./config.status
   config.status: creating Makefile

   make

   /usr/sbin/apxs -c -I/usr/local/include/python2.6 -DNDEBUG   mod_wsgi.c
   -L/usr/local/lib -L/usr/local/lib/python2.6/config  -lpython2.6 -
   lpthread -ldl  -lutil -lm
   /apr-1/build/libtool --silent --mode=compile gcc -prefer-pic -O2 -g -
   pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --
   param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-
   unwind-tables -fno-strict-aliasing  -DLINUX=2 -D_REENTRANT -
   D_GNU_SOURCE -D_LARGEFILE64_SOURCE -pthread -I/usr/include/httpd  -I/
   usr/include/apr-1   -I/usr/include/apr-1  -I/usr/local/include/
   python2.6 -DNDEBUG  -c -o mod_wsgi.lo mod_wsgi.c  touch mod_wsgi.slo
   sh: /apr-1/build/libtool: No such file or directory
   apxs:Error: Command failed with rc=8323072
   .
   make: *** [mod_wsgi.la] Error 1

   apr is there in my system ..

   mod_wsgi 3.2
   Apache 2.2
   Python 2.6
   apr-1.2.7-11

   Thanks

   --
   You received this message because you are subscribed to the Google 
   Groups modwsgi group.
   To post to this group, send email to modw...@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.

  --
  ---
  Carl J. Nobile (Software Engineer)
  carl.nob...@gmail.com
  ---

  --
  You received this message because you are subscribed to the Google Groups 
  modwsgi group.
  To post to this group, send email to modw...@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.

 --
 ---
 Carl J. Nobile (Software Engineer)
 carl.nob...@gmail.com
 ---

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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.





-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modw...@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 redhat installation error

2010-04-11 Thread Carl Nobile
I don't know the exact packages. I don't use Red Hat. However, this
should be easy enough to find in the package manager. If you are using
a headless box you can go to the red hat package site on a different
computer and lookup the package names for the version of Red Hat you
have, then type them in on the command line in the headless box.

Sorry that's the best I can offer. Unless there is anybody on this
list with the exact same version of Red Hat that you have and can help
you I don't think you'll get a lot of help here. Your issue seems to
be administration of your box not mod_wsgi. Try a group dedicated to
sys admin for Red hat for how to find and install packages on Red Hat,
then if you have compilation issues with mod_wsgi itself then coma
back and we can help you.

I'm not trying to be rude here, but there are many different
distribution of Linux and they all use different package names. So
unless you just happen to hit the right person in this group you won't
find your answer here.

~Carl

On Sun, Apr 11, 2010 at 4:28 PM, MMRUser oshadha.ro...@gmail.com wrote:
 I'm using Redhat EL see the title .. I wanted to know exact packages
 which will solve this issue.

 On Apr 12, 1:52 am, Carl Nobile carl.nob...@gmail.com wrote:
 What distribution are you using? There are many of them but the most
 common are Red Hat, Ubuntu, Mandriva, etc.

 You will find them listed in whatever package manager you are using.
 If you don't know what I'm talking about then you probably should find
 somebody that does. You need to have some experience with Linux admin
 to be compiling anything on a UNIX/Linux box.

 ~Carl



 On Sun, Apr 11, 2010 at 3:45 PM, MMRUser oshadha.ro...@gmail.com wrote:
  Where ?

  On Apr 12, 1:36 am, Carl Nobile carl.nob...@gmail.com wrote:
  These are the development packages for all the dependencies used by
  mod_python. The package names are different depending on which
  distribution of Linux you are using. They will usually have dev or
  devl in the name.

  ~Carl

  On Sun, Apr 11, 2010 at 3:18 PM, MMRUser oshadha.ro...@gmail.com wrote:
   Can you be more specific about dev packages ..

   On Apr 12, 1:10 am, Carl Nobile carl.nob...@gmail.com wrote:
   But are the dev packages for all of those on your system? To build
   mod_wsgi you not only need the libs, but you need the dev packages for
   the libs also. This does for python, apache and everything else.

   ~Carl

   On Sun, Apr 11, 2010 at 3:06 PM, MMRUser oshadha.ro...@gmail.com 
   wrote:
./configure

checking for apxs2... no
checking for apxs... /usr/sbin/apxs
checking Apache version... 2.2.3
configure: creating ./config.status
config.status: creating Makefile

make

/usr/sbin/apxs -c -I/usr/local/include/python2.6 -DNDEBUG   
mod_wsgi.c
-L/usr/local/lib -L/usr/local/lib/python2.6/config  -lpython2.6 -
lpthread -ldl  -lutil -lm
/apr-1/build/libtool --silent --mode=compile gcc -prefer-pic -O2 -g -
pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --
param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic 
-fasynchronous-
unwind-tables -fno-strict-aliasing  -DLINUX=2 -D_REENTRANT -
D_GNU_SOURCE -D_LARGEFILE64_SOURCE -pthread -I/usr/include/httpd  -I/
usr/include/apr-1   -I/usr/include/apr-1  -I/usr/local/include/
python2.6 -DNDEBUG  -c -o mod_wsgi.lo mod_wsgi.c  touch 
mod_wsgi.slo
sh: /apr-1/build/libtool: No such file or directory
apxs:Error: Command failed with rc=8323072
.
make: *** [mod_wsgi.la] Error 1

apr is there in my system ..

mod_wsgi 3.2
Apache 2.2
Python 2.6
apr-1.2.7-11

Thanks

--
You received this message because you are subscribed to the Google 
Groups modwsgi group.
To post to this group, send email to modw...@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.

   --
   ---
   Carl J. Nobile (Software Engineer)
   carl.nob...@gmail.com
   ---

   --
   You received this message because you are subscribed to the Google 
   Groups modwsgi group.
   To post to this group, send email to modw...@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.

  --
  ---
  Carl J. Nobile (Software Engineer)
  carl.nob...@gmail.com
  ---

  --
  You received this message because you are subscribed to the Google Groups 
  modwsgi group.
  To post to this group, send email to modw

Re: [modwsgi] interprocess communication means ?

2010-02-12 Thread Carl Nobile
As Graham explained to me once each process has a different Python
interpreter but the threads under each process uses the same
interpreter. So you should not be able to persist data between
processes as I understand it. If you need to persist data you could
use something like mmap.

~Carl

On Fri, Feb 12, 2010 at 10:09 AM, till amon till.a...@googlemail.com wrote:
 Hello all,
 and apologies upfront for going to be vague.

 i'm toying with mod_wsgi for a couple of days now and still am
 somewhat struck when it comes to threading semantics - especially how
 to share state between processes.

 the current setup is like this :
 WSGIDaemonProcess daemon_group processes=1 threads=15

 Which is working fine as long as there is only one process.
 now to the vague part : if one wants to have other processes serving
 different scripts , what would be the cleanest way to share state
 among them if responsiveness was the main concern ?

 (starting a 16th thread to wait for a unix pipe or socket does not
 seem to work - by design i guess ? )

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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.





-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modw...@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] General Question

2010-02-08 Thread Carl Nobile
If it was written for mod_python and you don't make the appropriate
changes for mod_wsgi it will not work at all. You must return a python
list object from the hook script in your care 'hello_server.wsgi', but
this is not all. It's really very simple, but it is not at all like
mod_python.

You really need to read the docs: http://code.google.com/p/modwsgi/w/list

~Carl

On Mon, Feb 8, 2010 at 10:21 AM, Joe Hughes jwhughe...@gmail.com wrote:
 All,
 I'm a bit confused.  I have two files
 test_ajax_mod_wsgi.html
 hello_server.wsgi
 And I'm not getting what I expect.  I get this error
 XML response error

 Content-type:text/plain

 Response: #!/usr/local/bin/python3 import sys import time def index(req): s
 =   return s

 when I send an AJAX request to the server.  This is the output of the
 access_log
 141.232.2.115 - - [08/Feb/2010:10:06:28 -0500] GET
 /netboss/test_ajax_mod_python.html HTTP/1.1 200 3183
 141.232.2.115 - - [08/Feb/2010:10:06:31 -0500] POST
 /netboss/hello_server.wsgi HTTP/1.1 200 154
 It appears that my understanding is incomplete since instead of getting XML
 which shows the fixed time I get the above error.  Here is the
 hello_server.wsgi script
 #! /usr/local/bin/python3
 import sys
 import time
 def index(req):
 s = ?xml version=\1.0\? server time=\2010-02004 12:00:00\/server
 return s
 I'm basing this on the code from van der
 mewes http://vandermerwe.co.nz/?p=9, which was written for mod_python, but I
 don't see a reason it shouldn't work.
 Your help in understanding this is appreciated.
 Thanks,
 Joe

 --
 You received this message because you are subscribed to the Google Groups
 modwsgi group.
 To post to this group, send email to modw...@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.




-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modw...@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] General Question

2010-02-08 Thread Carl Nobile
Unless you get mod_wsgi from trunk you won't have a change getting it
to work with python 3 and even then I'm not sure the trunk is fully
3.n compatible yet.

I use the Django framework for almost all my web projects now. Django
is written in python, but uses Python v2 not V3. There are few if any
packages that use Python 3 yet, Guido expected at least five years for
people to make the switch and we're only 1.5 years into his plan.
Stick with Python 2.6 for now. With this said you should have no
problem using JS/AJAX to update your site's pages, mod_wsgi won't
stand in your way with this at all.

This is a short and not very robust example of a mod_wsgi hook file:

def application(environ, start_response):
status = '200 OK'
output = Hello World! (Oh Shit it works.)
response_headers = [('Content-Type', 'text/plain'),
('Content-Length', str(len(output)))]
start_response(status, response_headers)
return [output]

This can be made into a class using the __call__ method.

~Carl

On Mon, Feb 8, 2010 at 12:53 PM, Joe Hughes jwhughe...@gmail.com wrote:
 Hi Carl,

        I've been reading the Quick Configuration Guide and now I'm a bit 
 worried.  My plan is to have javascript do the html and talk to the python3 
 and have python3 do the Oracle DB access.  My read of the guide tells me that 
 mod_wsgi doesn't allow this type of architecture.  Or am I still 
 misunderstanding?  This is my first web project and I still don't get all the 
 concepts involved.

 Thanks,
 Joe

 On Feb 8, 2010, at 10:29 AM, Carl Nobile wrote:

 If it was written for mod_python and you don't make the appropriate
 changes for mod_wsgi it will not work at all. You must return a python
 list object from the hook script in your care 'hello_server.wsgi', but
 this is not all. It's really very simple, but it is not at all like
 mod_python.

 You really need to read the docs: http://code.google.com/p/modwsgi/w/list

 ~Carl

 On Mon, Feb 8, 2010 at 10:21 AM, Joe Hughes jwhughe...@gmail.com wrote:
 All,
 I'm a bit confused.  I have two files
 test_ajax_mod_wsgi.html
 hello_server.wsgi
 And I'm not getting what I expect.  I get this error
 XML response error

 Content-type:text/plain

 Response: #!/usr/local/bin/python3 import sys import time def index(req): s
 =   return s

 when I send an AJAX request to the server.  This is the output of the
 access_log
 141.232.2.115 - - [08/Feb/2010:10:06:28 -0500] GET
 /netboss/test_ajax_mod_python.html HTTP/1.1 200 3183
 141.232.2.115 - - [08/Feb/2010:10:06:31 -0500] POST
 /netboss/hello_server.wsgi HTTP/1.1 200 154
 It appears that my understanding is incomplete since instead of getting XML
 which shows the fixed time I get the above error.  Here is the
 hello_server.wsgi script
 #! /usr/local/bin/python3
 import sys
 import time
 def index(req):
 s = ?xml version=\1.0\? server time=\2010-02004 12:00:00\/server
 return s
 I'm basing this on the code from van der
 mewes http://vandermerwe.co.nz/?p=9, which was written for mod_python, but I
 don't see a reason it shouldn't work.
 Your help in understanding this is appreciated.
 Thanks,
 Joe

 --
 You received this message because you are subscribed to the Google Groups
 modwsgi group.
 To post to this group, send email to modw...@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.




 --
 ---
 Carl J. Nobile (Software Engineer)
 carl.nob...@gmail.com
 ---

 --
 You received this message because you are subscribed to the Google Groups 
 modwsgi group.
 To post to this group, send email to modw...@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 modw...@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.





-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

-- 
You received this message because you are subscribed to the Google Groups 
modwsgi group.
To post to this group, send email to modw...@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] Threading and GIL issues.

2010-01-17 Thread Carl Nobile
Graham,

This sounds really good. Guido always said that getting rid of the GIL was a
non starter, this seems like the next best thing.

Now any word on an updated WSIG spec?

Carl

On Sun, Jan 17, 2010 at 9:05 PM, 杨小勇 yan5y...@gmail.com wrote:

 Thanks,

 On Mon, Jan 18, 2010 at 9:08 AM, Jason Garber b...@gahooa.com wrote:

 Great presentation.  Thanks for sharing.

 On Sun, Jan 17, 2010 at 5:29 PM, Graham Dumpleton 
 graham.dumple...@gmail.com wrote:

 For those who understand the problems the GIL introduces in Python,
 you may want to read:

  http://www.dabeaz.com/python/NewGIL.pdf

 Would be nice to see this back ported to Python 2.X series as could
 help out mod_wsgi performance.

 Graham

 --
 You received this message because you are subscribed to the Google Groups
 modwsgi group.
 To post to this group, send email to modw...@googlegroups.com.
 To unsubscribe from this group, send email to
 modwsgi+unsubscr...@googlegroups.commodwsgi%2bunsubscr...@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 modw...@googlegroups.com.
 To unsubscribe from this group, send email to
 modwsgi+unsubscr...@googlegroups.commodwsgi%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/modwsgi?hl=en.




 --
 [+]---{+}
 {+}--[+]
 -=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=

 Eric_yang
 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==

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




-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---
-- 

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

To post to this group, send email to modw...@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: apache fails to start because it interprets python statement as apache command

2009-12-15 Thread Carl Nobile
What is in the apache error.log file when you see this or is it not getting
that far?

~Carl

On Tue, Dec 15, 2009 at 1:57 PM, Damjan gdam...@gmail.com wrote:

  But when i try to start apache, i get this message:
 
  Starting web server: apache2Syntax error on line 1 of /home/user/
  domains/mydomain.com/apache/test.wsgi:
  Invalid command 'def', perhaps misspelled or defined by a module not
  included in the server configuration
   failed!
 
  What am i doing wrong? Any advice would be much appreciated.

 Are you Include-ing the .wsgi script somewhere??

 Check all the Include commands in your apache configuration.

 --

 You received this message because you are subscribed to the Google Groups
 modwsgi group.
 To post to this group, send email to modw...@googlegroups.com.
 To unsubscribe from this group, send email to
 modwsgi+unsubscr...@googlegroups.commodwsgi%2bunsubscr...@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 modw...@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: Couldn't create worker

2009-10-29 Thread Carl Nobile
Graham, It looks like that when the max thread count was hit my app started
writing files as root user. Our sysadmins told me that we are using a fused
file system where our media is located in our staging environment, but we
are not doing this in production. The kernel module for this is
fuse-unionfs.

So I am looking at possible two issues here. One when we have hit a max
process/thread count which was 950 and has been reset to 1500 per user. And
two that somehow apache/mod_wsgi dropped my app into root when the max
thread count was reached or the fused file system caused the apps file
creations to be done as root even though the app was not running as a non
root user.

I really hope that neither apache or mod_wsgi caused this app to become root
since that could be a serious security issue. I thought you should know in
case this is a mod_wsgi issue. Though I find it hard to beleive that either
apache or mod_wsgi could do that.

~Carl

On Wed, Oct 28, 2009 at 10:22 PM, Graham Dumpleton 
graham.dumple...@gmail.com wrote:


 2009/10/29 Carl Nobile carl.nob...@gmail.com:
  This is in our apache conf file.
 
  WSGISocketPrefix /tmp/wsgi

 It is not recommended that /tmp/wsgi be used as socket prefix.
 Directory they are in should only be writable by root. This is
 documented in:


 http://code.google.com/p/modwsgi/wiki/ConfigurationIssues#Location_Of_UNIX_Sockets

  While writing a thumbnail service in Django I found the messages below
  in the apache error log for the application. Has anybody ever seen
  this before? Touching the Django .wsgi file didn't fix it only
  restarting apache seemed to fix it.
 
  We are using mod_wsgi version 2.3
 
  ~Carl
  --
 
  [Wed Oct 28 15:01:22 2009] [debug] mod_wsgi.c(8455): mod_wsgi
  (pid=9449): Starting thread 4 in daemon process 'thumb'.
  [Wed Oct 28 15:01:22 2009] [alert] (11)Resource temporarily
  unavailable: mod_wsgi (pid=9449): Couldn't create worker thread 3 in
  daemon process 'thumb'

 Likely from:

 pthread_create() will fail if:

 [EAGAIN]   The system lacked the necessary resources to create
another thread, or the system-imposed limit on the
total number of threads in a process
[PTHREAD_THREADS_MAX] would be exceeded.

 This suggests threads per process, but since those threads are only
 created on startup one wouldn't expect that unless there could be
 other system wide limits that were being hit.

 Graham

 



-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

--~--~-~--~~~---~--~~
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] Couldn't create worker

2009-10-28 Thread Carl Nobile

While writing a thumbnail service in Django I found the messages below
in the apache error log for the application. Has anybody ever seen
this before? Touching the Django .wsgi file didn't fix it only
restarting apache seemed to fix it.

We are using mod_wsgi version 2.3

~Carl
--

[Wed Oct 28 15:01:22 2009] [debug] mod_wsgi.c(8455): mod_wsgi
(pid=9449): Starting thread 4 in daemon process 'thumb'.
[Wed Oct 28 15:01:22 2009] [alert] (11)Resource temporarily
unavailable: mod_wsgi (pid=9449): Couldn't create worker thread 3 in
daemon process 'thumb'
.
[Wed Oct 28 15:01:27 2009] [debug] mod_wsgi.c(8455): mod_wsgi
(pid=9449): Starting thread 5 in daemon process 'thumb'.
[Wed Oct 28 15:01:27 2009] [alert] (11)Resource temporarily
unavailable: mod_wsgi (pid=9449): Couldn't create worker thread 4 in
daemon process 'thumb'
.
[Wed Oct 28 15:01:32 2009] [debug] mod_wsgi.c(8455): mod_wsgi
(pid=9449): Starting thread 6 in daemon process 'thumb'.
[Wed Oct 28 15:01:32 2009] [alert] (11)Resource temporarily
unavailable: mod_wsgi (pid=9449): Couldn't create worker thread 5 in
daemon process 'thumb'
.
[Wed Oct 28 15:01:37 2009] [debug] mod_wsgi.c(8455): mod_wsgi
(pid=9449): Starting thread 7 in daemon process 'thumb'.
[Wed Oct 28 15:01:37 2009] [alert] (11)Resource temporarily
unavailable: mod_wsgi (pid=9449): Couldn't create worker thread 6 in
daemon process 'thumb'
.
[Wed Oct 28 15:01:42 2009] [debug] mod_wsgi.c(8455): mod_wsgi
(pid=9449): Starting thread 8 in daemon process 'thumb'.
[Wed Oct 28 15:01:42 2009] [alert] (11)Resource temporarily
unavailable: mod_wsgi (pid=9449): Couldn't create worker thread 7 in
daemon process 'thumb'
.
[Wed Oct 28 15:01:47 2009] [debug] mod_wsgi.c(8455): mod_wsgi
(pid=9449): Starting thread 9 in daemon process 'thumb'.
[Wed Oct 28 15:01:47 2009] [alert] (11)Resource temporarily
unavailable: mod_wsgi (pid=9449): Couldn't create worker thread 8 in
daemon process 'thumb'
.
[Wed Oct 28 15:01:52 2009] [debug] mod_wsgi.c(8455): mod_wsgi
(pid=9449): Starting thread 10 in daemon process 'thumb'.
[Wed Oct 28 15:01:52 2009] [alert] (11)Resource temporarily
unavailable: mod_wsgi (pid=9449): Couldn't create worker thread 9 in
daemon process 'thumb'
.
[Wed Oct 28 15:01:57 2009] [info] mod_wsgi (pid=9449): Shutdown
requested 'thumb'.
[Wed Oct 28 15:01:57 2009] [alert] (11)Resource temporarily
unavailable: mod_wsgi (pid=9449): Couldn't create reaper thread in
daemon process 'thumb'.
[Wed Oct 28 15:01:57 2009] [info] mod_wsgi (pid=9449): Stopping
process 'thumb'.
[Wed Oct 28 15:01:57 2009] [info] mod_wsgi (pid=9449): Cleanup
interpreter ''.
[Wed Oct 28 15:01:57 2009] [info] mod_wsgi (pid=9449): Terminating
Python.
[Wed Oct 28 15:01:58 2009] [info] mod_wsgi (pid=9950): Attach
interpreter ''.
[Wed Oct 28 15:01:58 2009] [debug] mod_wsgi.c(8449): mod_wsgi
(pid=9950): Starting 10 threads in daemon process 'thumb'.
[Wed Oct 28 15:01:58 2009] [debug] mod_wsgi.c(8455): mod_wsgi
(pid=9950): Starting thread 1 in daemon process 'thumb'.
[Wed Oct 28 15:01:58 2009] [debug] mod_wsgi.c(8455): mod_wsgi
(pid=9950): Starting thread 2 in daemon process 'thumb'.
[Wed Oct 28 15:01:58 2009] [debug] mod_wsgi.c(8455): mod_wsgi
(pid=9950): Starting thread 3 in daemon process 'thumb'.
[Wed Oct 28 15:01:58 2009] [info] mod_wsgi (pid=9950): Enable monitor
thread in process 'thumb'.
[Wed Oct 28 15:01:58 2009] [debug] mod_wsgi.c(8301): mod_wsgi
(pid=9950): Deadlock timeout is 300.
[Wed Oct 28 15:01:58 2009] [debug] mod_wsgi.c(8304): mod_wsgi
(pid=9950): Inactivity timeout is 0.
[Wed Oct 28 15:01:58 2009] [info] mod_wsgi (pid=9950): Enable deadlock
thread in process 'thumb'.
[Wed Oct 28 15:01:58 2009] [alert] (11)Resource temporarily
unavailable: mod_wsgi (pid=9950): Couldn't create worker thread 2 in
daemon process 'thumb'.

--~--~-~--~~~---~--~~
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: Couldn't create worker

2009-10-28 Thread Carl Nobile
This is in our apache conf file.

WSGISocketPrefix /tmp/wsgi

VirtualHost *:80
ServerName thumb.scrippsing.com
ServerAlias lb.thumb.scrippsing.com
ServerAlias dev.thumb.scrippsing.com lb.dev.thumb.scrippsing.com
ServerAlias stage.thumb.scrippsing.com lb.stage.thumb.scrippsing.com

# Possible values include: debug, info, notice, warn, error, crit,
alert, emerg.
LogLevel debug
ErrorLog /logs/apache/dev_thumb-error.log
CustomLog /logs/apache/dev_thumb-access.log combined

WSGIDaemonProcess thumb user=ellington group=ellington \
  processes=4 threads=10 maximum-requests=1000
WSGIProcessGroup thumb

WSGIScriptAlias / /opt/local/apps/apps-django-1.0/thumb/apache/app.wsgi

Alias /media /opt/local/apps/apps-django-1.0/thumb/thumb/media

/VirtualHost


On Wed, Oct 28, 2009 at 3:49 PM, Carl Nobile carl.nob...@gmail.com wrote:

 While writing a thumbnail service in Django I found the messages below
 in the apache error log for the application. Has anybody ever seen
 this before? Touching the Django .wsgi file didn't fix it only
 restarting apache seemed to fix it.

 We are using mod_wsgi version 2.3

 ~Carl
 --

 [Wed Oct 28 15:01:22 2009] [debug] mod_wsgi.c(8455): mod_wsgi
 (pid=9449): Starting thread 4 in daemon process 'thumb'.
 [Wed Oct 28 15:01:22 2009] [alert] (11)Resource temporarily
 unavailable: mod_wsgi (pid=9449): Couldn't create worker thread 3 in
 daemon process 'thumb'
 .
 [Wed Oct 28 15:01:27 2009] [debug] mod_wsgi.c(8455): mod_wsgi
 (pid=9449): Starting thread 5 in daemon process 'thumb'.
 [Wed Oct 28 15:01:27 2009] [alert] (11)Resource temporarily
 unavailable: mod_wsgi (pid=9449): Couldn't create worker thread 4 in
 daemon process 'thumb'
 .
 [Wed Oct 28 15:01:32 2009] [debug] mod_wsgi.c(8455): mod_wsgi
 (pid=9449): Starting thread 6 in daemon process 'thumb'.
 [Wed Oct 28 15:01:32 2009] [alert] (11)Resource temporarily
 unavailable: mod_wsgi (pid=9449): Couldn't create worker thread 5 in
 daemon process 'thumb'
 .
 [Wed Oct 28 15:01:37 2009] [debug] mod_wsgi.c(8455): mod_wsgi
 (pid=9449): Starting thread 7 in daemon process 'thumb'.
 [Wed Oct 28 15:01:37 2009] [alert] (11)Resource temporarily
 unavailable: mod_wsgi (pid=9449): Couldn't create worker thread 6 in
 daemon process 'thumb'
 .
 [Wed Oct 28 15:01:42 2009] [debug] mod_wsgi.c(8455): mod_wsgi
 (pid=9449): Starting thread 8 in daemon process 'thumb'.
 [Wed Oct 28 15:01:42 2009] [alert] (11)Resource temporarily
 unavailable: mod_wsgi (pid=9449): Couldn't create worker thread 7 in
 daemon process 'thumb'
 .
 [Wed Oct 28 15:01:47 2009] [debug] mod_wsgi.c(8455): mod_wsgi
 (pid=9449): Starting thread 9 in daemon process 'thumb'.
 [Wed Oct 28 15:01:47 2009] [alert] (11)Resource temporarily
 unavailable: mod_wsgi (pid=9449): Couldn't create worker thread 8 in
 daemon process 'thumb'
 .
 [Wed Oct 28 15:01:52 2009] [debug] mod_wsgi.c(8455): mod_wsgi
 (pid=9449): Starting thread 10 in daemon process 'thumb'.
 [Wed Oct 28 15:01:52 2009] [alert] (11)Resource temporarily
 unavailable: mod_wsgi (pid=9449): Couldn't create worker thread 9 in
 daemon process 'thumb'
 .
 [Wed Oct 28 15:01:57 2009] [info] mod_wsgi (pid=9449): Shutdown
 requested 'thumb'.
 [Wed Oct 28 15:01:57 2009] [alert] (11)Resource temporarily
 unavailable: mod_wsgi (pid=9449): Couldn't create reaper thread in
 daemon process 'thumb'.
 [Wed Oct 28 15:01:57 2009] [info] mod_wsgi (pid=9449): Stopping
 process 'thumb'.
 [Wed Oct 28 15:01:57 2009] [info] mod_wsgi (pid=9449): Cleanup
 interpreter ''.
 [Wed Oct 28 15:01:57 2009] [info] mod_wsgi (pid=9449): Terminating
 Python.
 [Wed Oct 28 15:01:58 2009] [info] mod_wsgi (pid=9950): Attach
 interpreter ''.
 [Wed Oct 28 15:01:58 2009] [debug] mod_wsgi.c(8449): mod_wsgi
 (pid=9950): Starting 10 threads in daemon process 'thumb'.
 [Wed Oct 28 15:01:58 2009] [debug] mod_wsgi.c(8455): mod_wsgi
 (pid=9950): Starting thread 1 in daemon process 'thumb'.
 [Wed Oct 28 15:01:58 2009] [debug] mod_wsgi.c(8455): mod_wsgi
 (pid=9950): Starting thread 2 in daemon process 'thumb'.
 [Wed Oct 28 15:01:58 2009] [debug] mod_wsgi.c(8455): mod_wsgi
 (pid=9950): Starting thread 3 in daemon process 'thumb'.
 [Wed Oct 28 15:01:58 2009] [info] mod_wsgi (pid=9950): Enable monitor
 thread in process 'thumb'.
 [Wed Oct 28 15:01:58 2009] [debug] mod_wsgi.c(8301): mod_wsgi
 (pid=9950): Deadlock timeout is 300.
 [Wed Oct 28 15:01:58 2009] [debug] mod_wsgi.c(8304): mod_wsgi
 (pid=9950): Inactivity timeout is 0.
 [Wed Oct 28 15:01:58 2009] [info] mod_wsgi (pid=9950): Enable deadlock
 thread in process 'thumb'.
 [Wed Oct 28 15:01:58 2009] [alert] (11)Resource temporarily
 unavailable: mod_wsgi (pid=9950): Couldn't create worker thread 2 in
 daemon process 'thumb'.




-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com

[modwsgi] Re: redirect

2009-09-01 Thread Carl Nobile

There is no python API in mod_wsgi like there is in mod_python. WSGI
is a standardized interface for any type of web application written in
Python. So the short answer to your question is that you need to
assemble the correct header. It is the header in the HTTP protocol
that does this, not something that is sent in your data.

As you can see in the demo below, it is creating its own header and
passing it to mod_wsgi. You would just set the status to 301 Moved
Permanently or any of the 300 group of status codes that you want to
send. Then, set the Location header to your redirected URI/URL.

Get the RFC-2616 it explains all of this.

def application(environ, start_response):
status = '200 OK'
output = Hello World! (It works.)
response_headers = [('Content-Type', 'text/plain'),
 ('Content-Length',
str(len(output)))]
start_response(status, response_headers)
return [output]

-Carl

On Tue, Sep 1, 2009 at 2:59 PM, Joni Töyryläjonitoyry...@gmail.com wrote:

 How can i do internal redirect in mod_wsgi? Like in mod_python
 util.redirect(req,url).

 




-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

--~--~-~--~~~---~--~~
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: from mod_python

2009-07-27 Thread Carl Nobile

This is the main site for docs.

http://code.google.com/p/modwsgi/w/list

If you do a search I recall a thread on this list from not too long
ago that may also help with what you are looking for.

-Carl

On Mon, Jul 27, 2009 at 9:12 AM, Rakotomandimby
Mihaminamiham...@gulfsat.mg wrote:

 Hi all

 I run Linux and used to make simple pages with mod_python.
 I would like to switch to mod_wsgi.

 Would you know a tutorial, just like this?
 http://webpython.codepoint.net/wsgi_tutorial

 I am looking for much documentation...
 Thank you.

 --
                             Architecte Informatique:
    Administration Systeme, Recherche  Developpement
                                   + 261 32 11 401 65
 Pensez a l'environnement avant d'imprimer ce message

 




-- 
---
Carl J. Nobile (Software Engineer)
carl.nob...@gmail.com
---

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



  1   2   >