在ubuntu11.04 下源码安装 lighttpd + php

6 篇文章 0 订阅
4 篇文章 0 订阅

开始:先下载安装proc:http://www.pcre.org/

下载当前最新版:pcre-8.12.zip

mv pcre-8.12.zip /opt
sudo unzip pcre-8.12.zip
cd pcre-8.12
sudo ./configure
sudo make 
sudo  make install

安装bzip2库

sudo apt-get install libbz2-dev

安装libzip库

sudo apt-get install libzip-dev

下载lighttpd当前最新版:http://www.lighttpd.net lib

sudo wget http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-1.4.28.tar.gz
tar -zxvf  lighttpd-1.4.28.tar.gz
cd lighttpd-1.4.28
sudo ./configure --prefix=/usr/local/lighttpd
sudo make 
sudo make install

到此为止lighttpd安装完毕。

测试lighttpd运行情况

编辑lighttpd.conf,在/var/www/lighttd/test/下放一个简单的html:index.html

server.document-root = "/var/www/lighttpd/test"

server.port = 8011

mimetype.assign = (
  ".html" => "text/html",
  ".txt" => "text/plain",
  ".jpg" => "image/jpeg",
  ".png" => "image/png"
)

index-file.names = ( "index.html" )
运行lighttpd
cd /usr/local/lighttpd
sudo ln -s sbin/lighttpd /usr/local/sbin/lighttpd
lighttpd -f lighttpd.conf
netstat -ntlp 查看有无8011的端口,有则算是成功了。

安装php5:http://www.php.net 

下载5.3.6

sudo tar -zxvf php-5.3.6.tar.gz
cd  php-5.3.6
sudo ./configure --prefix=/usr/local/php5
sudo make
sudo make install

下班,明天接着做...

今天接着试验。

编辑lighttpd.conf

server.document-root = "/var/www/lighttpd/test"

server.port = 8011

mimetype.assign = (
  ".html" => "text/html",
  ".txt" => "text/plain",
  ".jpg" => "image/jpeg",
  ".png" => "image/png"
)

index-file.names = ( "index.html" )

static-file.exclude-extensions = ( ".fcgi", ".php", ".rb", "~", ".inc" )

server.modules         = (
                    "mod_rewrite",
                    "mod_redirect",
                    "mod_access",
                    "mod_fastcgi",
                    "mod_compress",
                    "mod_accesslog" )

fastcgi.server = ( ".php" =>
  ( "localhost" =>
    (
      "socket" => "/tmp/php-fastcgi.socket",
      "bin-path" => "/usr/local/php5/bin/php-cgi"
    )
   )
)
启动lighttpd
cd /usr/local/lighttpd
lighttpd -f lighttpd.conf

到此为止PHP+Lighttpd的环境配置完毕


参考:http://www.cnblogs.com/czh-liyu/archive/2010/03/23/1692587.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值