具体方法参照Robbin的这篇文章~~http://www.iteye.com/topic/43228
我就说说自己遇到的问题:
问题1:pcre库没有安装,导致配置lighttpd出现错误。
解决方法:
①wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-7.6.tar.bz2,从官方下载最新的pcre
②然后解压tar xjvf pcre-7.6.tar.bz2
③进入到解压目录,保持默认安装路径安装:
./configure
make
make install
安装结束以后,pcre就安装成功啦。
问题2:配置lighttpd,找不到socket路径。
解决方法:
①输入vi /etc/lighttpd/lighttpd.conf,进入到lighttpd配置文件。
②保证需要的模块前面没有注释符号,mod_rewrite,mod_access,mod_fastcgi,mod_simple_vhost,mod_cgi,mod_compress,mod_accesslog,这些一般是必须的。
③找到配置rails的部分:
$HTTP["host"] == "www.xxx.com" {
server.document-root = "/yourrails/public"
server.error-handler-404 = "/dispatch.fcgi"
fastcgi.server = (".fcgi" =>
("localhost" =>
("min-procs" => 10,
"max-procs" => 10,
"socket" => "/tmp/lighttpd/socket/rails.socket",
"bin-path" => "/yourrails/public/dispatch.fcgi",
"bin-environment" => ("RAILS_ENV" => "production")
)
)
)
}
注意那个socket的部分,那个/tmp/lighttpd/socket目录必须存在,当然你可以指定到其它目录,后面的rails.socket不用管,当lighttpd启动之后,会建立10个rails.socket,这个数量取决于你前面定义的max-procs和min-procs。还有注意把www.xxx.com修改为你自己的域名,yourrails改为你自己的rails项目所在的文件夹。
问题3:启动lighttpd,屏幕显示OK,但是没有启动
解决方法:
①查看error.log文件,具体的存放位置跟你配置lighttpd文件里面定义的位置有关。
②如果提示dispatch.fcgi启动失败,就要检查你rails文件夹里面public文件夹下的dispatch.fcgi文件了。
③一般如果要是从windows平台迁移过去的rails项目,那么这个文件中的ruby路径肯定不对
#!c:/ruby/bin/ruby
#
# You may specify the path to the FastCGI crash log (a log of unhandled
# exceptions which forced the FastCGI instance to exit, great for debugging)
# and the number of requests to process before running garbage collection.
#
# By default, the FastCGI crash log is RAILS_ROOT/log/fastcgi.crash.log
# and the GC period is nil (turned off). A reasonable number of requests
# could range from 10-100 depending on the memory footprint of your app.
#
# Example:
# # Default log path, normal GC behavior.
# RailsFCGIHandler.process!
#
# # Default log path, 50 requests between GC.
# RailsFCGIHandler.process! nil, 50
#
# # Custom log path, normal GC behavior.
# RailsFCGIHandler.process! '/var/log/myapp_fcgi_crash.log'
#
require File.dirname(__FILE__) + "/../config/environment"
require 'fcgi_handler'
RailsFCGIHandler.process!
注意看第一行,应该修改为本机的ruby路径,我的修改为#!/root/ruby-1.8.6/bin/ruby,具体情况根据你自己的ruby路径决定,当然,如果你不知道具体路径,可以采用一个笨方法,那就是在Linux上面建立一个rails项目,然后复制这个项目的dispatch.fcgi里面的ruby路径。。。。。
④修改dispatch.fcgi的权限,用chmod -c 777 dispatch.fcgi
问题解决~~
以上就是我配置lighttpd环境遇到的问题~~
分享到:
相关推荐
简单的一键部署PHP调试环境,适合初学者。集成最新的Apache+Nginx+LightTPD+PHP+MySQL+phpMyAdmin+Zend Optimizer+Zend Loader
一次性安装无需再安装,即使重做系统后亦可使用,直接点启动即可。小巧简易迷你只有14M,非常方便的搭建网站服务器。有专门开发的控制面板进行控制程序的启停。phpLight 2014 包括以下组件:Lighttpd 1.4.32 服务器...
使用lighttpd的开源代码成功搭建支持cgi的代码包
centos7下安装测试成功的所有安装包整合
Veket 官方论坛 lanwairen...同时会在使用工具生成两个菜单,一个查看 phpinfo, 一个查看 lighttpd状态, 网站根目录在/var/www/ 下,php.ini 在 /etc/目录下, lighttpd.conf 在 /etc/lighttpd/ 下,mysql 没有设置密码
5. 在『启动』、『停止』、『重启』三个启停按钮上右键可以有选择地进行启停,左键将控制全部的启停。 6. 菜单『phpStudy 设置』可以进行php,apche,mysql的相关设置。菜单『站点域名设置』可以进行站点及域名的添加...
1.修改lighttpd.conf 修改为自己的工作目录 var.server_root = "/home/caoft/lighttpd/lighttpd_websocket_fastcgi/http_server" var.state_dir = "/home/caoft/lighttpd/lighttpd_websocket_fastcgi/http_server"...
* 安装lighttpd模块:安装lighttpd-mod-fastcgi、lighttpd-mod-access、lighttpd-mod-alias、lighttpd-mod-redirect、lighttpd-mod-rewrite等模块。 * 安装php5模块:安装php5-fastcgi、php5-mod-gd、php5-mod-xml、...
该程序包集成最新的Apache+Nginx+LightTPD+PHP+MySQL+phpMyAdmin+Zend Optimizer+Zend Loader,一次性安装,无须配置即可使用,是非常方便、好用的PHP调试环境。该程序绿色小巧简易迷你仅有35M,有专门的控制面板。...
Ruby on rails推荐的生产运行环境是Linux/FreeBSD/Unix。本文以Linux操作系统,lighttpd+FCGI,MySQL数据库为例,从源代码编译安装开始讲解。
参考了网上的一些资源和信息, lighttpd是自己编译出来的,php-cgi是网上下载,合起来可以在android上使用。 里面也包括了配置文件。
NULL 博文链接:https://yeahoo.iteye.com/blog/319066
在Linux上安装Lighttpd,里面有遇到的一些问题的解决方法,整个安装流程,还有参考网站
首先安装 lighttpd 和 webpy,因为用 kpackagekit 做软件管理,在安装 webpy 的时候会自动安装 flup
我是用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 ...
Nginx是俄罗斯人编写的十分轻量级的HTTP服务器,以事件驱动的方式编写,所以有非常好的性能...其拥有 匹配Lighttpd的性能,同时还没有Lighttpd的内存泄漏问题,而且Lighttpd的mod_proxy也有一些问题并且很久没有更新。
支持FastCGI, CGI, Auth, 输出压缩(output compress), URL重写, Alias等重要功能,而Apache之所以流行,很大程度也是因为功能丰富,在lighttpd上很多功能都有相应的实现了,这点对于apache的用户是非常重要的,因为...
varnish+lighttpd配置
Rails的部署方式的核心问题就在于解决一、Rails本身是非线程安全,二、...本文列举了十余种常见的Rails部署方案,其中基于Lighttpd 1.5的几种解决方案都从原理上很好地解决了Rails部署的两大问题,而且有着不俗的性能。