下载配置lighttpd

  1. 创建开发子目录 dev/,下载 Lighttpd 源代码并解压到其下,最新 Lighttpd 稳定版代码为 lighttpd-1.4.19
    $ mkdir dev
    $ cd dev
    $ wget http://www.lighttpd.net/download/lighttpd-1.4.19.tar.bz2
    $ tar xjf lighttpd-1.4.19.tar.bz2
    $ cd lighttpd-1.4.19 
    
  2. 安装必要的开发包:
    $ ports/bzip2-devel
    
  3. 编译安装(如果没有设置sudo,需要su为root用户):
    $ ./configure
    $ make
    $ sudo make install
    
    安装完成后 lighttpd 就被安装到了 /usr/local/sbin/lighttpd 这个位置上。
  4. 新建 lighttpd 配置文件 /usr/local/etc/lighttpd.conf (路径随意,lighttpd 启动时指定正确的配置文件路径即可),内容如下:
    server.document-root = "/home/share/htdocs/lighttpd"
    server.port = 7500
    server.username= "nobody"
    server.groupname = "nobody"
    server.modules = ( "mod_access", "mod_accesslog" )
    
    # performance settings
    server.max-worker = 8
    server.max-fds = 2048
    server.max-connections = 1024
    # no keep-alive permitted
    server.max-keep-alive-requests=0
    
    # specify possible index files for root directory
    index-file.names = ( "index.html", "index.htm" )
    
    # mimetype mapping
    mimetype.assign = (
        ".html"         =>      "text/html",
        ".htm"          =>      "text/html",
        # default mime type
        ""              =>      "application/octet-stream",
    )
    
    # error log file path
    server.errorlog = "/tmp/error"
    
    # access log file path
    accesslog.filename = "/tmp/access"
    
    # WebDAV options
    webdav.activate = "enable"
    webdav.is-readonly = "disable"
    
  5. 启动 lighttpd:
    $ sudo /usr/local/sbin/lighttpd -f /usr/local/etc/lighttpd.conf
    
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值