论坛首页 Ruby版

ubunut 搭建rails2.02环境时,安装lightttpd时出错,

浏览 265 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
时间:2008-05-03 关键字: lighttpd
根据robbin 在Linux平台上安装和配置Ruby on Rails详解

在ubuntu7.10本地测试搭建rails2.02环境,

下载lighttpd:
http://www.lighttpd.net/download/
tar xzvf lighttpd-1.4.13.tar.gz
cd lighttpd-1.4.13
./configure --prefix=/usr/local/lighttpd

cp doc/sysconfig.lighttpd /etc/sysconfig/lighttpd
mkdir /etc/lighttpd
cp doc/lighttpd.conf /etc/lighttpd/lighttpd.conf

然后修改/etc/init.d/lighttpd,把
LIGHTTPD_BIN=/usr/sbin/lighttpd
改为
LIGHTTPD_BIN=/usr/local/lighttpd/sbin/lighttpd

此脚本用来控制lighttpd的启动:
/etc/init.d/lighttpd start

出现错误:
Can't open /etc/rc.status



去搜索了一通,没有搜索到,所以就来这里请教了,谢谢大家
   
时间:2008-05-03
不能完全按照robbin的介绍来配置ubuntu上的lighttpd,robbin的介绍主要以RedHat和SuSe为主,我昨天在ubuntu下配置lighttpd+fastcgi+rubyonrails+mysql成功,当然主要是参考robbin的介绍,全部是下载源码,编译安装的。
lighttpd.conf的配置如下:

server.modules = (
"mod_access",
"mod_alias",
"mod_accesslog",
"mod_compress",
"mod_rewrite",
"mod_fastcgi",
"mod_simple_vhost",
"mod_cgi",
"mod_expire"
)

server.document-root = "/var/www/"

server.errorlog = "/var/log/lighttpd/error.log"

index-file.names = ( "index.php", "index.html",
"index.htm", "default.htm",
"index.lighttpd.html" )


accesslog.filename = "/var/log/lighttpd/access.log"

url.access-deny = ( "~", ".inc" )

static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )

## bind to port (default: 80)
# server.port = 81

## bind to localhost only (default: all interfaces)
## server.bind = "localhost"

## to help the rc.scripts
server.pid-file = "/var/run/lighttpd.pid"

## virtual directory listings
dir-listing.encoding = "utf-8"
server.dir-listing = "enable"

### only root can use these options
#
# chroot() to directory (default: no chroot() )
#server.chroot = "/"

## change uid to <uid> (default: don't care)
server.username = "www-data"

## change uid to <uid> (default: don't care)
server.groupname = "www-data"

#### compress module
compress.cache-dir = "/var/cache/lighttpd/compress/"
compress.filetype = ("text/plain", "text/html", "application/x-javascript", "text/javascript", "text/css")

expire.url = ( "/favicon.ico" => "access 3 days",
"/images/" => "access 3 days",
"/stylesheets/" => "access 3 days",
"/javascripts/" => "access 3 days" )

mimetype.assign = (
".css" => "text/css",
".gif" => "image/gif",
".htm" => "text/html",
".html" => "text/html",
".jpeg" => "image/jpeg",
".jpg" => "image/jpeg",
".js" => "text/javascript",
".png" => "image/png",
".swf" => "application/x-shockwave-flash",
".txt" => "text/plain"
)

$HTTP["remoteip"] == "127.0.0.1" {
server.document-root = "/home/fangjf/webapps/blog/public"
server.error-handler-404 = "/dispatch.fcgi"
fastcgi.server = (".fcgi" =>
("localhost" =>
("min-procs" => 10,
"max-procs" => 10,
"socket" => "/tmp/rails.socket",
"bin-path" => "/home/fangjf/webapps/blog/public/dispatch.fcgi",
"bin-environment" => ("RAILS_ENV" => "development")
)
)
)
}
   
0 请登录后投票
时间:2008-05-03
/etc/init.d/lighttpd的配置如下:

#!/bin/sh
### BEGIN INIT INFO
# Provides: lighttpd
# Required-Start: networking
# Required-Stop: networking
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start the lighttpd web server.
### END INIT INFO


PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/local/lighttpd/sbin/lighttpd
NAME=lighttpd
DESC="web server"
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
ENV="env -i LANG=C PATH=/usr/local/bin:/usr/bin:/bin"
SSD="/sbin/start-stop-daemon"

DAEMON_OPTS="-f /etc/lighttpd/lighttpd.conf"

test -x $DAEMON || exit 0

set -e

# be sure there is a /var/run/lighttpd, even with tmpfs
mkdir -p /var/run/lighttpd > /dev/null 2> /dev/null
chown www-data:www-data /var/run/lighttpd
chmod 0750 /var/run/lighttpd

. /lib/lsb/init-functions

case "$1" in
start)
log_daemon_msg "Starting $DESC" $NAME
if ! $ENV $SSD --start --quiet\
--pidfile $PIDFILE --exec $DAEMON -- $DAEMON_OPTS ; then
log_end_msg 1
else
log_end_msg 0
fi
;;
stop)
log_daemon_msg "Stopping $DESC" $NAME
if $SSD --quiet --stop --oknodo --retry 30\
--pidfile $PIDFILE --exec $DAEMON; then
rm -f $PIDFILE
log_end_msg 0
else
log_end_msg 1
fi
;;
reload)
log_daemon_msg "Reloading $DESC configuration" $NAME
if $SSD --stop --signal 2 --oknodo --retry 30\
--quiet --pidfile $PIDFILE --exec $DAEMON; then
if $ENV $SSD --start --quiet \
--pidfile $PIDFILE --exec $DAEMON -- $DAEMON_OPTS ; then
log_end_msg 0
else
log_end_msg 1
fi
else
log_end_msg 1
fi
;;
restart|force-reload)
$0 stop
[ -r $PIDFILE ] && while pidof lighttpd |\
grep -q `cat $PIDFILE 2>/dev/null` 2>/dev/null ; do sleep 1; done
$0 start
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
exit 1
;;
esac

exit 0
   
0 请登录后投票
时间:2008-05-03
非常感谢,,回家去试试
   
0 请登录后投票
论坛首页 Ruby版

跳转论坛: