lighttpd解析php请求

简介:

1)下载,解压

 
  1. #wget http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-1.4.28.tar.bz2 
  2. #tar xf lighttpd-1.4.28.tar.bz2 

2)编译安装

 
  1. # ./configure --prefix=/usr/local/lighttpd \
  2. --enable-lfs \
  3. --disable-ipv6  \
  4. --with-openssl  \
  5. --with-pcre   \
  6. --with-zlib  \
  7. --with-bzip2 

错误提示

 
  1. checking for openssl/ssl.h... yes 
  2. checking for BIO_f_base64 in -lcrypto... yes 
  3. checking for SSL_new in -lssl... yes 
  4. checking for perl regular expressions support... yes 
  5. checking for pcre-config... no 
  6. configure: error: pcre-config not found, install the pcre-devel package or build with --without-pcre 

安装pcre-devel

 
  1. # yum list |grep pcre-devel 
  2. pcre-devel.i386                            6.6-6.el5_6.1               updates 
  3. pcre-devel.x86_64                          6.6-6.el5_6.1               updates
  4.  
  5. yum install -y pcre-devel.x86_64

再次./configure

 
  1. Plugins: 
  2.  
  3. enabled: 
  4.   mod_access 
  5.   mod_accesslog 
  6.   mod_alias 
  7.   mod_auth 
  8.   mod_cgi 
  9.   mod_compress 
  10.   mod_dirlisting 
  11.   mod_evhost 
  12.   mod_expire 
  13.   mod_extforward 
  14.   mod_fastcgi 
  15.   mod_flv_streaming 
  16.   mod_indexfile 
  17.   mod_proxy 
  18.   mod_redirect 
  19.   mod_rewrite 
  20.   mod_rrdtool 
  21.   mod_scgi 
  22.   mod_secdownload 
  23.   mod_setenv 
  24.   mod_simple_vhost 
  25.   mod_ssi 
  26.   mod_staticfile 
  27.   mod_status 
  28.   mod_trigger_b4_dl 
  29.   mod_userdir 
  30.   mod_usertrack 
  31.   mod_webdav 
  32. disabled: 
  33.   mod_cml 
  34.   mod_magnet 
  35.   mod_mysql_vhost 
  36.  
  37. Features: 
  38.  
  39. enabled: 
  40.   auth-crypt 
  41.   compress-bzip2 
  42.   compress-deflate 
  43.   compress-gzip 
  44.   large-files 
  45.   network-openssl 
  46.   regex-conditionals 
  47. disabled: 
  48.   auth-ldap 
  49.   network-ipv6 
  50.   stat-cache-fam 
  51.   storage-gdbm 
  52.   storage-memcache 
  53.   webdav-locks 
  54.   webdav-properties 

出现上面的提示即OK,紧接着

 
  1. # make && make install && make clean 

3)准备工作

copy配置文件以及创建工作目录

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

删除掉一些没用的东东

 
  1. # cd /etc/lighttpd/vhosts.d/ (and /etc/lighttpd/conf.d)
  2. # rm -rf Makefile* 

创建默认配置文件

 
  1. # cd doc/initscripts/ 
  2. # cp sysconfig.lighttpd /etc/sysconfig/lighttpd 

复制启动脚本

 
  1. # cd doc/initscripts/
  2. # cp rc.lighttpd.redhat /etc/init.d/lighttpd 
  3. # chkconfig --add lighttpd
  4. # chkconfig lighttpd on

这个脚本要更改一处东东,29行处修改成如下

 
  1. lighttpd="/usr/local/lighttpd/sbin/lighttpd" 

或者将/usr/local/lighttpd/sbin/lighttpd文件copy一份至/usr/sbin下亦可。

4)修改主配置文件lighttpd.conf

 
  1. var.log_root    = "/var/log/lighttpd" 
  2. var.server_root = "/var/www" 
  3. var.state_dir   = "/var/run" 
  4. var.home_dir    = "/var/lib/lighttpd" 
  5. var.conf_dir    = "/etc/lighttpd" 
  6.  
  7. server.use-ipv6 = "disable"
  8.  
  9. server.username = "www"
  10. server.groupname = "www"
  11.  
  12. server.document-root = server_root

创建日志目录

 
  1. # mkdir /var/log/lighttpd 
  2. # chown -R www.www /var/log/lighttpd/ 

网站目录

 
  1. # mkdir /var/www 
  2. # chown -R www.www /var/www 

编译modules.conf

 
  1. server.modules = ( 
  2.   "mod_access", 
  3.   "mod_fastcgi" 
  4. #  "mod_alias", 
  5. #  "mod_auth", 
  6. #  "mod_evasive", 
  7. #  "mod_redirect", 
  8. #  "mod_rewrite", 
  9. #  "mod_setenv", 
  10. #  "mod_usertrack", 

打开fastcgi功能

 
  1. ## 
  2. ## FastCGI (mod_fastcgi) 
  3. ## 
  4. include "conf.d/fastcgi.conf" 

再编译fastcgi.conf

 
  1. fastcgi.server = ( 
  2.   ".php" => (( 
  3.     "host" => "127.0.0.1", 
  4.     "port" => "9000", 
  5.     "docroot" => "/var/www" 
  6.   ))) 

检查语法错误

 
  1. /usr/local/lighttpd/sbin/lighttpd -t -f /etc/lighttpd/lighttpd.conf 
  2. Syntax OK 

启动

 
  1. # /etc/init.d/lighttpd start 

 本文转自dongfang_09859 51CTO博客,原文链接:http://blog.51cto.com/hellosa/568501,如需转载请自行联系原作者

相关文章
|
20天前
|
PHP 项目管理 开发者
深入解析PHP的命名空间和自动加载机制
【4月更文挑战第4天】 在PHP的编程世界中,命名空间和自动加载机制是构建大型应用程序时不可或缺的工具。本文将深入探讨这两个概念,揭示它们如何简化代码结构、避免类名冲突以及提高代码维护性。通过对PHP命名空间的由来、作用域和使用方法的细致剖析,以及对自动加载机制工作原理和应用实践的全面讲解,读者将获得有效管理复杂项目中依赖关系的能力。
|
1月前
|
PHP 开发者
深入解析PHP的命名空间
【2月更文挑战第29天】 在现代PHP开发中,命名空间是管理代码和避免命名冲突的重要工具。本文将探讨PHP命名空间的核心概念、实现原理及其在实际项目中的应用场景。我们将通过示例代码和最佳实践,帮助开发者更好地理解和运用命名空间,以提升代码的可维护性和复用性。
|
1月前
|
JSON 数据格式
第三方系统或者工具通过 HTTP 请求发送给 ABAP 系统的数据,应该如何解析试读版
第三方系统或者工具通过 HTTP 请求发送给 ABAP 系统的数据,应该如何解析试读版
27 0
|
2天前
|
Web App开发 前端开发 Java
SpringBoot之请求的详细解析
SpringBoot之请求的详细解析
12 0
|
2天前
|
存储 缓存 Java
SpringBootWeb请求响应之前言及状态码的详细解析
SpringBootWeb请求响应之前言及状态码的详细解析
6 0
|
4天前
|
关系型数据库 MySQL PHP
深入解析PHP中的命名空间
【4月更文挑战第20天】在PHP的编程世界中,命名空间是一个强大的工具,用于解决代码中的名称冲突问题。通过本文的深度解析,我们将探索PHP命名空间的概念、实现原理以及它们如何优雅地帮助我们管理代码库。从基础的定义到高级用法,本篇文章旨在提供一份全面的指南,帮助开发者有效利用命名空间来优化他们的PHP项目结构和可维护性。
|
20天前
|
测试技术 PHP 开发者
PHP 7.4新特性深度解析
【4月更文挑战第4天】 本文将深入探讨PHP 7.4的新特性,包括预加载,数组解构,扩展的箭头函数等。我们将详细解释这些新特性的作用,以及如何在项目中使用它们来提高代码的效率和可读性。
|
30天前
|
运维 Linux Apache
LAMP架构调优(十)——Apache禁止指定目录PHP解析与错误页面优化
LAMP架构调优(十)——Apache禁止指定目录PHP解析与错误页面优化
199 2
|
1月前
|
安全 JavaScript 前端开发
若依实现单点登录(解析请求链接中的参数做鉴权认证)
若依实现单点登录(解析请求链接中的参数做鉴权认证)
32 0
|
1月前
|
PHP 开发者
PHP 8.1 新特性解析:提升开发效率与性能的利器
本文将深入探讨PHP 8.1的新特性,包括联合方法调用、never返回类型、str_contains函数等,展示这些更新如何提升开发者的工作效率和代码性能。
15 1

推荐镜像

更多