#proxy
#tomcat proxy 域名转向TOMCAT
$HTTP["host"] == "www.6688.cc" {
proxy.server = ( "" => ( ( "host" => "192.168.0.243",
"port" => 8001,
"fix-redirects" => 1
) ) )
}
#web proxy
$HTTP["host"] == "www.linuxidc.com" {
proxy.server = ( "" => ( ( "host" => "192.168.0.244" ) ) )
}
#Virtual Host
$HTTP["host"] == "www.linuxidc.net" {
server.name = "www.linuxidc.net"
server.document-root = "/var/www/htdocs/test"
server.errorlog = "/var/log/lighttpd/test-error.log"
accesslog.filename = "/var/log/lighttpd/test-access.log"
}
八、建立相关目录
[root@localhost lighttpd]# mkdir -p /var/log/lighttpd
[root@localhost lighttpd]# mkdir -p /var/www/htdocs
[root@localhost lighttpd]# cd /var/www/htdocs
[root@localhost htdocs]# vi index.html
<html><body><h1>It works on lighttpd</h1></body></html>
启动lighttpd
[root@localhost htdocs]# /usr/local/lighttpd/sbin/lighttpd -f /usr/local/lighttpd/lighttpd.conf
搭建http端口为8001的TOMCAT
WINDOWS平台可在C:\WINDOWS\system32\drivers\etc\hosts文件加上192.168.0.243
即可通过访问lighttpd域名转向
九、配置light支持php
1、安装php
[root@localhost ~]# yum install php
[root@localhost ~]# /usr/bin/php-cgi -v
出现的信息中有个(cgi-fcgi)表示支持fast-cgi了
2、配置ighttpd.conf
[root@localhost ~]# cd /usr/local/lighttpd/
[root@localhost lighttpd]# vi ighttpd.conf
将 # "mod_fastcgi" 的#去掉
#### 配置fastcgi的定义
#### fastcgi module
## read fastcgi.txt for more info
## for PHP don't forget to set cgi.fix_pathinfo = 1 in the php.ini
fastcgi.server = ( ".php" =>
( "localhost" =>
(
"socket" => "/var/run/lighttpd/php-fastcgi.socket",
"bin-path" => "/usr/bin/php-cgi"
)
)
)
3、创建相关资源
[root@localhost lighttpd]# mkdir -p /var/run/lighttpd/
[root@localhost lighttpd]# cd /var/run/lighttpd/
[root@localhost lighttpd]# touch php-fastcgi.socket-0
[root@localhost lighttpd]# touch php-fastcgi.socket-0
重启lighttpd即可。