1

This is my first post here although I often do search and find answers here. This time I've spent a couple of days searching various sites but unfortunately none of the answers in other threads helped in my case.

I manage a few LAMP servers each hosting about 10 to 15 virtual hosts. Each server has a control panel for the admin and client's to manage sites. This has been running well for the past few years on Centos 6 with mod_php.

I'm now upgrading the control panel to run on Centos 7 with PHP installed as mod_fcgid.

Each virtual host has its own apache conf file as below:

<VirtualHost 136.243.195.117:80>
   DocumentRoot "/home/c7demose/public_html"
   ServerName c7.demoserver.co.za
   ServerAlias www.c7.demoserver.co.za mail.c7.demoserver.co.za ftp.c7.demoserver.co.za
  <IfModule mod_fcgid.c>
        SuexecUserGroup c7demose c7demose
    <Directory /home/c7demose/public_html>
      Options +ExecCGI
      AllowOverride All
      AddHandler fcgid-script .php
      FCGIWrapper /var/www/php-fcgi-scripts/c7.demoserver.co.za/php-fcgi-starter .php
      Order allow,deny
      Allow from all
    </Directory>
  </IfModule>

</VirtualHost>

There's no issue with that and each site works as expected. The way this worked in the past is that the control panel listens on a different port, and its vhost config file listens on any IP address and does not have the ServerName variable, so it doesn't matter which domain name the user uses, it will redirect to the control panel if they use the correct port.

In other words user with domain user_one.com can go to user_one.com:10025 and user two can go to his own user_two.com:10025 and both get to the control panel:

<VirtualHost *:10025>
        DocumentRoot "/var/www/html/webcp"
  <IfModule mod_fcgid.c>
        SuexecUserGroup apache apache
    <Directory /var/www/html/webcp>
      Options +ExecCGI
      AllowOverride All
      AddHandler fcgid-script .php
      FCGIWrapper /var/www/php-fcgi-scripts/localhost/php-fcgi-starter .php
      Order allow,deny
      Allow from all
    </Directory>
  </IfModule>

</VirtualHost>

This worked well in the old setup using mod_php. With mod_fcgid It does not work when trying to access the control panel with this "catch all" type of situation.

The browser displays a 500, internal error and the httpd error logs show the following:

[Mon Mar 14 00:06:03.684684 2016] [authz_core:debug] [pid 2585] mod_authz_core.c(809): [client 165.255.92.82:40036] AH01626: authorization result of Require all granted: granted 
[Mon Mar 14 00:06:03.684725 2016] [authz_core:debug] [pid 2585] mod_authz_core.c(809): [client 165.255.92.82:40036] AH01626: authorization result of <RequireAny>: granted 
[Mon Mar 14 00:06:03.783142 2016] [authz_core:debug] [pid 2585] mod_authz_core.c(809): [client 165.255.92.82:40036] AH01626: authorization result of Require all granted: granted 
[Mon Mar 14 00:06:03.783178 2016] [authz_core:debug] [pid 2585] mod_authz_core.c(809): [client 165.255.92.82:40036] AH01626: authorization result of <RequireAny>: granted 
[Mon Mar 14 00:06:03.785111 2016] [fcgid:info] [pid 2581] mod_fcgid: server c7.demoserver.co.za:/var/www/php-fcgi-scripts/localhost/php-fcgi-starter(11458) started
[Mon Mar 14 00:06:03.790277 2016] [fcgid:warn] [pid 2585] (104)Connection reset by peer: [client 165.255.92.82:40036] mod_fcgid: error reading data from FastCGI server
[Mon Mar 14 00:06:03.790305 2016] [core:error] [pid 2585] [client 165.255.92.82:40036] End of script output before headers: index.php
[Mon Mar 14 00:06:09.790430 2016] [fcgid:info] [pid 2581] mod_fcgid: process /var/www/php-fcgi-scripts/localhost/php-fcgi-starter(11458) exit(communication error), terminated by calling exit(), return code: 107 

Ideally I'd like to get this all working with fast_cgi but if there is a way in which I can get the virtual hosts to continue running with fcgi and just the control panel on port 10025 to run using mod_php then that would be an acceptable interim solution, I just don't know how or even if that's possible.

Thanks in advance!

John

  • The error appears to be "End of script output before headers: index.php" – hjpotter92 Sep 9 '16 at 7:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.