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 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 to share