Best practice for web server file structure

Are there any guidelines for scheduling your website on a server?

For example, I currently have a site with this structure:

/var/www/current/html (public dir for most recent revision)
/var/www/dev/html (public dir for dev version)
/home/user/www/html (for users public sandbox)

      

How does everyone else put together the structure of their WWW file?

+1


source to share


3 answers


I don't know any best practice. Storing it in / var is not a bad idea. The layout looks fine and can change at any time. The structure below, resolved with URLs, is much more complicated because it is public and difficult to change afterwards.



+1


source


I am using this:

/srv/#{protocol}/#{host.split('.').reverse.join('/')}/%/

      

So for example http://www.example.net/index.html becomes



/srv/http/net/example/www/%/index.html

      

It closely follows the DNS tree structure, follows the "File System Hierarchy Standard" and makes it easy to delegate control in a similar manner, for example by mapping a user point in DNS to theirs ~/web

or similar. The user can then easily create subdomains withmkdir -p web/sub1/%

+1


source


I think this is the most typical way to do it. I use a lot of subdomains and stuff, so I try to do things like:

/home/user/www/sub1.domain.com/
/home/user/www/sub2.domain.com/

      

0


source







All Articles