Fedora中安装lighttpd+PHP with CGI

yum install lighttpd

yuminstalllighttpd-fastcgi

yum install php php-cli php-gd php-mysql php-mcrypt php-mbstring php-pdo

安装完毕

下面就是配置了

vi /etc/lighttpd/lighttpd.conf

1,设置要加载的module

server.modules=(

"mod_rewrite",

"mod_redirect",

"mod_alias",

"mod_access",

#"mod_trigger_b4_dl",

#"mod_auth",

#"mod_status",

#"mod_setenv",

"mod_fastcgi",

#"mod_proxy",

#"mod_simple_vhost",

#"mod_evhost",

#"mod_userdir",

"mod_cgi",

#"mod_compress",

#"mod_ssi",

#"mod_usertrack",

#"mod_expire",

#"mod_secdownload",

#"mod_rrdtool",

                                "mod_accesslog" )

把前面的注释去掉就行了

2,开启PHP的Fast-CGI和CGI方式加载

把下面两个区段前的注释去掉

fastcgi.server

cgi.assign

3,设置以root方式运行php

把以下都注释掉,就会以root运行了

## change uid to <uid> (default: don't care)

#server.username="lighttpd"

##changeuidto<uid>(default:don'tcare)

#server.groupname           = "lighttpd"

4, 网站根目录 server.document-root = "/var/www/"

5,服务监听端口

server.port=80

相关推荐