Chinaunix首页 | 论坛 | 博客
  • 博客访问: 15132190
  • 博文数量: 7460
  • 博客积分: 10434
  • 博客等级: 上将
  • 技术积分: 78178
  • 用 户 组: 普通用户
  • 注册时间: 2008-03-02 22:54
文章分类

全部博文(7460)

文章存档

2011年(1)

2009年(669)

2008年(6790)

分类: BSD

2008-11-04 09:48:33

创建开发子目录 dev/, 并解压到其下,最新 Lighttpd 稳定版代码为 lighttpd-1.4.19:
$ mkdir dev
$ cd dev
$ wget
$ xjf lighttpd-1.4.19.tar.bz2
$ cd lighttpd-1.4.19
必要的开发包:
$ ports/bzip2-devel
安装(如果没有设置sudo,需要su为用户):
$ ./configure
$ make
$ sudo make install
安装完成后 lighttpd 就被安装到了 /usr/local/sbin/lighttpd 这个位置上。
新建 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"
启动 lighttpd:
$ sudo /usr/local/sbin/lighttpd -f /usr/local/etc/lighttpd.conf
阅读(601) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~