dongzhong9055 2015-08-12 01:38
浏览 39
已采纳

使用非apache用户在非apache端口上运行PHP应用程序

We have a PHP application which automates script commands. Many of these are through web interfaces. I want this php application user to be running lots of cli and ssh commands, so I dont really want www-data doing it, as it would involve changing lots of script files to www-data executable permissions, and we want scripts to be entered into web interfaces.

This application is cross-operating system. Ideally on anything that php runs on, but win, mac,

The important things that we need to be able to do are (I think) ...

1) Have a Web Server (It's currently Apache, and that's working cross os so that would be great), that is running under normal settings, normal user, reverse proxied to the below application on te same server. 2) Have a PHP application on a different port, running as its own user that can do whatever it wants.

The ability to just run

php -S localhost:8000

As is available in the built in php web server seems ideal for this. So...

1) Is it safe to use the PHP built in Web Server if it's behind an apache proxy? I'm assuming the fact we are proxying over the entire request anyway means no, since it says not to.

2) Is there another Web Server/PHP Server that can easily do this?

3) Is there a way of running two apache processes to do this?

4) Am i doing this the wrong way entirely? There's another app I know that does it like that, but a Java app and the whole process is started and owned by a non apache user.

Thanks in advance

  • 写回答

1条回答 默认 最新

  • doubu0897 2015-08-12 02:02
    关注

    Apache 2.4 + php-fpm + mod_proxy_fcgi will suit you just fine.

    (to elaborate for the downvote -- php-fpm allows the PHP process to run as a separate daemon under its own userid which is exactly the privilege separation requested here)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度