lighttpd版本:1.4.32

php版本:5.4.11   2013.2.3第一次

php版本:5.4.12   2013.3.14第二次修改

1.lighttpd官网地址

http://www.lighttpd.net

2.下载安装lighttpd

#wget http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-1.4.32.tar.gz

# tar -zxvf lighttpd-1.4.32.tar.gz

#cd ./lighttpd-1.4.32

#./configure --prefix=/usr/local/lighttpd

#make && make install

3.配置lighttpd

官方文档:http://redmine.lighttpd.net/projects/lighttpd/wiki/InstallFromSource

如果不是centos

#cp doc/initscripts/rc.lighttpd  /etc/init.d/lighttpd

如果是centos
#cp doc/initscripts/rc.lighttpd.redhat   /etc/init.d/lighttpd

修改/etc/init.d/下的lighttpd文件

修改

prog="lighttpd"
lighttpd="/usr/sbin/lighttpd"

prog="lighttpd"
lighttpd="/usr//local/lighttpd/sbin/lighttpd"

# chmod a+rx /etc/init.d/lighttpd

#cp doc/initscripts/sysconfig.lighttpd /etc/sysconfig/lighttpd
#mkdir /etc/lighttpd

#cp -R doc/config/conf.d/ doc/config/*.conf  doc/config/vhosts.d/ /etc/lighttpd/

创建用户

# useraddlighttpd

创建网站目录

# mkdir  /usr/www

修改配置文件

#vim /etc/lighttpd/lighttpd.conf

var.server_root 改为   = "/usr/www"

server.document-root = server_root + "/htdocs"    改为  server.document-root = server_root + "/htdocs"

server.use-ipv6 = "enable"改为"disable"

#cd /var/log/

# mkdir  lighttpd

#chown lighttpd  /var/log/lighttpd

lighttpd常用操作

启动

# /etc/init.d/lighttpd start

停止
# /etc/init.d/lighttpd stop

重启

# /etc/init.d/lighttpd restart

如果启动时有如下错误:
2011-09-08 20:47:57: (network.c.239) warning: please use server.use-ipv6 only for hostnames, not without server.bind / empty address; your config will break if the kernel default for IPV6_V6ONLY changes
将配置文件/etc/lighttpd/lighttpd.conf中的server.use-ipv6 设为 "disable"

如果报错:

opening errorlog '/var/log/lighttpd/error.log' failed: No such file or directory

#cd /var/log/

#mkdir  lighttpd

如果报错:

正在启动 lighttpd:2013-02-03 23:09:16: (log.c.118) opening errorlog '/var/log/lighttpd/error.log' failed: Permission denied

vi /etc/lighttpd/lighttpd.conf 看是那个帐户运行的,比如是lighttpd

#chown lighttpd  /var/log/lighttpd   就解决了

4.lighttpd绑定php的fastcgi

安装php的fastcgi参考:http://blog.csdn.net/unix21/article/details/8544922

官方文档:http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs_PerformanceFastCGI

修改配置文件

# vim /etc/lighttpd/lighttpd.conf

server.modules += ( "mod_fastcgi" )
fastcgi.server = ( ".php" =>(( "socket" => "/tmp/php-fastcgi.socket","bin-path" => "/usr/local/php/bin/php-cgi","min-procs" => 1,"max-procs" => 1,"max-load-per-proc" => 4,"bin-environment" => ("PHP_FCGI_CHILDREN" => "2","PHP_FCGI_MAX_REQUESTS" => "10000" ),"bin-copy-environment" => ("PATH", "SHELL", "USER" ),"broken-scriptfilename" => "enable","idle-timeout" => 20))
)

安装成功以后重启lighttpd

PHP_FCGI_CHILDREN是fastcgi所起的进程数,假设修改为20,查看系统进程数

性能测试

# ab -n 10000 -c 1000 http://192.168.20.210/index.php

 6.各种奇怪的问题参考:

http://blog.csdn.net/wangxuefeng_yctc/article/details/5652654

http://redmine.lighttpd.net/projects/lighttpd/wiki

http://blog.sina.com.cn/s/blog_613904cc0100xnlh.html

http://www.weithenn.org/cgi-bin/wiki.pl?LigHttpd-%E8%BC%95%E9%87%8F%E7%B4%9A_Web_Server

https://wiki.freebsdchina.org/howto/n/php_fastcgi_lighttpd

lighttpd+PHP安装相关推荐

  1. Lighttpd 的安装配置(web服务器软件)

    Lighttpd 的安装配置 2006-07-16 01:06 lighttpd(http://lighttpd.net/)和apache一样是开源的,与apache相比,虽然功能不及apache完善 ...

  2. PHP lighttpd spawn-fcgi安装步骤

    ##PHP lighttpd spawn-fcgi安装 一.安装lighttpd 1.解压lighttpd tar xzvf lighttpd-1.4.58.tar.gz ./configure -- ...

  3. [lighttpd] lighttpd的安装配置。。。

    下午没事的时候装了一下lighttpd,和大家分享一下! 首先安装lighttpd之前先安装pcre包 确认libtool是否已经安装,如果没有安装的话,则先安装libtool yum -y inst ...

  4. linux lighttpd php,安装配置Linux+lighttpd+mysql+PHP(FastCGI)

    安装配置Linux+lighttpd+mysql+PHP(FastCGI) . 分类: Linux-web服务器搭建 2009-08-28 17:38 3758人阅读 评论(0) 收藏 举报 安装配置 ...

  5. 安装lighttpd

    http://www.lighttpd.net http://www.lighttpd.net/download/lighttpd-1.4.16.tar.gz 首先就是lighttpd的安装了,lig ...

  6. linux上通过lighttpd上跑一个C语言的CGI小页面以及所遇到的坑

    Common Gateway Interface如雷贯耳,遗憾的是一直以来都没玩过CGI,今天尝试一把.Tomcat可以是玩CGI的,但得改下配置.为了方便,直接使用一款更轻量级的web服务器ligh ...

  7. lighttpd mysql_lighttpd+mysql+php

    博客已经搬家,请访问如下地址:http://www.czhphp.com 一:安装mysql 安装: unzip mysql-5.1.33.zip cd mysql-5.1.33.zip ./conf ...

  8. lighttpd sqlite3 php,fedora linux平台下搭建lighttpd+php+sqlite

    (一)lighttpd 1. 安装 yum install lighttpd 安装完成后,系统中应该多了一个用户lighttpd和组lighttpd.这个用户,默认是不允许登陆的. 我们修改/etc/ ...

  9. Lighttpd 搭建 Web 服务器

    背景:      公司项目用到了lighttpd,由于自己没有接触过,所以做下记录. 简介:       Lighttpd 是一个德国人领导的开源Web服务器软件,其根本的目的是提供一个专门针对高性能 ...

最新文章

  1. Linux Yum命令(转)
  2. ph获取xml文件信息
  3. 科大星云诗社动态20201222
  4. HDU - 1027 全排列
  5. 【weex开发】环境配置流程
  6. 编写有效用例电子版_剖析用例设计方法的使用
  7. AX2012 referencegroup
  8. Python 列表 list 数组 array
  9. NameNode之数据块管理
  10. 2.10 m 个样本的梯度下降
  11. 编译安装NTP时间服务报错
  12. Function的常用属性和方法
  13. python在线编辑器可视化_python软件——wxpython可视化编辑器 v4.1附使用教程
  14. TSPL学习笔记(2):过程和变量绑定
  15. Fastjson 远程命令执⾏漏洞
  16. 关于C语言中fseek函数的使用
  17. 如何实现基于 RADIUS 协议的双因子认证 MFA?
  18. 《构建之法》第1.2.3章读后感以及《硅谷传奇》观后感
  19. 数学建模优化和仿真模拟的区别001
  20. 加密货币为什么有价值?

热门文章

  1. linux下Qt调用C++库文件(.so)程序实现
  2. 基于点云描述子的立体视觉里程计快速鲁棒的位置识别方法
  3. 【全网最精简写法】ES6获取浏览器url跟参
  4. 使用git更新github上的开源项目
  5. 完整的Blender三维课程:素描到三维艺术的初学者
  6. STL模拟实现1.0 -- list和iterator模拟实现和简单分析
  7. 我是如何有效的避免测试漏测?
  8. Spring中利用applicationContext.xml文件实例化对象和调用方法
  9. [原创]SparkR针对mysql的数据读写操作实现
  10. 矢量图面层和线层相交得到相交后的线层文件(gis相交)