通过lighttpd运行fastcgi服务器
问题描述:
我试图为使用lighttpd web服务器启动的我的fastcgi二进制文件设置权限。当lighttpd启动我的二进制文件时,lighttpd访问权限被传输到我的二进制文件。我需要使用root权限运行我的二进制文件,以便它可以访问某些文件。我读过,出于安全原因以root身份运行lighttpd是不可取的,所以我不愿意这样做。如果以与lighttpd相同的权限运行,则我的fastcgi二进制文件无法读取/写入我的arm文件系统上的文件。通过lighttpd运行fastcgi服务器
下面是一些配置在我lighttpd.conf文件
server.modules = ("mod_rewrite", "mod_redirect", "mod_access", "mod_fastcgi", "mod_proxy", "mod_accesslog")
server.username = "www"
server.groupname = "www"
server.document-root = "/srv/www/htdocs/"
server.errorlog = "/var/log/lighttpd/error.log"
server.upload-dirs = ("/tmp")
server.max-request-size = 40960
server.network-backend = "write"
fastcgi.server = (
".php" =>
("localhost" =>
(
"socket" => "/var/run/lighttpd/php-fastcgi.socket",
"max-procs" => 2,
"bin-path" => "/usr/bin/php-cgi -c /etc"
)
),
".cgi" =>
("localhost" =>
(
"host" => "<hostAddress>",
"port" => 8088,
"min-procs" => 1,
"max-procs" => 1,
"check-local" => "disable",
"bin-path" => "/<pathToMyFastCGI_Binary>/"
))
)
答
感谢观看这个问题。我现在通过运行我的FCGI二进制文件,将用户/组权限设置为“s”来解决我的问题,因此lighttpd将以自己的权限启动我的FCGI二进制文件,而不是使用lighttpd。
谢谢。