ddsdjn 发表于 2018-11-30 07:34:10

Lighttpd整合tomcat实践过程


  正则表达式需要tar xzvf pcre-6.6.tar.gz
  make clean
  
  ./configure --prefix=/usr/local/lighttpd
  make install
  
  cp doc/lighttpd.conf /usr/local/lighttpd/etc
  groupadd lighttpd
  chown -R lighttpd.lighttpd /www
  mkdir /lighttpdlogs
  
  cp doc/rc.lighttpd /etc/init.d/lighttpd
  /etc/init.d/lighttpd,将配置文件变量更改为:# LIGHTTPD_CONFIG=/etc/sysconfig/lighttpd
  
二.vi /usr/local/lighttpd/etc/lighttpd.conf
  "mod_rewrite",
  "mod_expire",
  
$HTTP["host"] == "192.168.4.168" {
      server.document-root = "/usr/local/apache2/htdocs"
      server.max-keep-alive-requests=4000
      server.max-fds = 2048
      $HTTP["url"] =~ "^/ReaderServerInvoker/" {
                proxy.server = (
                              "" =>
                              ((
                              "host" => "127.0.0.1",
                              "port" => 8080
                              ))
                              )
      }
         $HTTP["url"] =~ "^/UserLogin/" {
                proxy.server = (
                              "" =>
                              ((
                              "host" => "127.0.0.1",
                              "port" => 8081
                              ))
                              )
      }
}

修改server.document-root和日志的路径:
server.document-root      = "/usr/local/apache2/htdocs/"
server.errorlog             = "/lighttpdlogs/error.log"
accesslog.filename          = "/lighttpdlogs/access.log"

优化lighttpd:
*server.max-keep-alive-requests=4000
这一条比较关键,对性能的影响比较大。在一个4000。
*server.max-fds = 2048
因为1024。如果在一个高负载的站点上,可能你需要通过下面的设定增加这个限定值
Default: 30。
页: [1]
查看完整版本: Lighttpd整合tomcat实践过程