It would be nicer if they were using mod_wsgi 2.3 instead as then you
get access to some nice features related to virtual environments as
well as other stuff.
These Debian folks who hold on to old packages and don't upgrade. :-(
Anyway, will describe the minimum that would be required.
> I can put html under my ~user/public_html folder. The main apache
> config load this mod_userdir conf file.
>
> <IfModule mod_userdir.c>
> UserDir public_html
> UserDir disabled root
>
> <Directory /home/*/public_html>
> AllowOverride FileInfo AuthConfig Limit
> Options MultiViews Indexes SymLinksIfOwnerMatch
> ExecCGI IncludesNoExec
> </Directory>
> </IfModule>
>
> Is it gonna give me enought "permission" to run my django site with
> mod_wsgi on this machine ?
> I was thinking about putting the mod_wsgi code in a .htaccess file.
Yes, but this would mean that things run in embedded mode and you
probably don't want that. It would be much better to have a daemon
process(es) setup just for your use.
> If I read this post it seems like I need a AllowOverride All to do
> that, but I don't really know.
> http://www.webhostingtalk.com/showthread.php?t=52930
No, FileInfo and ExecCGI is enough to get you going.
> Does anyone know do I need to deploy a Django site on such machine, or
> is it impossible ?
It is covered in the documentation:
http://code.google.com/p/modwsgi/wiki/ConfigurationGuidelines#The_Apache_Alias_Directive
Look for the bit that talks about .htaccess file.
That said, this is what I suggest you do. Following presumes that your
user account is call 'bsergean'.
First off, have them add in the VirtualHost the lines:
WSGIDaemonProcess bsergean user=bsergean group=bsergean
This will result in a specific daemon process being created that will
run as you, rather than the Apache user. We then make your WSGI
applications run in that daemon process instead.
They should then create inside VirtualHost:
<Directory /home/bsergean/public_html>
# Ensure that your WSGI applications run in your daemon process.
WSGIProcessGroup bsergean
# Enable process reloading mechanism so can just touch WSGI script
file to reload.
# This is only need because you are still using mod_wsgi 1.3, is the
default in 2.X.
WSGIReloadMechanism Process
</Directory>
The instructions for using .htaccess file would then be used:
AddHandler wsgi-script .wsgi
Since you are already getting them to change main Apache configuration
anyway, just as easy to stick that in there instead of .htaccess.
Thus, add it to Directory directive above.
<Directory /home/bsergean/public_html>
# Ensure that your WSGI applications run in your daemon process.
WSGIProcessGroup bsergean
# Mark .wsgi files as WSGI applications.
AddHandler wsgi-script .wsgi
</Directory>
Presuming you called your WSGI script file 'django.wsgi' at had it in
the 'public_html' directory, you would then access it as:
http://host/~bsergeab/django.wsgi/
The only other thing is that if you want Django site to reside at:
then you will also want to use the RewriteRule and WSGI wrapper as
described in documentation I linked to. Just note the example mentions
'site.wsgi' so change as appropriate.
Just to clarify, the use of a daemon process group is optional, but if
I was the person allowing you use the machine, I would not let you use
it unless a daemon process was used. A daemon process is used
specifically to stop your Django application bloating out the main
Apache child server processes. The dangers of that I have recently
blogged about at:
http://blog.dscpl.com.au/2009/03/load-spikes-and-excessive-memory-usage.html
The daemon process must also be used to allow you a way of restarting
your application without having the ability to restart the whole of
Apache. For more information see:
http://code.google.com/p/modwsgi/wiki/ReloadingSourceCode
You obviously can't restart the whole of Apache, but provided
configured correctly, you can force a reload of your application by
just touching the WSGI script file.
Graham
Take a note of where PHP is mentioned in:
http://code.google.com/p/modwsgi/wiki/ApplicationIssues
Also take note of expat library issue which can also affect Python 2.4.
Graham
2009/3/12 Graham Dumpleton <graham.d...@gmail.com>:
As you seem to have already found, that is in part what:
http://code.google.com/p/modwsgi/issues/detail?id=22
is about.
Graham
Here is.
Just hold off a bit on a discussion as possible that will end up
having a general discussion on where mod_wsgi goes from here. This may
include on demand daemon processes, but also whether mod_wsgi should
provide a way of supporting multiple installations/versions of Python
at the same time.
Graham
Reality is though that web hosters, if mod_wsgi is stuck with one
version of Python, will never update it and so over time people using
that service will be stuck with an ancient version of Python. This
already happens, with some web hosters still on Python 2.3 or Python
2.4. If one can make it an easy process to support old and new it is
better. Otherwise they stay at the old, or just use fastcgi instead.
Graham