• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Issue Problems with mod proxy_fcgi

Tam Nguyen

New Pleskian
I've been battling this for quite a few hours, and I've concluded that the error I'm getting has to do with proxy_fcgi, which is baked into apache 2.4.6.

When I visit this page https://headshotcrew.com/maurice-jager, I'd get the 500 response intermittently. Sometimes, the page actually loads even though Chrome tells me the server responded with 500.

Here's the error I get in my per-site error logs:

Code:
./error_log:[Wed Jul 05 22:59:18.614924 2017] [proxy_fcgi:error] [pid 27324:tid 140188772710144] [client 196.52.2.65:48576] Premature end of script headers: index.php, referer: https://headshotcrew.com/maurice-jager
./error_log:[Wed Jul 05 22:59:18.614984 2017] [proxy_fcgi:error] [pid 27324:tid 140188772710144] [client 196.52.2.65:48576] AH01070: Error parsing script headers, referer: https://headshotcrew.com/maurice-jager

And here's the error I get in modsec_audit.log

Code:
--b00da07e-A--
[06/Jul/2017:00:05:30 --0400] WV23CtsjLirjwJW7-V7nYgAAAAI 74.208.174.211 55376 74.208.174.211 7081
--b00da07e-B--
GET /maurice-jager HTTP/1.0
Host: headshotcrew.com
X-Real-IP: 196.52.2.65
X-Accel-Internal: /internal-nginx-static-location
Connection: close
cache-control: max-age=0
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.50 Safari/537.36
upgrade-insecure-requests: 1
accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
dnt: 1
accept-encoding: gzip, deflate, br
accept-language: en-US,en;q=0.8,vi;q=0.6
cookie: SSESS002befecc02cd852f25fc2285a18c45e=tBVzfRxHuSdo2ltUBfA4i6svw9_HRDxp0MDTOEqR4vA; has_js=1

--b00da07e-F--
HTTP/1.1 500 Internal Server Error
X-Content-Type-Options: nosniff

--b00da07e-E--

--b00da07e-H--
Apache-Error: [file "util_script.c"] [line 455] [level 3] %s: %s
Apache-Error: [file "mod_proxy_fcgi.c"] [line 756] [level 3] AH01070: Error parsing script headers
Apache-Error: [file "mod_proxy_fcgi.c"] [line 688] [level 3] AH01068: Got bogus version %d
Apache-Error: [file "mod_proxy_fcgi.c"] [line 914] [level 3] [status 22] AH01075: Error dispatching request to %s:
Apache-Handler: proxy:unix:///var/www/vhosts/system/headshotcrew.com/php-fpm.sock|fcgi://127.0.0.1:9000
Stopwatch: 1499313930054033 531053 (- - -)
Stopwatch2: 1499313930054033 531053; combined=9, p1=2, p2=5, p3=0, p4=0, p5=2, sr=0, sw=0, l=0, gc=0
Response-Body-Transformed: Dechunked
Producer: ModSecurity for Apache/2.9.0 (http://www.modsecurity.org/).
Server: Apache
Engine-Mode: "ENABLED"

--b00da07e-Z--

From what I can gather, even one from this forum (Issue - AH01068: Got bogus version 32), I'm screwed unless I upgrade my Apache. Am I screwed? Is there another way? If not, how do I upgrade Apache? I'm running Plesk Onyx 17.5.3 and CentOS Linux 7.3.1611.

Edit: apparently 2.4.6 is what's supported Apache httpd versions supported in Red Hat Enterprise Linux - Red Hat Customer Portal

Thanks!
 
Last edited:
Hi Tam Nguyen,

I'm screwed unless I upgrade my Apache
Correct.

Am I screwed?
Yes.

Is there another way?
If you don't desire to compile apache by yourself, you only have the possibilities to upgrade with additional sources/repos ( but pls. note, that you could experience issues/errors/problems, if the used apache version is not declared as "supported" at the Plesk documentation:

 
In my opinion it's not a proxy_fcgi error, but a PHP script error.
"Premature end of script headers: index.php"
is a clear indication that the script is not running correctly. This can be caused by a certain start condition or variables. Maybe some environment variables that are needed are not filled. Maybe the script sends a PHP header() but does not put anything into it. Difficult to say, but almost certainly there is something wrong with the script. It is easy to test: Create a <?php phpinfo() ?> script file and request that over and over again. You probably will not be able to reproduce the error with it.
 
In my opinion it's not a proxy_fcgi error, but a PHP script error.
"Premature end of script headers: index.php"
is a clear indication that the script is not running correctly. This can be caused by a certain start condition or variables. Maybe some environment variables that are needed are not filled. Maybe the script sends a PHP header() but does not put anything into it. Difficult to say, but almost certainly there is something wrong with the script. It is easy to test: Create a <?php phpinfo() ?> script file and request that over and over again. You probably will not be able to reproduce the error with it.
It's just Drupal with a few profiles on the site. We didn't cook up anything crazy ourselves.

I guess it's time to rollback, and say goodbye to Plesk. I was actually having problems with Plesk taking a full minute for each page to load in the GUI too, and it was driving me insane.

Thanks you guys.
 
Also, the site worked on the old server with the exact same code, so it's definitely something with the new Apache and its mod(s).
 
As the GUI is controlled and delivered completely separate from the regular Nginx/Apache configuration of your websites, a slow GUI is a different topic.
 
Back
Top