Recommended place to store and organize web app / virtual environment / ... file

Started by kalpana, Nov 08, 2023, 04:11 AM

Previous topic - Next topic

kalpana

Hello,

I have a Ubuntu VM with my web app, virtual environment, git files, etc...


I was storing my web app files under:
/var/www/website

My virtual environment under:
/usr/local/venvs/myvenv

My git bare repo under:
/home/anthony/git/mybaregit

I am a bit OCD and also I felt like /var/ or /usr/ were only for storing Linux files, etc, not my personal folder (I am new at Unix-like system so I don't know). Thus I moved everything under my /home/anthony/:
Code:
anthony@server:~$ ls
website  git  venvs

Look pretty, looks clean. But how is it, security-wise? I feel like 1 mistake on my /home/anthony/ folder could be painful for the entire project, versus the previous storage way that was spread across multiple folders.


What do you think?
Do people usually store project files, virtual environments, etc., outside or their home directory?
Apparently /var/ is a good place. Would it be wiser to store everything in /var/ rather than /home/, as someone suggested that home is personal, and a website is supposed to be visited by strangers (but as it's a VM, I'm not sure it applied here).
Also while looking at uWSGI doc, they talked about storing the virtual environment under /usr/, so I am a bit confused.

Is there a convention that people usually follow when setting up their project on a Unix-like server?

Thank you very much for your opinion.