I’m a beginner with Pylons and I’ve mostly developed on my localhost using the built-in web server. I think it’s time to start deployment for my personal blog, I have a Debian Lenny server with apache2-mpm-prefork module and mod_wsgi – I’ve never really used mod_wsgi or fastcgi and I hear either of these are the way to go.
My questions:
- Should I go with
mod_wsgiorfastcgiand why? - Where should I be creating my web application? Should I create an entirely new user for it? Should I store it in
/home/meder/web-app? I currently have some php websites being hosted on my server and they live in/www/which is a directory I created. Is there any sorta gotcha with static binary files such as images, as there is withdjango?
mod_wsgi. It’s more efficient. FastCGI can be troublesome to setup, whereas I’ve never known anyone to have a problem using mod_wsgi with a supported version of Python (2.5, 2.6, 3.1 included). WSGI exists for Python (by Python, &c.) and so it makes for a more “Pythonic” experience. Prior to WSGI I used to serve small Pylons apps via paste behind mod_proxy (due to massive issues with fastcgi).
Anywhere is fine, any user is fine. If you’re worried about security, you may wish to add another user. You could create a home folder in /www/ if you were so inclined 🙂 Static binary files, images, etc., should be served separately if you can, but Pylons had (actually, I believe still does have) a method of serving these (this should be the ‘public’ folder). I would still use a separate mount as Apache is more efficient at serving these than passing them through Pylons.