更新:
我重新阅读了您的问题,并在大约 10 分钟内使用 mojolicous::lite 构建了一个快速的 lighttpd。
遵循了几个快速指南。
如果你构建一个简单的 mojolicious::lite 比如:
l_myapp.pl
#!/usr/bin/env perl
use Mojolicious::Lite;
# Documentation browser under "/perldoc"
plugin 'PODRenderer';
get '/' => sub {
my $c = shift;
$c->render('index');
};
app->start;
__DATA__
@@ index.html.ep
% layout 'default';
% title 'Welcome';
Welcome to the Mojolicious real-time web framework!
@@ layouts/default.html.ep
<!DOCTYPE html>
<html>
<head><title><%= title %></title></head>
<body><%= content %></body>
</html>
然后构建一个指向您的 lite 应用程序的 conf 文件。
lightthpd.conf
#test
#
server.modules = (
"mod_fastcgi",
"mod_cgi",
)
server.document-root = "/var/www/html/"
server.port = 8080
mimetype.assign = (
".html" => "text/html",
".txt" => "text/plain",
".jpg" => "image/jpeg",
".png" => "image/png"
)
#------------------------
#for host sub in IP address
#"port" does not seem to work so use server.port
$HTTP["host"] == "xxx.xxx.xxx.xxx" {
fastcgi.server = ("/" => ((
"bin-path" => "/opt/web-interface/l_myapp/l_myapp.pl fastcgi",
"check-local" => "disable",
"fix-root-scriptname" => "enable",
"port" => 3000))
)
}
在命令行:
lighttpd -D -f lighttpd.conf
这应该在通过网页“ip地址”尝试后在命令行上给你:8080
- 2014-09-26 10:58:20: (log.c.166) 服务器启动
- [Fri Sep 26 10:58:30 2014] [debug] 您的密码需要更改!!!
- [2014 年 9 月 26 日星期五 10:58:30] [调试] GET "/"。
- [Fri Sep 26 10:58:30 2014] [debug] 路由到回调。
- [Fri Sep 26 10:58:30 2014] [debug] 从 DATA 部分渲染模板“index.html.ep”。
- [Fri Sep 26 10:58:30 2014] [debug] 从 DATA 部分渲染模板“layouts/default.html.ep”。
- [Fri Sep 26 10:58:30 2014] [debug] 200 OK (0.004694s, 213.038/s)。
希望这会有所帮助。