简体   繁体   English

Python + PHP + Lighttpd?

[英]Python + PHP + Lighttpd?

I've set up a few web servers in my day, but I'm not sure how they work internally. 我在我的日子里设置了一些网络服务器,但我不确定它们是如何在内部工作的。 I'm setting up a new environment for myself and I'm interested in configuring my lighttpd server to support both PHP and Python. 我正在为自己设置一个新的环境,我对配置我的lighttpd服务器以支持PHP和Python感兴趣。 Is this possible? 这可能吗?

Yes, this is possible. 是的,这是可能的。 Here you can find a sample configuration. 在这里您可以找到示例配置。

fastcgi.server = (
".php" => ((
"bin-path" => "/usr/bin/php5-cgi",
"socket" => "/tmp/php.socket"
)),
"django.fcgi" => (
"main" => (
"host" => "127.0.0.1",
"port" => 9090, #set the port numbers to what-eva you want
),
),
"admin.fcgi" => (
"admin" => (
"host" => "127.0.0.1",
"port" => 9091,
)
)
)

You can also enable Lighty to use .pl, .py and .php as 'cgi' by enabling mod_cgi and setting it up. 您还可以通过启用mod_cgi并设置它来使Lighty能够将.pl,.py和.php用作'cgi'。 The default configs are on the Lighty website. 默认配置在Lighty网站上。 However, this will have the benefits and problems of running an independent cgi process. 但是,这将具有运行独立cgi进程的好处和问题。 If you are only experiencing light traffic, performance shouldn't be an issue. 如果您只是遇到轻量级流量,性能应该不是问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM