Graham Dumpleton wrote:
>
> On Oct 29, 1:51 am, MilesTogoe <[EMAIL PROTECTED]> wrote:
>
>> saptah wrote:
>>
>>> Hi,
>>> I'm really interested in this too :)
>>>
>> I suspect there are folks just quietly using the libraries. Sure, we
>> would like to see more activity too, especially on the mail list instead
>> of IRC (mail lists seem better at building the community). But to
>> answer your question, is something wrong ? bugs? some feature needed
>> ? if not, there is probably no push for the developers to just have
>> another release. We're using the Werkzeug, SQLAlchemy, Jinja stack as
>> in the tutorial and it's working very nicely. But been having trouble
>> with deployment (which I'm working on in the next hour or so), but I
>> think that is more a write up / docs issue and I will post any
>> suggestions I come up with.
>>
>
> Still waiting to see what you come up with for this. I actually tried
> to sit down last night and create a hello world example in Werkzeug to
> use in mod_wsgi documentation, but there isn't such a thing that I can
> find. Well at least to the extent of something really really simple. I
> didn't want to be using more complicated shorty example, and my mind
> wasn't up to trying to reduce it to something simpler last night so
> spent my time on something else instead.
okay - as I'm configuring a new server and trying to deploy our werkzeug
stack app, I'm trying to write some step-step deployment directions that
would add to the existing Shorty Tutorial. Graham, feel free to cut
and paste what you want for the mod_wsgi site. Uh, the docs need lots
of work - I'm not that knowledgeable about apache or mod_wsgi or even
werkzeug so feel free to correct. On the other hand, we're a good
test case for the docs :) I added a bunch of unresolved questions I
have right now. After it's corrected and our site is running, I'll
submit a corrected version. Armin, I will be happy to put this in
restructured text if you would like to post with the other
documentation. We're excited about getting this deployed since my
little company really likes the werkzeug stack over the other frameworks.
*** unresolved issues ***
1) are any environment paths required ie pythonpath
2) recommended place to put application
3) how to specify public access to /static
4) is shorty.wsgi right does it replace manage.py
5) is server root correctly shown
6) what role does document root play here
7) KeepAlive Off ?
8) Listen 7118 ?
9) ServerLimit 3 ? if you have potentially 100 customers hitting at
once should this be 10? 100?
11) Does the htdocs or www directory need to be included ? What about
static ?
12) read thru - probably other mistakes
Deploying The Shorty Application
Thus far the Shorty application has been running on a local server,
called from a "runserver" function in the "manage.py" script. This
function called a "make_app()" function which set the program
"application" variable. Now it's time to deploy this functionality to a
public server.
There are several server configurations that can be used. Using
mod_wsgi with an Apache server offers excellent reliability,
performance, and security and thus, will be demonstrated here.
Ubuntu Apache Server
If you already have an apache server configured, you may skip this
section. Your server can be a dedicated box, a dedicated server rack
box at a provider, a virtual private server (VPS), or even shared
hosting (ie Webfaction). For this example, we will use Ubuntu Hardy as
the operating system. Establishing your server and getting an OS for it
can be found in documentation of your host or elsewhere. You should
also check to be sure your desired url is set in the DNS to point to the
server - the documentation for how to do this depends upon your
registration location and they should have the necessary instructions.
Assuming all that is taken care of, you are ready to load the necessary
software onto your server. You will need to ssh into your server system
and add the following programs:
sudo aptitude install apache2
sudo aptitude install apache2-dev
sudo aptitude install python-dev
sudo aptitude install python-setuptools
for a postgres database you will need:
sudo aptitude install postgres
sudo aptitude install python-pscopg2
Now install the werkzeug stack components:
sudo easy_install SQLAlchemy
sudo easy_install Jinja
sudo easy_install werkzeug
// any env paths needed here ??
Application Files
The Shorty applicaton files will need to be placed on the server. A
typical location could be /home/<user>/web_projects (you should
subsitute the actual user directory for <user>). This directory will
have ...
Apache with mod_wsgi
When deployed with the Apache server, a wsgi script file is called that
sets the "application" variable. It is recommended that the script file
be placed in a directory separate from the application. A recommended
new directory for the script would be /etc/apache2/wsgi_scripts For
this example, the following script "shorty.wsgi" was created:
import os, sys
PROJECT_PATH = /home/<user>/web_projects/shorty
os.environ['PYTHON_EGG_CACHE'] = /etc/lib/python2.5
sys.path.append(PROJECT_PATH)
from shorty import models, utils
from shorty.application import Shorty
application = Shorty()
The wsgi script file will need to be called from the Apache
configuration file (/etc/apache2/httpd.conf). The "server root" will
need to be the directory where Apache is. The mod_wsgi loadmodule will
need to be included. A wsgi script alias needs to be added to point to
the location of the .wsgi script file created above. The wsgi_scripts
directory needs to be assigned permissions with "Allow from all". of
the A typical modifed conf file could look like:
ServerRoot "/etc/apache2"
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule wsgi_module modules/mod_wsgi.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule alias_module modules/mod_alias.so
DocumentRoot /var/www
KeepAlive Off
Listen 7118
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\"
\"%{User-Agent}i\"" combined
CustomLog logs/access_log combined
ServerLimit 3
WSGIScriptAlias / /etc/apache2/wsgi_scripts/shorty.wsgi
<Directory /etc/apache2/wsgi_scripts>
Order allow,deny
Allow from all
</Directory>
<Directory /var/www>
Order allow,deny
Allow from all
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pocoo-libs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/pocoo-libs?hl=en
-~----------~----~----~----~------~----~------~--~---