上次搭好的环境,后面可以运行了。但一直都没有记下这个过程。再后来,发现lighttpd,在每天早上一些搜索引擎来抓一个exblog的网页时,经常让lighttpd当掉。现在已经重装了web服务器,又用回apache了,以下有些内容是凭记忆写的。
dddd
lighttpd虚拟主机的配置文件:
debian:/home/stone/web-bak/etc/lighttpd/conf-available# cat 11-simple-vhost.conf ## Simple name-based virtual hosting ## ## Documentation: /usr/share/doc/lighttpd-doc/simple-vhost.txt ## http://www.lighttpd.net/documentation/simple-vhost.html
server.modules += ( "mod_simple_vhost" )
## The document root of a virtual host isdocument-root = ## simple-vhost.server-root + $HTTP["host"] + simple-vhost.document-root simple-vhost.server-root = "/var/www" simple-vhost.document-root = "/public/"
## the default host if no host is sent simple-vhost.default-host = "default.com"
$HTTP["host"] ==""{ server.document-root = "/var/www//public" url.rewrite = ( "^/$"=>"index.html","^([^.]+)$"=> "$1.html") server.error-handler-404 = "/dispatch.fcgi" fastcgi.server = ( ".fcgi" => ("localhost"=> ("min-procs"=> 2, "max-procs"=> 2, "socket"=> "/tmp/wwwsm703com.fcgi.socket", "bin-path"=> "/var/www//public/dispatch.fcgi", "bin-environment"=> ( "RAILS_ENV" => "development") ) ) ) }
$HTTP["host"]=~"noteme.net" { server.document-root = "/var/www/note" }
$HTTP["host"]=~"(|sm114.cn)" { server.document-root = "/var/www/sm114" } $HTTP["host"]=~"(|0598114.com)" { server.document-root = "/var/www/sm114" } $HTTP["host"]=~"(^|\.)pk0598\.com" { server.document-root = "/var/www/sm18900" } $HTTP["host"]=="db.sm114.cn" { server.document-root = "/var/www/phpMyAdmin2902" auth.require =("/"=> ( "method"=>"basic", "realm"=>"need password", "require" => "user=stone" ) ) }
|
lighttpd的fastcgi模块的配置文件:
debian:/home/stone/web-bak/etc/lighttpd/conf-available# cat 10-fastcgi.conf ## FastCGI programs have the same functionality as CGI programs, ## but are considerably faster through lower interpreter startup ## time and socketed communication ## ## Documentation: /usr/share/doc/lighttpd-doc/fastcgi.txt.gz ## http://www.lighttpd.net/documentation/fastcgi.html
server.modules += ( "mod_fastcgi" ) 打开下面这个选项可以调试用 #fastcgi.debug = 1
## Start an FastCGI server for php4 (needs the php4-cgi package) fastcgi.server = ( # ".fcgi" => ( # "localhost" => ( # "min-procs" => 1, # "max-procs" => 1, # "socket" => "/tmp/rails.socket", # "bin-path" => "/var/www/", # "bin-environment" => ( "RAILS_ENV" => "development" ) # )因为只有一个虚拟主机使用rails,所以这边我就注释了,改放到虚拟主机配置中 # ), ".php" => ( "localhost" => ( "bin-path" => "/usr/bin/php5-cgi", "socket" => "/tmp/php5-fcgi.socket" ) ) )
|
发现原存在/images/目录下的图片都不能访问了,改成其它目录名就可以访问.不知何故,后将lighttpd.conf文件中如下一部分的那一行注释掉就行了:
$HTTP["host"] == "localhost" { global { alias.url += ( "/doc/" => "/usr/share/doc/", # "/images/" => "/usr/share/images/" ) } dir-listing.activate = "enable" }
|
好像,须将使用rails的网站目录下的log目录要设成可写的。
阅读(1391) | 评论(0) | 转发(0) |