httpd.conf文件:
LoadModule fcgid_module modules/mod_fcgid.so AddHandler fcgid-script .php FCGIWrapper /usr/local/php5 .php # manual MaxRequestsPerProcess 1000 FcgidMaxProcesses 200 FcgidProcessLifeTime 7200 MaxProcessCount 500 FcgidIOTimeout 400 FcgidIdleTimeout 600 FcgidIdleScanInterval 90 FcgidBusyTimeout 300 FcgidBusyScanInterval 80 ErrorScanInterval 3 ZombieScanInterval 3 DefaultMinClassProcessCount 0 DefaultMaxClassProcessCount 3 MaxRequestLen 20468982 <VirtualHost *> ServerName hostname DocumentRoot /home/web ServerAdmin [email protected] <IfModule mod_suphp.c> suPHP_UserGroup web web </IfModule> SuexecUserGroup web web UserDir disable </VirtualHost>
这是我的包装:
#!/bin/sh exec /usr/local/bin/php
我的错误是:
在/ usr /本地/ Apache2的/日志/ suexec_log
[2019-09-03 06:55:28]: user mismatch (daemon instead of www)
在/ usr /本地/ Apache2的/日志/ error_log中
suexec policy violation: see suexec log for more details [Tue Sep 03 06:55:28 2019] [warn] [client 127.0.0.1] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server [Tue Sep 03 06:55:28 2019] [error] [client 127.0.0.1] Premature end of script headers: phpinfo.php
更新:
我编辑过:
/usr/local/apache2/bin/suexec -V -D AP_DOC_ROOT="/" -D AP_GID_MIN=100 -D AP_HTTPD_USER="www" -D AP_LOG_EXEC="/usr/local/apache2/logs/suexec_log" -D AP_SAFE_PATH="/usr/local/bin:/usr/bin:/bin" -D AP_UID_MIN=100 -D AP_USERDIR_SUFFIX="www"
但没有我得到没有错误,没有发现…
suexec文件表明它只有在底层用户是www的情况下才会起作用。 看来,该网站作为守护进程运行。 您可以通过在httpd.conf文件中放入用户www来改变这一点。 顺便说一句,httpd.conf文件看起来非常空,可能有其他文件被包含或附加在您find它的目录中的其他地方。这可能是用户指令已被放置的地方。
你的包装shell肯定会返回一个错误,因为它启动了PHP程序。 我不知道如果没有程序运行它会做什么。 Apache期望来自任何程序的输出,包含正确的HTTP头,这些将不会自动生成。