首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >无法启动lighttpd服务守护进程

无法启动lighttpd服务守护进程
EN

Stack Overflow用户
提问于 2019-01-15 14:58:29
回答 2查看 1.7K关注 0票数 2

我想在我的远程ubuntu服务器上设置lighttpd并启动烧瓶应用程序,但是当我使用systemctl重新启动lighttpd时,我遇到了一些问题

以下是错误日志:

systemctl状态照明

代码语言:javascript
运行
复制
● lighttpd.service - Lighttpd Daemon
   Loaded: loaded (/lib/systemd/system/lighttpd.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Tue 2019-01-15 14:31:38 UTC; 3s ago
  Process: 19104 ExecStart=/usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf (code=exited, status=255)
  Process: 19097 ExecStartPre=/usr/sbin/lighttpd -t -f /etc/lighttpd/lighttpd.conf (code=exited, status=0/SUCCESS)
 Main PID: 19104 (code=exited, status=255)

Jan 15 14:31:38 ubuntu systemd[1]: Starting Lighttpd Daemon...
Jan 15 14:31:38 ubuntu lighttpd[19097]: Syntax OK
Jan 15 14:31:38 ubuntu systemd[1]: Started Lighttpd Daemon.
Jan 15 14:31:38 ubuntu systemd[1]: lighttpd.service: Main process exited, code=exited, status=255/n/a
Jan 15 14:31:38 ubuntu systemd[1]: lighttpd.service: Unit entered failed state.
Jan 15 14:31:38 ubuntu systemd[1]: lighttpd.service: Failed with result 'exit-code'.

尾/var/log/lighttpd/error.log

代码语言:javascript
运行
复制
2019-01-15 14:31:38: (log.c.164) server started
2019-01-15 14:31:38: (mod_fastcgi.c.1112) the fastcgi-backend /var/www/landing/landing.fcgi failed to start:
2019-01-15 14:31:38: (mod_fastcgi.c.1116) child exited with status 8 /var/www/landing/landing.fcgi
2019-01-15 14:31:38: (mod_fastcgi.c.1119) If you're trying to run your app as a FastCGI backend, make sure you're using the FastCGI-enabled version.
If this is PHP on Gentoo, add 'fastcgi' to the USE flags.
2019-01-15 14:31:38: (mod_fastcgi.c.1406) [ERROR]: spawning fcgi failed.

这是我的lighttpd.conf

cat /etc/lighttpd/Lightttpd.conf

代码语言:javascript
运行
复制
server.modules = (
        "mod_access",
        "mod_alias",
        "mod_compress",
        "mod_redirect",
        "mod_rewrite",
        "mod_fastcgi",
)

server.document-root        = "/var/www/"
server.upload-dirs          = ( "/var/cache/lighttpd/uploads" )
server.errorlog             = "/var/log/lighttpd/error.log"
server.pid-file             = "/var/run/lighttpd.pid"
server.username             = "www-data"
server.groupname            = "www-data"
server.port                 = 80

index-file.names            = ( "index.php", "index.html", "index.lighttpd.html" )
url.access-deny             = ( "~", ".inc" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )

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

include_shell "/usr/share/lighttpd/create-mime.assign.pl"
include_shell "/usr/share/lighttpd/include-conf-enabled.pl"

fastcgi.server = (
    "/" =>
    ((
        "socket" => "/tmp/landing-fcgi.sock",
        "bin-path" => "/var/www/landing/landing.fcgi",
        "check-local" => "disable",
        "max-procs" => 1
    ))
)

alias.url = (
    "/static/" => "/var/www/landing/static/",
)

url.rewrite-once = (
    "^(/static($|/.*))$" => "$1",
    "^(/.*)$" => "/landing.fcgi$1"
)

还有我的landing.fcgi

代码语言:javascript
运行
复制
from flup.server.fcgi import WSGISerever
import app

if __name__ == '__main__':
    WSGIServer(app, bindAddress='/tmp/landing-fcgi.sock').run()
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2019-01-15 19:16:00

解决方案:我发现了非常不错的python,它为烧瓶应用程序生成了框架,并创建了一个基本的配置。

它对我很好,只是我和flup库发生了冲突。

我安装了flup==1.0.3.dev-20110405版本,并在python3文件中将python3解释器更改为python2解释器。

另外,我想说的是,我删除了118字符串:

input("Press enter to continue (if everything is okay)..."),因为出于某种原因,我有一个异常。

希望我的回答能对某人有所帮助。

票数 0
EN

Stack Overflow用户

发布于 2019-01-16 03:34:11

lighttpd可以同时完成快速can和uwsgi (以及其他协议)。

烧瓶可以做快速和uwsgi,以及其他协议。

如果您使用烧瓶作为WSGI服务器,则应该使用mod_scgi (而不是mod_fastcgi)并使用scgi.protocol = "uwsgi"配置mod_scgi

lighttpd文档在这里通过多个选项:https://redmine.lighttpd.net/projects/lighttpd/wiki/HowToPythonWSGI

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54201431

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档