lighttpd2.0.4中端口访问网站配置

下载了最新版的lighttpd,然后配置,发现和原来的不一样了。

1.lighttpd.conf更加简洁。模块配置跑到/etc/lighttpd/modules.conf
下,fastcgi的配置在conf.d/下
2.若开启了urlrewrite,注意修改/etc/lighttpd/modules.conf中的模块配置。

3. conf.d/下的配置文件不会自动加载,注意手动包含下

编译后目录结构:

进入 /etc/lighttpd/

#tree

|-- conf.d
|   |-- access_log.conf
|   |-- auth.conf
|   |-- cgi.conf
|   |-- cml.conf
|   |-- compress.conf
|   |-- debug.conf
|   |-- dirlisting.conf
|   |-- evhost.conf
|   |-- expire.conf
|   |-- fastcgi.conf
|   |-- geoip.conf
|   |-- magnet.conf
|   |-- mime.conf
|   |-- mod.template
|   |-- mysql_vhost.conf
|   |-- proxy.conf
|   |-- rrdtool.conf
|   |-- scgi.conf
|   |-- secdownload.conf
|   |-- simple_vhost.conf
|   |-- ssi.conf
|   |-- status.conf
|   |-- trigger_b4_dl.conf
|   |-- userdir.conf
|   `-- webdav.conf
|-- lighttpd.conf
|-- modules.conf
`-- vhosts.d
    |-- vhosts.conf
    `-- vhosts.template

配置文件/etc/lighttpd/vhosts.d/vhosts.conf

$HTTP["host"] =~ "^(www\.)?test.com" {

        server.document-root = "/var/www/test.com"
      #  url.rewrite = (
      #          "(css|files|img|js)/(.*)" => "/$1/$2",
      #          "^([^\?]*)(\?(.+))?$" => "/index.php?url=$1&$3",
      #  )
}

下边这个是端口访问网站的配置范例。注意不要加127.0.0.1,否则报错。
$SERVER["socket"] == ":8888" {
         server.document-root = "/var/www/test1.com"

}

猜你喜欢

转载自bobboy007.iteye.com/blog/806471