xiaochuan 发表于 2017-2-20 09:18:08

lighttpd+resin 负载均衡 收藏

  lighttpd+resin 负载均衡 收藏
1.Lighttpd:
  下载最新版本:
  wget http://www.lighttpd.net/download/lighttpd-1.4.16.tar.gz
  tar zxvf lighttpd-1.4.16.tar.gz
  cd lighttpd-1.4.16
  ./configure --prefix=/usr/local/lighttpd1416
  make
  make install
  cp doc/rc.lighttpd.redhat /etc/rc.d/init.d/lighttpd
  cp doc/sysconfig.lighttpd /etc/sysconfig/lighttpd
  mkdir /etc/lighttpd
  cp doc/lighttpd.conf /usr/local/lighttpd1416/conf/lighttpd.conf
  chkconfig lighttpd on
  接下来打开/etc/rc.d/init.d/lighttpd修改lighttpd的值如下
  LIGHTTPD_CONF_PATH="/usr/local/lighttpd1416/conf/lighttpd.conf"
  lighttpd="/usr/local/lighttpd1416/sbin/lighttpd"
  vi /etc/sysconfig/lighttpd
  LIGHTTPD_CONF_PATH=/usr/local/lighttpd1416/conf/lighttpd.conf
  shell> service lighttpd start
  更多关于lighttpd的配置请看lighttpd的文档
  2:resin的cluster配置
  下载Resin,tar zxvf resin.*.*.tar.gz
  Cd resin
  ./configure –prefix=/usr/local/resin
  Make&&make install
  Vi resin.conf
  <cluster id="app-space"> 
 
<server id="space" address="127.0.0.1" port="6804"> <watchdog-jvm-arg>-Dcom.sun.management.jmxremote</watchdog-jvm-arg> 
 
<watchdog-port>6604</watchdog-port> 
 
<thread-max>50</thread-max> 
 
<jvm-arg>-Xmx256m</jvm-arg> 
 
<jvm-arg>-XX:MaxPermSize=64m</jvm-arg> 
 
<jvm-arg>-Xdebug</jvm-arg> 
 
<jvm-arg>-Xnoagent</jvm-arg> 
 
<jvm-arg>-Djava.compiler=NONE</jvm-arg> 
 
<jvm-arg>-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9999</jvm-arg> 
 
<http id="" port="8084"/> 
 
</server> 
 
<host id="17.16.9.27" root-directory="/www/htdocs/webapps"> 
 
<stdout-log path='/www/htdocs/logs/resin/space/stdout.log' rollover-period='1D'/> 
 
<stderr-log path='/www/htdocs/logs/resin/space/stderr.log' rollover-period='1D'/> 
 
<access-log path='/www/htdocs/logs/resin/space/access.log' rollover-period='1D'/> 
 
<web-app id="/" root-directory="space"/> 
 
</host> 
 
</cluster> 
<cluster id="app-space">
  <server id="space" address="127.0.0.1" port="6804"> <watchdog-jvm-arg>-Dcom.sun.management.jmxremote</watchdog-jvm-arg>
  <watchdog-port>6604</watchdog-port>
  <thread-max>50</thread-max>
  <jvm-arg>-Xmx256m</jvm-arg>
  <jvm-arg>-XX:MaxPermSize=64m</jvm-arg>
  <jvm-arg>-Xdebug</jvm-arg>
  <jvm-arg>-Xnoagent</jvm-arg>
  <jvm-arg>-Djava.compiler=NONE</jvm-arg>
  <jvm-arg>-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9999</jvm-arg>
  <http id="" port="8084"/>
  </server>
  <host id="17.16.9.27" root-directory="/www/htdocs/webapps">
  <stdout-log path='/www/htdocs/logs/resin/space/stdout.log' rollover-period='1D'/>
  <stderr-log path='/www/htdocs/logs/resin/space/stderr.log' rollover-period='1D'/>
  <access-log path='/www/htdocs/logs/resin/space/access.log' rollover-period='1D'/>
  <web-app id="/" root-directory="space"/>
  </host>
  </cluster>
 
  Resin 启动命令 :bin/httpd.sh –server space start|stop|restart
  本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/gumanren/archive/2010/06/11/5663068.aspx
页: [1]
查看完整版本: lighttpd+resin 负载均衡 收藏