Virtualmin GPL with PHP4 (and PHP5) using FastCGI

12 posts / 0 new
Last post
#1 Fri, 05/15/2009 - 13:59
Rizvi

Virtualmin GPL with PHP4 (and PHP5) using FastCGI

Hi there.

We are trying to get PHP4 to work as a FastCGI module. We have successfully installed php4 and FastCGI, and added the module to the directives for the site we need PHP4 to run on, but instead of loading the site we are just getting a blank white page. When running the same site on Apache with PHP4 module, the site loaded just fine.

Using the FastCGI method we are getting the phpinfo() page to load just fine, from within the same site/directory as the site in question. We also made sure the permissions on the .php files are correctly set to the user who owns the virtual server. Not sure what else to check, any suggestions?

Right when I hit the site, there are no "fresh" log entries in error_log generated, but these are in the log from yesterday for some reason, might be from something we were doing..

[Thu May 14 09:04:22 2009] [debug] arch/unix/fcgid_proc_unix.c(525): (111)Connection refused: mod_fcgid: can't connect unix domain socket: /etc/httpd/run/mod_fcgid/4194.8

[Thu May 14 09:46:07 2009] [debug] arch/unix/fcgid_proc_unix.c(525): (111)Connection refused: mod_fcgid: can't connect unix domain socket: /etc/httpd/run/mod_fcgid/4194.9

Any help is appreciated. Reza

Fri, 05/15/2009 - 14:18
andreychek

Hmm, well, you should get a new error message if it's not working.

What I might try is to restart Apache, and then try accessing the webpage again to try and get it to spit out an error message.

Also, do you see your attempt to access it showing up in the access log?
-Eric

Fri, 05/15/2009 - 15:23
Joe
Joe's picture

Check the suexec_log.

--

Check out the forum guidelines!

Fri, 05/15/2009 - 22:49
Rizvi

Ok I restarted Apache, and then tailed the suexec_log, error_log and access_log, here is what has spit out:

access_log:
[code:1]
68.53.168.145 - - [16/May/2009:03:30:02 -0400] "GET / HTTP/1.1" 200 - "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; InfoPath.2; MS-RTC LM 8)"
68.53.168.145 - - [16/May/2009:<b>03:30:08</b> -0400] &quot;GET / HTTP/1.1&quot; 200 - &quot;-&quot; &quot;Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; InfoPath.2; MS-RTC LM 8)&quot;
[/code:1]

/var/log/httpd/error_log (i'm not sure why its not writing this to the domain specific error_log?):
[code:1]
[Sat May 16 03:30:02 2009] [notice] mod_fcgid: call /home/citystudent/domains/toronto.citystudent.com/public_html/index.php with wrapper /home/citystudent/domains/toronto.citystudent.com/fcgi-bin/php4.fcgi
[Sat May 16 <b>03:30:02</b> 2009] [info] mod_fcgid: server /home/citystudent/domains/toronto.citystudent.com/public_html/index.php(2210) started
[/code:1]

suexec_log:
[code:1]
[2009-05-14 09:04:23]: uid: (530/citystudent) gid: (531/531) cmd: php4.fcgi
[2009-05-14 09:46:08]: uid: (530/citystudent) gid: (531/531) cmd: php4.fcgi
[2009-05-16 <b>03:30:02</b>]: uid: (530/citystudent) gid: (531/531) cmd: php4.fcgi
[/code:1]

[root@cp httpd]# date
Sat May 16 03:30:17 EDT 2009

Thanks, again any help is appreciated!

Fri, 05/15/2009 - 23:06
Rizvi

Just another note, subsequent visits to the site are being logged in access_log but nothing is being recorded in error_log.. I turned up the logging to Debug and still nothing.. :(

Sun, 06/07/2009 - 07:54
Rizvi

Here are the directives for the site:

[code:1]
SuexecUserGroup &quot;#530&quot; &quot;#531&quot;
ServerName toronto.citystudent.com
ServerAlias www.toronto.citystudent.com
ServerAlias webmail.toronto.citystudent.com
ServerAlias admin.toronto.citystudent.com
DocumentRoot /home/citystudent/domains/toronto.citystudent.com/public_html
ErrorLog /var/log/virtualmin/toronto.citystudent.com_error_log
CustomLog /var/log/virtualmin/toronto.citystudent.com_access_log &quot;combined&quot;
ScriptAlias /cgi-bin/ /home/citystudent/domains/toronto.citystudent.com/cgi-bin/
ScriptAlias /awstats /home/citystudent/domains/toronto.citystudent.com/cgi-bin
DirectoryIndex index.html index.htm index.php index.php4 index.php5

#&lt;Directory /home/citystudent/domains/toronto.citystudent.com/public_html&gt;
# &lt;Files ~ (\.php)&gt;
# AddHandler php4-script .php
# Options ExecCGI SymLinksIfOwnerMatch
# allow from all
# &lt;/Files&gt;
# Options -Indexes IncludesNOEXEC FollowSymLinks
#&lt;/Directory&gt;

#&lt;Directory /home/citystudent/domains/toronto.citystudent.com/public_html&gt;
#Options -Indexes IncludesNOEXEC FollowSymLinks
#allow from all
#AllowOverride All
#&lt;/Directory&gt;

&lt;Directory /home/citystudent/domains/toronto.citystudent.com/public_html&gt;
Options Indexes IncludesNOEXEC FollowSymLinks ExecCGI
allow from all
AllowOverride All
AddHandler fcgid-script .php
AddHandler fcgid-script .php4
FCGIWrapper /home/citystudent/domains/toronto.citystudent.com/fcgi-bin/php4.fcgi .php
&lt;/Directory&gt;

RemoveHandler .php
RemoveHandler .php4

&lt;Directory /home/citystudent/domains/toronto.citystudent.com/cgi-bin&gt;
allow from all
&lt;/Directory&gt;
RewriteEngine on
RewriteCond %{HTTP_HOST} =webmail.toronto.citystudent.com
RewriteRule ^(.*) https://toronto.citystudent.com:20000/ [R]
RewriteCond %{HTTP_HOST} =admin.toronto.citystudent.com
RewriteRule ^(.*) https://toronto.citystudent.com:10000/ [R]
&lt;Files awstats.pl&gt;
AuthName &quot;toronto.citystudent.com statistics&quot;
AuthType Basic
AuthUserFile /home/citystudent/domains/toronto.citystudent.com/.awstats-htpasswd
require valid-user
&lt;/Files&gt;
LogLevel debug

[/code:1]

Just a note, the citystudent site that is &quot;live&quot; on the net is sitting on my old server that is waiting to be decommissioned (uses HSphere), we are working on my new server (with IP 69.42.52.170), so you just need to point your HOSTS to that if you want to give it a try... and see the the wonderful blank white page. ;)

Thanks.

Sat, 05/16/2009 - 00:18
Joe
Joe's picture

So you're not getting errors any more, but it's still not working? That makes no sense. Are you sure the script is producing output? Could you try a simple phpinfo page?

&lt;?php

// Show all information, defaults to INFO_ALL
phpinfo();

--

Check out the forum guidelines!

Mon, 05/18/2009 - 20:26
Rizvi

If you don't mind to point your hosts file to 69.42.52.170 for toronto.citystudent.com and then try hitting this page, you can see what I'm seeing.

http://toronto.citystudent.com/phpinfo.php

also

http://toronto.citystudent.com/index.php

I checked with HTTPwatch and it returns a status 200 and thats all.

Thanks for the continued help.

Mon, 05/18/2009 - 20:48 (Reply to #8)
Joe
Joe's picture

You've got me stumped (or rather PHP has me stumped). I have no idea what to do with no errors and no output.

Anything in the system-wide error_log?

Oh, are you loading both mod_php version 4 and 5 at the same time?

Just to be clear, you don't need any mod_php to run things under mod_fcgid, but I've seen people enable mod_php thinking they need it.

That will produce this exact behavior (or something very like it), because the Apache process will crash on every request that involves PHP.

--

Check out the forum guidelines!

Mon, 05/18/2009 - 20:49 (Reply to #9)
Joe
Joe's picture

And to be further clear, one mod_php is fine, even along-side mod_fcgid. Two mod_phps is not (with or without mod_fcgid).

--

Check out the forum guidelines!

Wed, 05/20/2009 - 19:37
Rizvi

Hi Joe. I'm confused, where did you see that we're running both mod_php and mod_fcgid at the same time? Also I don't think Apache is crashing, that would probably be logged.

Thanks,
Reza

Wed, 05/20/2009 - 19:49 (Reply to #11)
Joe
Joe's picture

I said:

&quot;Oh, are you loading both mod_php version 4 and 5 at the same time?&quot;

And, as an afterthought I injected the bit about running mod_php and mod_fcgid.

To clarify, again: It is OK to run run mod_fcgid and mod_php together, but unnecessary.

It is not OK to run two versions of mod_php at the same time in the same Apache process, and it will break things to do so.

I was making no assumptions about your configuration. I was just mentioning one condition that would lead to Apache failing to respond and failing to log anything.

You know I'm just guessing at this point, right? I have no idea what's wrong. Without errors, I'm completely flying blind. Just mentioning something I've seen in the past that seemed like a mysterious problem at the time.

--

Check out the forum guidelines!

Topic locked