转:ubuntu下lighttpd+php5的配置

 

原文地址:http://liuqingyan.blogspot.com/2009/01/ubuntu-810lighttpdphp.html

sudo apt-get install lighttpd php5-cgi php5-mysql
sudo lighty-enable-mod fastcgi
sudo /etc/init.d/lighttpd force-reload

编辑/var/www/index.php

<?php php_info(); ?>

定义一个虚拟主机:

$HTTP["host"] == "www.lihy.com" {
server.name = "www.lihy.com"
server.document-root = "/home/liheyuan/workspace_php/"
server.errorlog = "/home/liheyuan/workspace_php/error.log"
accesslog.filename = "/home/liheyuan/workspace_php/access.log"
}

注意:这里的error.log和access.log所有者必须是www-data:www-data,否则无法启动lighttpd

Leave a Reply

Your email address will not be published. Required fields are marked *