lighttpd 1.5.0 安装

| |
[不指定 2009/11/26 10:59 | by suibing ]
1.  

yum install gcc glib2-devel openssl-devel pcre-devel bzip2-devel gzip-devel zlib-devel  make

2.

./configure  --prefix=/usr --enable-fastcgi --enable-discard-path --enable-force-cgi-redirect  --with-openssl  --with-linux-aio --with-fam --with-openssl --enable-maintainer-mode  


3

make


4

make install


安装完成后需要去除kloxo中lighttpd中fastcgi模块


5.

设置proxy

$HTTP["host"] == "virtual.host.com" {  
        proxy-core.balancer = "round-robin"  
        proxy-core.protocol = "http"  
        proxy-core.backends = ( "192.168.191.111:80" )  
        proxy-core.allow-x-sendfile = "enable"  
}


设置php-fastcgi

$HTTP["url"] =~ "\.php$" {  
    proxy-core.balancer = "round-robin"  
    proxy-core.allow-x-sendfile = "enable"  
    #proxy-core.check-local = "1"  
    proxy-core.protocol = "fastcgi"  
    proxy-core.backends = ( "unix:/usr/local/lighttpd/var/tmp/php-fastcgi.socket" )  
    proxy-core.max-pool-size = 16  
    $HTTP["host"] == "virtual.host.com" {  
        proxy-core.balancer = "round-robin"  
        proxy-core.protocol = "http"  
        proxy-core.backends = ( "192.168.191.111:80" )  
        proxy-core.allow-x-sendfile = "enable"  
    }  
}



6

lighttpd设置

#使用fam监视文件状态  
server.stat-cache-engine = "fam"  
#keep alive 设为30  
server.max-keep-alive-requests = 30  
#使用epoll的api  
server.event-handler = "linux-sysepoll"  
#使用linux aio,据说速度最快  
server.network-backend = "linux-aio-sendfile"  
server.max-request-size = 10240  
server.max-fds = 2048  
server.max-connections = 1024  
  
#开启压缩  
deflate.enabled = "enable"  
deflate.compression-level = 9  
deflate.mem-level = 9  
deflate.window-size = 15  
deflate.allowed_encodings = ( "bzip2", "gzip", "deflate" )  
deflate.min-compress-size = 200  
#deflate.sync-flush = "enable"  
#deflate.output-buffer-size = 8192  
deflate.work-block-size = 512  
#设置压缩内容的类型  
deflate.mimetypes = ("text/html", "text/plain", "text/css", "text/javascript", "text/xml")  




配置参考
lighttpd-1.5.0 (ssl) – a light and fast webserver
Build-Date: Oct 16 2007 01:07:37

Event Handlers:

             + poll: poll (Unix)
             + select: select (generic)
             + linux-sysepoll: epoll (Linux 2.6)
             + linux-rtsig: rt-signals (Linux 2.4+)
             – solaris-devpoll: /dev/poll (Solaris)
             – freebsd-kqueue: kqueue (FreeBSD)
             – kqueue: kqueue (FreeBSD)

Network Backends:

             + linux-sendfile
             + linux-aio-sendfile
             – freebsd-sendfile
             – solaris-sendfilev
             + posix-aio
             + gthread-aio
             + gthread-sendfile
             + writev
             + write
             – win32-transmitfile
             – win32-send
             + (mmap) support

Features:

             + IPv6 support
             + zlib support
             + bzip2 support
             + crypt support
             + SSL Support
             + PCRE support
             – MySQL support
             – LDAP support
             – memcached support
             – FAM support
             – LUA support
             – xml support
             – SQLite support
             – GDBM support


server.modules               = (
                                 “mod_access”,
                                “mod_proxy_core”,
                             “mod_proxy_backend_fastcgi”,
                                “mod_simple_vhost”,
                                                                 “mod_accesslog” )
server.document-root         = “/usr/web/tmp/”

server.errorlog              = “/var/log/lighttpd/error.log”

index-file.names             = ( “index.html”, “index.htm”,
                                 “index.php”, “default.htm” )

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”,
   “”               =>       “application/octet-stream”,
)

server.tag                  = “Apache”

accesslog.filename           = “/var/log/lighttpd/access.log”

static-file.exclude-extensions = ( “.php”, “.pl”, “.fcgi” )
server.network-backend = “linux-aio-sendfile”
server.max-keep-alive-requests = 0
server.event-handler = “linux-sysepoll”

server.port                 = 80

server.pid-file             = “/var/run/lighttpd.pid”

simple-vhost.server-root    = “/usr/web/”
simple-vhost.default-host   = “www.ttian.net“
simple-vhost.document-root = “/”

dir-listing.activate        = “disable”

server.username             = “nobody”

server.groupname            = “nogroup”

$HTTP["url"] =~ “.php$” {
       proxy-core.balancer = “round-robin”
       proxy-core.allow-x-sendfile = “disable”
       proxy-core.protocol = “fastcgi”
       proxy-core.backends = ( “unix:/tmp/php-fastcgi.sock” )
       proxy-core.max-pool-size = 16
}

技术文章 | 评论(2) | 引用(0) | 阅读(1377)
suibing Email Homepage
2009/12/19 11:08
lighttpd1.5.0中的fastcgi启动方式需要修改,kloxo默认的配置不能启动的
KOK Homepage
2009/12/05 14:46
请问 升级LIGHTTPD 后 KLOXO 会不会出错呢?
分页: 1/1 第一页 1 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
昵称   密码   游客无需密码
网址   电邮   [注册]
               

验证码 不区分大小写