`
s8186255
  • 浏览: 88287 次
  • 性别: Icon_minigender_1
  • 来自: 新疆乌鲁木齐
社区版块
存档分类
最新评论

lighttpd+thin集群配置

阅读更多

1.首先配置lighttpd;
使用源代码安装之后,许多文件并不存在

所以创建如下文件:

touch /var/log/lighttpd/error.log

touch /home/**/app/lighttpd/lighttpd.conf

从源文件的doc目录中找到lighttpd.conf,copy到你预定的目录中即可,然后按照下面的说明修改
a.找到在server.modules              = (
×××××
)
中将"mod_proxy",的注释取消,也就是使mod_proxy功能可用。
b.server.document-root        = "/home/saq/app/myapp/public"
c.server.errorlog             = "/var/log/lighttpd/error.log"
d.在proxy module中配置:
 $HTTP["host"] == "www.wooxo.cc" {
    proxy.balance = "hash"
    proxy.server  = ( "" => (( "host" => "127.0.0.1","port" =>100 ),
                                ( "host" => "127.0.0.1","port" =>101 ),
                                ( "host" => "127.0.0.1","port" =>102 ),
                                ( "host" => "127.0.0.1","port" =>103 ),
                              ( "host" => "127.0.0.1","port" =>104 ) ) )
  }
如果多个域名都可以指向到这里,复制上述内容,即可,只需要修改$HTTP["host"]即可。

启动: lighttpd -f lighttpd.conf.关闭killall lighttpd

2.运行多个thin服务器;
thin -s5 -p100 -eproduction -d

thin的用法参照thin -help,-s5就是运行5个实例,-p100,实例的端口从100开始

这样就会运行多个thin服务,开通100-104端口的应用。

关闭:killall thin

分享到:
评论
2 楼 s8186255 2010-09-19  
more lighttpd.conf.proxy
# lighttpd configuration file
#
# use it as a base for lighttpd 1.0.0 and above
#
# $Id: lighttpd.conf,v 1.7 2004/11/03 22:26:05 weigon Exp $

############ Options you really have to take care of ####################

## modules to load
# at least mod_access and mod_accesslog should be loaded
# all other module should only be loaded if really neccesary
# - saves some time
# - saves memory
server.modules              = (
                                "mod_rewrite",
                                "mod_redirect",
#                               "mod_alias",
                                "mod_access",
#                               "mod_trigger_b4_dl",
#                               "mod_auth",
#                               "mod_status",
#                               "mod_setenv",
#                               "mod_fastcgi",
                                "mod_proxy",
                                "mod_simple_vhost",
#                               "mod_evhost",
#                               "mod_userdir",
#                               "mod_cgi",
#                               "mod_compress",
#                               "mod_ssi",
#                               "mod_usertrack",
#                               "mod_expire",
#                               "mod_secdownload",
#                               "mod_rrdtool",
                                "mod_accesslog" )

## A static document-root. For virtual hosting take a look at the
## mod_simple_vhost module.
server.document-root        = "/home/saq/app/myapp/public"

## where to send error-messages to
server.errorlog             = "/var/log/lighttpd/error.log"

# files to check for if .../ is requested
index-file.names            = ( "index.php", "index.html",
                                "index.htm", "default.htm" )

## set the event-handler (read the performance section in the manual)
# server.event-handler = "freebsd-kqueue" # needed on OS X

# mimetype mapping
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",
  ".jar"          =>      "application/x-java-archive",
  ".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",
  # default mime type
  ""              =>      "application/octet-stream",
)

# Use the "Content-Type" extended attribute to obtain mime type if possible
#mimetype.use-xattr        = "enable"


## send a different Server: header
## be nice and keep it at lighttpd
# server.tag                 = "lighttpd"

#### accesslog module
accesslog.filename          = "/var/log/lighttpd/access.log"

## deny access the file-extensions
#
# ~    is for backupfiles from vi, emacs, joe, ...
# .inc is often used for code includes which should in general not be part
#      of the document-root
url.access-deny             = ( "~", ".inc" )

$HTTP["url"] =~ "\.pdf$" {
  server.range-requests = "disable"
}

##
# which extensions should not be handle via static-file transfer
#
# .php, .pl, .fcgi are most often handled by mod_fastcgi or mod_cgi
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )




$HTTP["host"] == "www.wooxo.cc" {
    proxy.balance = "round-robin"
    proxy.server  = ( "" => (   ( "host" => "127.0.0.1","port" =>100 ),
                                ( "host" => "127.0.0.1","port" =>101 ),
                                ( "host" => "127.0.0.1","port" =>102 ),
                                ( "host" => "127.0.0.1","port" =>103 ),
                                ( "host" => "127.0.0.1","port" =>104 ) ) )
  }



1 楼 xinghu 2010-07-19  
你好,我照你说的做的。重启后,发现 lighttpd 报错 no proxy-handler found for: / ,不知道什么原因,你知道怎么解决吗

相关推荐

    搭建lighttpd+cgi的代码包

    【搭建lighttpd+cgi的代码包】 在Web服务器领域,lighttpd是一个轻量级且高效的HTTP服务器,因其低内存占用和高速度而受到欢迎。CGI(Common Gateway Interface)则是一种标准,允许Web服务器执行外部程序并返回...

    lighttpd+mysql+php tar.gz安装包整合

    这里我们关注的是"lighttpd+mysql+php"的集成安装,特别适用于轻量级服务器需求,例如开发或测试环境。这个压缩包文件集合包含了在CentOS7系统上成功安装和测试的所有组件,包括lighttpd(一个轻量级HTTP服务器)、...

    phpLight(LightTPD+PHP集成包) v2014

    phpLight 2014 是网上首套LightTPD+PHP集成包,集成最新Lighttpd+PHP+MySQL+SQL-Front+Zend Guard Loader+XCache。纯绿色,安装后无需再配置。支持系统服务和非服务两种启动方式,自由切换。一次性安装无需再安装,...

    套件php 集成最新的Apache+Nginx+LightTPD+PHP+MySQL+phpMyAdmin+Zend Optimizer+Zend Loader

    首先,Apache、Nginx和LightTPD是三种流行的Web服务器软件。Apache是最广泛使用的开源HTTP服务器,具有丰富的模块和广泛的社区支持。Nginx以其高性能和低内存占用著称,尤其适合高并发场景。LightTPD则是一款轻量级...

    phpLight 2013 网上首套LightTPD+PHP集成包

    phpLight 2013 是网上首套LightTPD+PHP集成包, 集成最新Lighttpd+PHP+MySQL+SQL-Front+Zend Guard Loader+XCache。 纯绿色,安装后无需再配置。支持系统服务和非服务两种启动方式,自由切换。 一次性安装无需再安装...

    lighttpd+php in android

    以下是对"lighttpd+php in android"这个主题的详细说明。 **Lighttpd** Lighttpd是一款开源、快速、低内存占用的HTTP服务器,特别适合资源有限的设备,如Android手机或平板电脑。它的设计目标是提供高效的服务,...

    Openwrt里架设Lighttpd+PhP5+MYSQL环境标准教程.pdf

    "Openwrt里架设Lighttpd+PhP5+MYSQL环境标准教程" 本教程旨在指导读者在Openwrt系统中架设Lighttpd+PhP5+MYSQL环境,实现Web服务器搭建。以下是相关知识点的详细解释: 一、硬件准备 * 路由器:需要一台路由器,...

    phpStudy 最新 Apache+Nginx+LightTPD+PHP+MySQL+phpMyAdmin+Zend 稳定 强大

    该程序包集成最新的Apache+Nginx+LightTPD+PHP+MySQL+phpMyAdmin+Zend Optimizer+Zend Loader,一次性安装,无须配置即可使用,是非常方便、好用的PHP调试环境。该程序绿色小巧简易迷你仅有35M,有专门的控制面板。...

    在安卓中创建 lighttpd+mysql+php的服务器-almp7.zip

    "almp7-master"可能包含整个搭建过程的源代码或脚本,而"在安卓中创建 lighttpd+mysql+php的服务器_almp7"则可能是一份详细的文字教程,涵盖了从安装到配置的整个流程。这份资料对想要在安卓设备上搭建Web服务器的...

    veket5.3 搭建web平台建站 lighttpd + php + mysql for veket 一键安装包

    "/etc/init.d/lighttpd start" 启动lighttpd 直接访问 127.0.0.1 访问WEB 同时会在使用工具生成两个菜单,一个查看 phpinfo, 一个查看 lighttpd状态, 网站根目录在/var/www/ 下,php.ini 在 /etc/目录下, lighttpd....

    ubuntu lighttpd+webpy (fastcgi)配置方法

    在本文中,我们将深入探讨如何在Ubuntu操作系统上配置Lighttpd服务器与Webpy框架的集成,利用FastCGI技术实现高效动态网页服务。首先,确保已经安装了必要的组件,包括Lighttpd服务器、Webpy框架以及FastCGI支持。 ...

    varnish+lighttpd配置

    修改Lighttpd的配置文件`/etc/lighttpd/lighttpd.conf`,确保它监听8080端口并启用FastCGI支持(如果需要处理动态内容)。例如: ``` server.port = 8080 fastcgi.server += ("myapp" => ( "localhost" => ( ...

    lighttpd配置和启动脚本

    在本压缩包中,我们重点关注`lighttpd.conf`配置文件以及用于控制Web服务器启动和停止的脚本。下面我们将深入探讨这两个核心元素。 一、lighttpd.conf配置文件详解 1. **基本设置**:`server.document-root` 指定...

    fcgi-2.4.1-SNAP-0910052249.tar.bz2

    我是用lighttpd+nginx+spawn-fcgi+fcgi-2.4.1搭建环境。使用C语言编写后台程序。goahead也可以用。apt install lighttpdapt install nginxapt install spawn-fcgitar -xjvf fcgi-2.4.1-SNAP-0910052249.tar.bz2cd ...

    lighttpd 安装配置

    ### Lighttpd安装与配置详解 #### 一、前言 Lighttpd是一款开源的、高性能的、符合标准的Web服务器软件,适用于Unix-like系统,包括Linux、BSD、Solaris等。它以其轻量级、高效率的特点,在处理高并发连接方面表现...

    vagrant-dokuwiki:带有dokuwiki(arch + lighttpd + php-fpm)的流浪文件已准备好进行生产

    这个环境配置了Arch Linux作为基础操作系统,同时还集成了lighttpd作为Web服务器以及php-fpm来处理PHP脚本,这一切都是为了支持DokuWiki的高效运行。 首先,我们来了解一下Vagrant。Vagrant是一款流行的开发工具,...

    ubuntu lighttpd实现websocket

    3、首先配置lighttpd.conf 修改为自己的工作路径 var.server_root = "/home/caoft/lighttpd/lighttpd_websocket/http_server" var.state_dir = "/home/caoft/lighttpd/lighttpd_websocket/http_server" var.home_dir...

    lighttpd-1.4.55移植配置与测试.rar

    交叉编译最新版的lighttpd-1.4.55,配置与测试CGI与HTML.内含 lighttpd-1.4.55源码,移植教程,cgi测试代码,html测试代码.测试cgi时,浏览器中应该输入192.168.100.30/cgi-bin/xx.cgi .其中 192.168.100.30为开发板的ip

    php+mysql+tomcat集成开发环境

    该程序包集成最新的Apache+Nginx+LightTPD+PHP+MySQL+phpMyAdmin+Zend Optimizer+Zend Loader,一次性安装,无须配置即可使用,是非常方便、好用的PHP调试环境。该程序绿色小巧简易迷你仅有35M,有专门的控制面板。...

Global site tag (gtag.js) - Google Analytics