`

lighttpd 安装配置

阅读更多

首先需要安装:
libpcre
libz

可从http://lighttpd.net/download/下载最新的源码(.tar.gz)或者rpm包。如果下载的是.tar.gz文件,则和GNU的其他软件一样,先./configure一下,然后 make && make install就搞定了。但是如果你想定制一些功能,就得好好看看解压后README, INSTALL以及./configure --help的输出结果了。这里仅仅说一下如何从源码安装,其他安装方式可参考 http://trac.lighttpd.net/trac/wiki/TutorialInstallation。

$ gzip -cd lighttpd-1.4.9.tar.gz | tar xf -
...
$ cd lighttpd-1.4.9
$ ./configure --help
`configure' configures lighttpd 1.4.9 to adapt to many kinds of systems.

Usage: ./configure [OPTION]... [VAR=VALUE]...

To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE.  See below for descriptions of some of the useful variables.

Defaults for the options are specified in brackets.

Configuration:
...

Installation directories:
  --prefix=PREFIX         install architecture-independent files in PREFIX
                          [/usr/local]
  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
                          [PREFIX]

By default, `make install' will install all the files in
`/usr/local/bin', `/usr/local/lib' etc.  You can specify
an installation prefix other than `/usr/local' using `--prefix',
for instance `--prefix=$HOME'.

For better control, use the options below.

Fine tuning of the installation directories:
...

Program names:
...

System types:
...

Optional Features:
  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  --enable-maintainer-mode  enable make rules and dependencies not useful
                          (and sometimes confusing) to the casual installer
  --disable-dependency-tracking  speeds up one-time build
  --enable-dependency-tracking   do not reject slow dependency extractors
  --enable-static[=PKGS]
                          build static libraries [default=no]
  --enable-shared[=PKGS]
                          build shared libraries [default=yes]
  --enable-fast-install[=PKGS]
                          optimize for fast installation [default=yes]
  --disable-libtool-lock  avoid locking (might break parallel builds)
  --enable-lfs            Turn on Large File System (default)
  --disable-ipv6          disable IPv6 support

Optional Packages:
  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
  --with-pic              try to use only PIC/non-PIC objects [default=use
                          both]
  --with-tags[=TAGS]
                          include additional configurations [automatic]
  --with-mysql[=PATH]
                          Include MySQL support. PATH is the path to
                          'mysql_config'
  --with-ldap             enable LDAP support
  --with-attr             enable extended attribute support
  --with-valgrind         enable internal support for valgrind
  --with-openssl[=DIR]
                          Include openssl support (default no)
  --with-openssl-includes=DIR
                          OpenSSL includes
  --with-openssl-libs=DIR OpenSSL libraries
  --with-kerberos5        use Kerberos5 support with OpenSSL
  --with-pcre             Enable pcre support (default yes)
  --with-bzip2            Enable bzip2 support for mod_compress
  --with-fam              fam/gamin for reducing number of stat() calls
  --with-webdav-props     properties in mod_webdav
  --with-gdbm             gdbm storage for mod_trigger_b4_dl
  --with-memcache         memcached storage for mod_trigger_b4_dl
  --with-lua              lua engine for mod_cml

Some influential environment variables:
...

如上所述,可通过--prefix指定安装路径,默认安装在/usr/local下。可以指定启用哪些特征(插件),禁用哪些特征(插件)。假定我们要把lighttpd安装到/usr/local/lighttpd-1.4.9下面。

$ ./configure --prefix=/usr/local/lighttpd-1.4.9
$ make
$ make install
$ cp  doc/lighttpd.conf /usr/local/lighttpd-1.4.9/  # 拷贝配置文件 
$ cd /usr/local/lighttpd-1.4.9
$ vi lighttpd.conf # 修改配置文件

配置文件很直观明了,一般只要把server.document-root、server.errorlog、accesslog.filename改成你的实际目录和文件名字就可以了。

$ sbin/lighttpd -f lighttpd.conf # 启动lighttpd服务
$ ps aux | grep lighttpd
www 15403  0.0  0.9  2860 1148 ? S 00:15 0:00 sbin/lighttpd -f

这就完成了从安装到启动的整个过程,很简单吧。从最后一行的输出可以看出,lighttpd是单进程服务的,这和apache不一样(也许是它的稳定性不如apache的一个原因)。

分享到:
评论

相关推荐

    lighttpd配置和启动脚本

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

    Linux Lighttpd 配置安装 运行 测试

    在Linux上安装Lighttpd,里面有遇到的一些问题的解决方法,整个安装流程,还有参考网站

    varnish+lighttpd配置

    varnish+lighttpd配置

    lighttpd简单配置

    lighttpd简单配置,希望对新手同志有用!!!

    用于ROR应用的lighttpd配置模板

    里面包含了lighttpd启动程序,lighttpd配置模板以及一个控制lighttpd启动和关闭的脚本。

    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轻量级的HTTP服务器,全面支持fast-cgi

    lighttpd.conf注释

    lighttpd.conf,可以直接使用。带注释。网上搜索的资料,自己加的。可能有人觉得没什么用╮(╯_╰)╭。分享

    简明Windows,lighttpd,fastcgi,php5 Web服务器配置

    NULL 博文链接:https://yeahoo.iteye.com/blog/319066

    CentOS下Lighttpd Web服务器安装与配置方法

    OS: CentOS release 5.5 Lighttpd: 1.4.28 安装 sudo yum install lighttpd.i386 lighttpd-fastcgi.i386 lighttpd-mod_mysql_vhost.i386 运行 检查配置文件 lighttpd -t -f lighttpd.conf 启动lighttpd服务 ...

    Lighttpd源码分析_mobi

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

    phpLight(LightTPD+PHP集成包) v2014

    纯绿色,安装后无需再配置。支持系统服务和非服务两种启动方式,自由切换。一次性安装无需再安装,即使重做系统后亦可使用,直接点启动即可。小巧简易迷你只有14M,非常方便的搭建网站服务器。有专门开发的控制面板...

    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...

    docker镜像构建,中间件mysql、lighttpd、Nginx、squid配置和启动、dubbo服务部署

    学习心得,分享出来供大家学习。docker镜像构建,中间件mysql、lighttpd、Nginx、squid配置和启动、dubbo服务部署

    lighttpd源码分析

    网上收集的关于lighttpd代码分析的文章,内容不多。

    LightTPD for windows 1.4.45-x86

    startLighttp.vbs 为一键启动lighttpd和php-cgi的启动脚本,php使用fastcgi host:port形式 test_cgi.cmd 为测试cgi传参数用(如果发现php程序返回No input file specified.说明server.document-root这个目录配置的有...

    LightTPD for windows 1.4.45-x64

    startLighttp.vbs 为一键启动lighttpd和php-cgi的启动脚本,php使用fastcgi host:port形式 test_cgi.cmd 为测试cgi传参数用(如果发现php程序返回No input file specified.说明server.document-root这个目录配置的有...

    三大WEB服务器配置文档

    APACHE服务器安装配置(LAMP) LIGHTTPD服务器安装配置 LIGHTTPD服务状态监控 NGINX服务器安装配置

Global site tag (gtag.js) - Google Analytics