1

I have a question that I would appreciate some help with. I want to run a number of sites from my debian server, each with their own virtualenv.

Should I be creating my virtualenv in the www-data or /home/<user_name>/ directory?

Alternatively, could I do something like this:

  • Put my virtualenv in /home/<user_name>/<site_name>
  • Put my sites code in www-data/<site_name>

Thank you for any information you can provide.

J.Zil
  • 1,123
  • 3
  • 21
  • 29

1 Answers1

2

This is more a matter of preference and convention than anything else. On Debian systems, I tend to keep everything web-app-related under /var/www/<site_name>. If users expect to be able to access that directory, I drop a symbolic link to it under their /home/<user_name> directory. This keeps things neatly separated but accessible and would allow you to change parts of the structure later (eg: moving the web site storage) without moving/reconfiguring everything.

shaun m
  • 363
  • 1
  • 2
  • 8
  • Is it right to have virtualenv's under the var/www though? – J.Zil Sep 07 '13 at 19:30
  • There isn't really a 'right' and 'wrong' as long as you're careful to not expose your site's code to the public. Separating code from the virtualenv would certainly be easiest way to accomplish that. – shaun m Sep 08 '13 at 16:10