I wonder what the best practice where we put a website/application on a server. Commonly there that we should not put them in our folder
/var/wwwfor several reasons.
I was searching and found two alternatives to host the site
Put it in the folder
/srv/www/example.com(reference here) and give permission only to administrative users to it. Other services, such as FTP, would be in
/srv/ftp/example.com. The purpose of the
/srvfolder we can see here.
Treat the application as if it were a user (reference here). In this case the user would be
exampleand the application would be staying in
/home/example/public_htmland perhaps FTP in
So, is there any better practice than these two? What is the most recommended and why? What are the advantages and disadvantages of each?
PS. 1: If there are any better suggestions, please write a description of it stating what are your strengths and weaknesses.
PS. 2: For while I'm using
Ubuntu 12.10 Server.
If there is any tutorial or guide that defines which folders are the best to host the various features of an application (such as logs, services, settings, etc..), I really would like to know.