`
steven-zhou
  • 浏览: 208341 次
  • 性别: Icon_minigender_1
  • 来自: 长沙
社区版块
存档分类
最新评论

lighttpd1.4.22 install on Debian

阅读更多
1.在lighttpd官方网站www.lighttpd.net下载lighttpd-1.4.22.tar.gz

2.新建lighttpd用户:
root@lenny:/usr/local/lighttpd/cgi-bin# useradd lighttpd -d /home/lighttpd
root@lenny:/usr/local/lighttpd/cgi-bin# passwd lighttpd
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully

3.验证源码的完整性:
lighttpd@lenny:~$ md5sum lighttpd-1.4.22.tar.gz
949c33a81e83f7718a47280bef21b90c  lighttpd-1.4.22.tar.gz
检查生成的MD5码是否与网站提供的MD5码一致。

4.解压:
lighttpd@lenny:~$ tar -zxvf lighttpd-1.4.22.tar.gz

5.编译前配置
查看配置选项:
lighttpd@lenny:~/lighttpd-1.4.22$ ./configure --help
配置:
lighttpd@lenny:~/lighttpd-1.4.22$ ./configure --prefix=/home/lighttpd --without-pcre --without-zlib --without-bzip2

6.编译&安装:
lighttpd@lenny:~/lighttpd-1.4.22$ make;make install

7.建立目录:
lighttpd@lenny:~$ mkdir -p etc log www/cgi-bin

8.将lighttpd.conf配置文件复制到etc目录:
lighttpd@lenny:~/etc$ cp ../lighttpd-1.4.22/doc/lighttpd.conf .

9.备份原装配置文件:
lighttpd@lenny:~/etc$ cp lighttpd.conf lighttpd.conf.raw
lighttpd@lenny:~/etc$ chmod 400 lighttpd.conf.raw

10.修改lighttpd.conf,
"mod_cgi"
server.document-root        = "/home/lighttpd/www/"
server.errorlog             = "/home/lighttpd/log/error.log"
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi", ".cgi" )
server.port                = 9090
server.pid-file            = "/home/lighttpd/lighttpd.pid"
cgi.assign                 = ( ".pl"  => "/usr/bin/perl",
                               ".cgi" => "" )
如果没有安装pcre模块,需要注解掉:
128 #$HTTP["url"] =~ "\.pdf$" {
129 #  server.range-requests = "disable"
130 #}


11.启动lighttpd
lighttpd@lenny:~$ sbin/lighttpd -f etc/lighttpd.conf
lighttpd@lenny:~$ netstat -tnlp
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:9090            0.0.0.0:*               LISTEN      17151/lighttpd
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:21              0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:23              0.0.0.0:*               LISTEN      -
tcp        0      0 127.0.0.1:826           0.0.0.0:*               LISTEN      -
tcp6       0      0 :::22                   :::*                    LISTEN      -

12.写个简单的CGI测试程序。
/* filename: hello.c */
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

int main(int argc, char **argv)
{
        fprintf(stdout, "Content-Type: text/html\n\n");
        fprintf(stdout, "CGI powered by Lighttpd and C\n");
        exit(EXIT_SUCCESS);
}

编译CGI程序:
lighttpd@lenny:~/www/cgi-bin$ gcc -o hello.cgi hello.c

13.访问测试CGI:
http://192.168.6.130:9090/cgi-bin/hello.cgi

14.编写启、停脚本
sbin/startup
#--------------------------
#!/bin/sh

lighttpd -f /home/lighttpd/etc/lighttpd.conf
#--------------------------

sbin/shutdown
#--------------------------
#!/bin/sh

kill -9 `cat /home/lighttpd/lighttpd.pid`
#--------------------------

15.编写.bash_profile
export PATH=$PATH:/home/lighttpd/bin:/home/lighttpd/sbin
export LANG=POSIX
分享到:
评论

相关推荐

    最新lighttpd源码 lighttpd-1.4.22

    Lighttpd是一个德国人领导的开源软件,其根本的目的是提供一个专门针对高性能网站,安全、快速、兼容性好并且灵活的web server环境。具有非常低的内存开销,cpu占用率低,效能好,以及丰富的模块等特点。lighttpd是...

    lighttpd-1.4.22.tar.bz2

    一个轻量级服务器,能够支持高并发和多请求。 主要用来作为一些动态语言的WEB开发的前端。

    Install Ruby on Linux

    在Linux上安装Ruby on Rails和Lighttpd

    Lighttpd源码分析_mobi

    主要内容包括:lighttpd介绍与分析准备工作、lighttpd网络服务主模型、lighttpd数据结构、伸展树、日志系统、文件状态缓存器、配置信息加载、i/o多路复用技术模型、插件链、网络请求服务响应流程、请求响应数据快速...

    Lighttpd源码分析

    资源名称:Lighttpd源码分析内容简介: 作为最为优秀的轻量级Web Server之一,Lighttpd有着众多的忠实拥护者和使用者。Lighttpd源码分析就是一本介绍分析Lighttpd源码的初级读本,其主要目标在于:一方面让已经接触...

    lighttpd-1.4.20.tar

    lighttpd-1.4.20.tar lighttpd-1.4.20.tar

    ubuntu lighttpd实现websocket

    如何在ubuntu上实现lighttpd 1、下载mongoose使用mongoose中的example中的websocket_chat,实现websocket 2、websocket_chat源码下载路径 官网:https://cesanta.com 论坛:...

    lighttpd 主工作模式

    lighttpd 流程分析工作模式,帮助理解lighttpd

    lighttpd fastcgi

    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-1.4.28源码下载

    最新lighttpd-1.4.28源码下载最新lighttpd-1.4.28源码下载最新lighttpd-1.4.28源码下载最新lighttpd-1.4.28源码下载最新lighttpd-1.4.28源码下载最新lighttpd-1.4.28源码下载

    varnish+lighttpd配置

    varnish+lighttpd配置

    lighttpd-1.4.45_lighttpd服务器_

    lighttpd轻量级web嵌入式服务器,方便嵌入式平台移植,小巧安全

    lighttpd配置和启动脚本

    包括lighttpd.conf配置文件以及用于控制web server启动和停止的脚本。

    lighttpd-1.4.20-cmake

    lighttpd-1.4.20-cmake

    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

    lighttpd代码阅读资料

    lighttpd代码阅读资料 参数的 web服务器

    Lighttpd 的windows版本

    Lighttpd 的windows版本 Lighttpd 1.4.35 发布了,该版本包含很多 bug 修复,包括 scan.coverity.com 扫描的问题。但最主要的是一个 SQL 注入(和路径遍历)问题:

    lighttpd完全学习

    lighttpd完全学习,适合新手文档参考,ppt文件

    lighttpd-1.4.26 源码

    lighttpd-1.4.26 源码,官方直接下载,学习的好资源。

    lighttpd-1.4.20源代码

    lighttpd-1.4.20源代码

Global site tag (gtag.js) - Google Analytics