on i4PACE(i for Personal Archiving and Creating Environment)
actions » SearchLogin 89 articles • 30 Jul 2010

Article with comments

Monday, 01 Dec 2008

permalink Pinax deployment using mod_wsgi

Try to run Pinax using mod_wsgi.

Use the exemple ~/pinax/projects/complete_project/deploy/complete_project.wsgi. Create an Apache2 configuration file pinax_complete_project_site at /etc/apache2/sites-available as follows:

WSGIScriptAlias / /home/yarrow/pinax/projects/complete_project/deploy/complete_project.wsgi
WSGIDaemonProcess complete_project user=yarrow group=yarrow threads=25
WSGIProcessGroup complete_project

Alias /media/ /var/lib/python-support/python2.5/django/contrib/admin/media/
<Directory /var/lib/python-support/python2.5/django/contrib/admin/media>
Order deny,allow
Options Indexes
Allow from all
IndexOptions FancyIndexing
</Directory>

Alias /site_media/ /home/yarrow/pinax/projects/complete_project/site_media/
<Directory /home/yarrow/pinax/projects/complete_project/media>
Order deny,allow
Allow from all
</Directory>

<Directory /home/yarrow/pinax/projects/complete_project/deploy>
Order deny,allow
Allow from all
</Directory>

Load the file by

$ sudo a2ensite pinax_complete_project_site

Rerun

$ python manage.py syncdb

Run Apache by

$ sudo /etc/init.d/apache2 start

Got errors. Modified settings.py: The line

DATABASE_NAME = 'dev.db'

is changed to

basepath = os.path.dirname(__file__)
DATABASE_NAME = os.path.join(basepath, 'database.sqlite')

or, according to a tip on pinax-user,

DATABASE_NAME = PROJECT_ROOT + '/dev.db'

'dev.db' worked for me.

Rerun manage.py and apache2.

OK, it worked :-)

Added the following code at the top of /etc/apache2/sites-available/pinax_complete_project_site

# Don't expose .svn files/directories    
<DirectoryMatch "^/.*/\.svn/">
    Order deny,allow
    Deny from all
</DirectoryMatch>

References:

  1. http://pinaxproject.com/docs/trunk/deployment.html
  2. http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango
  3. http://it.kndb.jp/entry/show/id/2370
• Wrote Teru at 12:05 (edited 4×, last on 01 Dec 2008) | read 626× | Add comment

Comments (1)

DW7wiy <a href="http://lfaurzfdhqkn.com/">lfaurzfdhqkn</a>, dwhiycncqnwy, [link=http://kisiwhhxaeps.com/]kisiwhhxaeps[/link], http://imouxjbstolv.com/

• wrote nrmwayka (ip) on 21 Jun 2009, 09:01  permalink


Write a comment

Your name  
E-mail   (only visible for blog owner)
Homepage
How much is 4×2?   (protection against spam-bots)
Text:

[b] [i] [u] [tt] [center] [code] [quote] [url] [url=] [img] [@] [@@] [@:]
detailed help about markup
Process times: page=0.017 request=0.033 cpu=0.040