[modwsgi] Re: mod_wsgi and apache on windows

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

First though go watch:

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

It talks about reasons for permissions error.

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

Graham

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

 I used the path to my applications folder:

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

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



[modwsgi] extra threads per process

2011-04-28 Thread Brian D
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.



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.



[modwsgi] WSGIAccessScript

2011-04-28 Thread Massimo Di Pierro
Hello Graham,

I have been using this:
http://code.google.com/p/modwsgi/wiki/AccessControlMechanisms

specifically:

Host Access Controls
The authentication provider and group authorisation features help to
control access based on the identity of a user. Using mod_wsgi 2.0 it
is also possible to limit access based on the machine which the client
is connecting from. The path to the script is defined using the
WSGIAccessScript directive.

WSGIAccessScript /usr/local/wsgi/script/access.wsgi

The name of the function that must exist in the script file is
'allow_access()'. It must return True or False.

def allow_access(environ, host):
return host in ['localhost', '::1']

The 'environ' dictionary passed as first argument is a cut down
version of what would be supplied to the actual WSGI application. This
includes the 'wsgi.errors' object for the purposes of logging error
messages associated with the request.


and I got surprised that environ does not contain HTTP headers. This
would be much more powerful if the allow_access function could look at
the actual HTTP headers of the request.

Why is it this way? Is there any directive to include the headers?

Massimo

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

2011-04-28 Thread Graham Dumpleton
On 29 April 2011 07:49, Massimo Di Pierro massimo.dipie...@gmail.com wrote:
 Hello Graham,

 I have been using this:
 http://code.google.com/p/modwsgi/wiki/AccessControlMechanisms

 specifically:
 
 Host Access Controls
 The authentication provider and group authorisation features help to
 control access based on the identity of a user. Using mod_wsgi 2.0 it
 is also possible to limit access based on the machine which the client
 is connecting from. The path to the script is defined using the
 WSGIAccessScript directive.

 WSGIAccessScript /usr/local/wsgi/script/access.wsgi

 The name of the function that must exist in the script file is
 'allow_access()'. It must return True or False.

 def allow_access(environ, host):
    return host in ['localhost', '::1']

 The 'environ' dictionary passed as first argument is a cut down
 version of what would be supplied to the actual WSGI application. This
 includes the 'wsgi.errors' object for the purposes of logging error
 messages associated with the request.
 

 and I got surprised that environ does not contain HTTP headers. This
 would be much more powerful if the allow_access function could look at
 the actual HTTP headers of the request.

 Why is it this way? Is there any directive to include the headers?

They should be there as HTTP_ variables just like in WSGI environment.

Use pprint.pprint() to dump out 'environ' to log file and then post
what you are getting.

Graham

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



[modwsgi] Invalid command 'WSGIScriptAlias', perhaps misspelled or defined by a module not included in the server configuration

2011-04-28 Thread tan3
Hi,


I installed apache2 and mod-wsgi in ubuntu. I even entered the config
details for WSGI in defualt of apache2

Alias /media/ /home/nagaraj/ghar/templates/media/

Directory /home/nagaraj/ghar/templates/media
Order deny,allow
Allow from all
/Directory

WSGIScriptAlias / /home/nagaraj/ghar/apache/django.wsgi

Directory /home/nagaraj/ghar/apache
Order allow,deny
Allow from all
/Directory

Which here is my Django project related path.

But i got an error saying
Syntax error on line 50 of /etc/apache2/sites-enabled/000-default:
Invalid command 'WSGIScriptAlias', perhaps misspelled or defined by a
module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.
   ...fail!

Can anyone tell, what is wrong here? Please

-- 
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] Invalid command 'WSGIScriptAlias', perhaps misspelled or defined by a module not included in the server configuration

2011-04-28 Thread Graham Dumpleton
You are missing the line:

  LoadModule wsgi_module modules/mod_wsgi.so

(modified as appropriate for your installation).

You don't say how you installed mod_wsgi, from source code or binary OS package.

If from source you need to add it by hand. If from a binary OS package
you generally use the OS supplied command to enable the Apache module.

How did you install mod_wsgi itself?

Graham

On 29 April 2011 12:15, tan3 nagarajtan...@gmail.com wrote:
 Hi,


 I installed apache2 and mod-wsgi in ubuntu. I even entered the config
 details for WSGI in defualt of apache2

        Alias /media/ /home/nagaraj/ghar/templates/media/

        Directory /home/nagaraj/ghar/templates/media
        Order deny,allow
        Allow from all
        /Directory

        WSGIScriptAlias / /home/nagaraj/ghar/apache/django.wsgi

        Directory /home/nagaraj/ghar/apache
        Order allow,deny
        Allow from all
        /Directory

 Which here is my Django project related path.

 But i got an error saying
 Syntax error on line 50 of /etc/apache2/sites-enabled/000-default:
 Invalid command 'WSGIScriptAlias', perhaps misspelled or defined by a
 module not included in the server configuration
 Action 'configtest' failed.
 The Apache error log may have more information.
   ...fail!

 Can anyone tell, what is wrong here? Please

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