mkv

lighttpd subdomains

mkv
Aug 11th, 2014
350
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.70 KB | None | 0 0
  1. # How to install this:
  2. #
  3. # 1) As root, save this text document as
  4. #    /etc/lighttpd/conf-enabled/20-subs.conf
  5. #
  6. # 2) As root:   service lighttpd restart
  7. #
  8. # 3) Make a directory called .site in /var/www
  9. #
  10. # 4) Create subdomain directories inside /var/www/.site
  11. #    (for example /var/www/.site/javs)
  12.  
  13.  
  14.  
  15. # enable the dynamic subdomain feature
  16. server.modules += ( "mod_evhost" )
  17. evhost.path-pattern = "/var/www"
  18.  
  19. # this blocks the .site folder from being accessed directly
  20. $HTTP["url"] =~ "^/.site" {
  21.     url.access-deny = ("")
  22. }
  23.  
  24. # and this enables stuff like subdomain.yourdomain.tld
  25. $HTTP["host"] =~ "^[a-zA-Z0-9\._-]+\.yourdomain.tld$" {
  26.     evhost.path-pattern = "/var/www/.site/%3/"
  27. }
Advertisement
Add Comment
Please, Sign In to add comment