http://www.lighttpd.net

http://www.lighttpd.net/download/lighttpd-1.4.16.tar.gz

首先就是lighttpd的安装了,lighttp的安装需要pcre-7.6.tar.gz,主要是正则式的解析,安装包如下:

1.pcre-7.6.tar.gz    (http://www.pcre.org/)
2.lighttpd-1.4.19.tar.gz   (http://www.lighttpd.net/download/)

一、安装pcre和lighttpd
// pcre的安装
tar xf pcre-7.6.tar.gz
cd pcre-7.6
./configure
make clean
make
make install

// lighttpd的编译安装
tar xf lighttpd-1.4.19.tar.gz
cd lighttpd-1.4.19
./configure --prefix=/usr/local/lighttpd
make clean
make
make install

// lighttpd的配置文件、用户组和用户的配置
mkdir /usr/local/lighttpd/etc
cp doc/lighttpd.conf /usr/local/lighttpd/etc
groupadd lighttpd
useradd -g lighttpd lighttpd

// lighttpd的日志文件设置
mkdir /usr/local/lighttpd/logs

二、lighttpd的简单配置和主要参数说明

#vi /usr/local/lighttpd/etc/lighttpd.conf

server.port                 = 84
修改server.port 为84
/www/logs/access.log  => /www/logs/lighttpd_access.log

//建立web目录
mkdir -p /www/pages /www/logs

server.modules 根据需要启动模块
 server.document-root 改为你的网站的根目录(如/www)
 server.errorlog 改为错误日志的路径(如/usr/local/lighttpd/logs/error.log)
 accesslog.filename 改为访问日志的路径(如/usr/local/lighttpd/logs/access.log)

三、启动lighttpd

#/usr/local/lighttpd/sbin/lighttpd -f /usr/local/lighttpd/etc/lighttpd.conf

然后我们在/www下建立一个index.html,输入hello,然后访问该服务器即可看到该页面,即表明lighttpd安装成功!
lighttpd的命令如下:
#/usr/local/lighttpd/sbin/lighttpd --help
-f <name> 指定配置文件的路径
-m <name> 指定模块的加载目录,默认是/usr/local/lighttpd/lib
-p        在屏幕上显示解析后的配置文件信息(运行信息),要指定-f参数
-t        检测配置文件的正确行,要指定-f参数
-D        设置lighttpd非后台运行,默认是后台运行
-v        显示lighttpd的版本
-V        显示lighttpd的编译时特性信息
-h        显示帮助信息,同--help

四、添加php模块
vi ighttpd.conf

将 #”mod_fastcgi”, 的#去掉
用whereis php-cgi查找php-cgi的路径
配置fastcgi的定义
把fastcgi.server前面的#去掉
#### fastcgi module
## read fastcgi.txt for more info
## for PHP don't forget to set cgi.fix_pathinfo = 1 in the php.ini
fastcgi.server = ( ".php" =>
 ( "localhost" =>
  (
  "socket" => "/usr/local/lighttpd/php-fastcgi.socket",
  "bin-path" => "/usr/bin/php-cgi"
  )
 )
)

五 启动和停止

在sbin目录下
vi httpd
添加
#!/bin/sh
LIGHTTPD_CONFIG=/usr/local/lighttpd/etc/lighttpd.conf
LIGHTTPD_BIN=/usr/local/lighttpd/sbin/lighttpd
LIGHTTPD_PID=/usr/local/lighttpd/lighttpd.pid
test -r $LIGHTTPD_CONFIG || exit 6
case "$1" in
start )
echo -n "Starting lighttpd"
$LIGHTTPD_BIN -f $LIGHTTPD_CONFIG
;;
stop )
echo -n "Shutting down lighttpd"
killall lighttpd
rm $LIGHTTPD_PID
;;
esac
exit 0

用/usr/local/lighttpd/sbin/httpd start 启动
用/usr/local/lighttpd/sbin/httpd stop  停止

六添加系统服务
vi lighttpd.init

添加

#!/bin/sh
# $Id: lighttpd.init,v 1.2 2003/03/07 20:38:30 sacerdoti Exp $
#
# chkconfig: 2345 70 40
# description: lighttpd startup script
#
LIGHTTPD_BIN=/usr/local/lighttpd/sbin/lighttpd
LIGHTTPD_CONFIG=/usr/local/lighttpd/etc/lighttpd.conf
LIGHTTPD_PID=/usr/local/lighttpd/lighttpd.pid
. /etc/rc.d/init.d/functions

test -r $LIGHTTPD_CONFIG || exit 6
RETVAL=0

case "$1" in
   start)
      echo -n "Starting lighttpd: "
      daemon $LIGHTTPD_BIN -f $LIGHTTPD_CONFIG
      RETVAL=$?
      echo
      [ $RETVAL -eq 0 ] && touch $LIGHTTPD_PID
 ;;

stop)
      echo -n "Shutting down lighttpd: "
      killproc lighttpd
      RETVAL=$?
      echo
      [ $RETVAL -eq 0 ] && rm -f $LIGHTTPD_PID
 ;;

restart|reload)
    $0 stop
    $0 start
    RETVAL=$?
 ;;
  status)
    status gmond
    RETVAL=$?
 ;;
  *)
 echo "Usage: $0 {start|stop|restart|status}"
 exit 1
esac

exit $RETVAL

# chmod +x lighttpd.init
# cp lighttpd.init  /etc/init.d/lighttpd
# chkconfig --add lighttpd
# chkconfig --list lighttpd

四、lighttpd的模块配置

lighttpd按照上面的安装步骤后,其所有模块都已经安装在/usr/local/lighttpd/lib目录下了,
    我们设置在 server.modules中的模块名称和lib目录下的模块文件的名称一致即可,
    如mod_secdownload.so就是表示 mod_secdownload模块。
    我们可以在server.modules的列表中增加mod_secdownload来使lighttpd支持 mod_secdownload。
    另外还可以使用这样的语法来增加模块:server.modules += ("mod_secdownload")

转载于:https://blog.51cto.com/yifangyou/618871

安装lighttpd相关推荐

  1. lighttpd php7 源码安装,如何在CentOS 7上安装Lighttpd与PHP-FPM和MariaDB

    Lighttpd是一款安全,快速,符合标准的Web服务器,专为速度至关重要的环境而设计. 本教程将介绍如何在具有PHP支持(通过PHP-FPM)和MySQL支持的CentOS 7服务器上安装Light ...

  2. linux启动lighttpd服务,如何使用Yum在CentOS和RHEL上安装Lighttpd Web服务器

    Lighttpd是一种适合在生产环境中运行的高性能Web服务器.它是高度优化,安全且非常灵活的Web服务器:与其他Web服务器相比,LightTPD使用的内存和CPU非常低.其事件驱动架构针对大量并行 ...

  3. lighttpd安装_如何在Ubuntu服务器上安装Lighttpd

    lighttpd安装 In this tutorial, we will walk you through how to install Lighttpd on Ubuntu Server. Ligh ...

  4. 实现在Windows下安装Lighttpd的方法

    逛javaeye时,看到大牛们推荐使用lighttpd Web服务器,如是下载下来安装尝试了一把. 大致经历一下几个步骤: 1.windows系统下需要cygwin 环境的支持,如是先下载安装cygw ...

  5. lighttpd+PHP安装

    lighttpd版本:1.4.32 php版本:5.4.11   2013.2.3第一次 php版本:5.4.12   2013.3.14第二次修改 1.lighttpd官网地址 http://www ...

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

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

  7. lighttpd安装配置支持php

    转载链接:https://wiki.freebsdchina.org/howto/n/php_fastcgi_lighttpd 安装lighttpd 记得在SPAWNFCGI前打勾 [X] SPAWN ...

  8. fedora 编译安装mysql_Fedora 下编译安装安装基于Lighttpd+PHP5+MySQL5

    Lighttpd 是个安全, 快速, 专为高负载环境设计的标准兼容性WEB服务.本教程将介绍 lighttpd+php5(fastcgi模式)+MySQL 在Fedora 7服务器上的安装与配置过程. ...

  9. PHP lighttpd spawn-fcgi安装步骤

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

最新文章

  1. golang beego orm报错 must have one register DataBase alias named `default` 解决方案
  2. Linux 系统查看硬件配置信息
  3. 人人可以理解的区块链100问——比特币可以用于支付吗?
  4. Linux下怎么改分辨率和刷新率?
  5. 重磅!win10无法安装.NET Framework 3.5服务解决办法(附离线安装包下载)
  6. [NOIP2010提高组]关押罪犯
  7. c语言 prototype_(创建型模式)Prototype——原型模式
  8. C语言整型在计算机的储存
  9. Mysql学习总结(29)——MySQL中CHAR和VARCHAR
  10. 写给数据小白:怎么让你的分析结论超出预期,不再是废纸一堆
  11. 自动化测试框架搭建三python环境安装selenium和手动下载安装selenium的方法
  12. C#控制网页并自动输入
  13. DW个人网站制作成品 简单个人静态HTML网页设计作品 DIV布局个人介绍网页模板代码
  14. 计算机 服装生产管理的变化,服装生产与管理服装生产管理概述.ppt
  15. php fpm.conf 注释,php 中 php-fpm.conf
  16. 肝了一个月,全网最全的数据结构与算法知识总结
  17. C++中引用变量详解
  18. 学术——获取参考文献格式
  19. 送君千里终须一别,1胜2负,唯一战胜过AlphaGo的人退役了
  20. 扫盲:SSL是如何工作的?【转】

热门文章

  1. MFC中静态文本控件显示的几种实现方式
  2. java调度:(三)Timer中的单线程守护
  3. ef 数据迁移mysql_07116.3.0如何将CM的外部PostgreSQL数据库迁移至MySQL服务
  4. 签约 计算机英语,签约协议时的英文表达
  5. CORS 跨域-哪些操作受到同源限制
  6. Nginx静态资源压缩实战内容介绍
  7. 将本地镜像发布到阿里云
  8. 高仿真的类-BeanDefinitionReader
  9. 创建订单 - 保存订单与子订单数据
  10. RocketMQ错误消息重试策略之Consumer的重试机制(Exception情况)