查看完整版本: [-- lighttpd 分享目录 --]

Ft2 team -> 编程 -> lighttpd 分享目录 [打印本页] 登录 -> 注册 -> 回复主题 -> 发表主题

Francis 2016-01-12 10:58

lighttpd 分享目录

1. Vim  lighttpd_dir.sh, 粘贴后面的内容
2. Chmod a+x lighttpd_dir.sh 添加可执行权限
3. ./lighttpd_dir /home 8080,通过8080端口分享/home目录
[attachment=21]

  1. #!/bin/bash
    cat >._lighttpd_dir_conf << EOF
    server.document-root = "$1"

    server.port = "$2"

    dir-listing.encoding        = "utf-8"
    server.dir-listing          = "enable"

    mimetype.assign = (
      ".pdf"          =>      "application/pdf",
      ".zip"          =>      "application/zip",
      ".mp3"          =>      "audio/mpeg",

      ".jpg"          =>      "image/jpeg",
      ".html"         =>      "text/html",
      ".c"            =>      "text/plain",
      ".txt"          =>      "text/plain",
      ".avi"          =>      "video/x-msvideo",
    )
    EOF
    lighttpd -D -f ._lighttpd_dir_conf







Francis 2016-01-12 11:02
mimetype.assign = (
  ".pdf"          =>      "application/pdf",
  ".sig"          =>      "application/pgp-signature",
  ".spl"          =>      "application/futuresplash",
  ".class"        =>      "application/octet-stream",
  ".ps"           =>      "application/postscript",
  ".torrent"      =>      "application/x-bittorrent",
  ".dvi"          =>      "application/x-dvi",
  ".gz"           =>      "application/x-gzip",
  ".pac"          =>      "application/x-ns-proxy-autoconfig",
  ".swf"          =>      "application/x-shockwave-flash",
  ".tar.gz"       =>      "application/x-tgz",
  ".tgz"          =>      "application/x-tgz",
  ".tar"          =>      "application/x-tar",
  ".zip"          =>      "application/zip",
  ".mp3"          =>      "audio/mpeg",
  ".m3u"          =>      "audio/x-mpegurl",
  ".wma"          =>      "audio/x-ms-wma",
  ".wax"          =>      "audio/x-ms-wax",
  ".ogg"          =>      "application/ogg",
  ".wav"          =>      "audio/x-wav",
  ".gif"          =>      "image/gif",
  ".jpg"          =>      "image/jpeg",
  ".jpeg"         =>      "image/jpeg",
  ".png"          =>      "image/png",
  ".xbm"          =>      "image/x-xbitmap",
  ".xpm"          =>      "image/x-xpixmap",
  ".xwd"          =>      "image/x-xwindowdump",
  ".css"          =>      "text/css",
  ".html"         =>      "text/html",
  ".htm"          =>      "text/html",
  ".js"           =>      "text/javascript",
  ".asc"          =>      "text/plain",
  ".c"            =>      "text/plain",
  ".cpp"          =>      "text/plain",
  ".log"          =>      "text/plain",
  ".conf"         =>      "text/plain",
  ".text"         =>      "text/plain",
  ".txt"          =>      "text/plain",
  ".dtd"          =>      "text/xml",
  ".xml"          =>      "text/xml",
  ".mpeg"         =>      "video/mpeg",
  ".mpg"          =>      "video/mpeg",
  ".mov"          =>      "video/quicktime",
  ".qt"           =>      "video/quicktime",
  ".avi"          =>      "video/x-msvideo",
  ".asf"          =>      "video/x-ms-asf",
  ".asx"          =>      "video/x-ms-asf",
  ".wmv"          =>      "video/x-ms-wmv",
  ".bz2"          =>      "application/x-bzip",
  ".tbz"          =>      "application/x-bzip-compressed-tar",
  ".tar.bz2"      =>      "application/x-bzip-compressed-tar"
)


查看完整版本: [-- lighttpd 分享目录 --] [-- top --]


Powered by phpwind v8.7.1 Code ©2003-2011 phpwind
Time 0.053451 second(s),query:5 Gzip enabled