Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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 example.com:

  1. 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 /srv folder we can see here.

  2. Treat the application as if it were a user (reference here). In this case the user would be example and the application would be staying in /home/example/public_html and perhaps FTP in / home/example/ftp.

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.

share|improve this question

closed as not constructive by Thomas W., Eric Carvalho, Basharat Sialvi, Luis Alvarado Apr 19 '13 at 14:30

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

An interesting related article can be found here –  Lucio Apr 18 '13 at 23:07
I wil add to the text. Thx. –  GarouDan Apr 18 '13 at 23:16
There is no one true "Best practice" for this. –  Thomas W. Apr 19 '13 at 0:03
@TheLordofTime, how you have certain of your afirmation? Could I suppose not too, but maybe we have one. –  GarouDan Apr 19 '13 at 23:05
@GarouDan I'm absolutely certain. Depending on your use case, there's various different "acceptable practices" for each use case, and there's no one true "This fits all things" practice. As an IT Security person, and an Server Administrator for several services, I speak from experience. Also, "Not Constructive" because this can't be supported by facts enough to warrant one practice over another. –  Thomas W. Apr 20 '13 at 16:16