These forums are locked and archived, but all topics have been migrated to the new forum. You can search for this topic on the new forum: Search for Error 500 on virtual servers with FCGId (run as virtual server owner) on the new forum.
Hello all,
I have many domains on my virtuamin box, most of them running with FCGId (run as virtual server owner), and Joomla. Today, a few servers started to fail with an error 500. Checking the error log I have: [Wed Jan 04 19:48:21 2012] [warn] (104)Connection reset by peer: mod_fcgid: read data from fastcgi server error. [Wed Jan 04 19:48:21 2012] [error] [client 186.204.132.148] Premature end of script headers: index.php
Changing the "PHP script execution mode" to Apache mod_php (run as Apache's user), solved the problem for the moment. If I change back to FCGId I get the error 500 again.
What can I do fix it? It is best to run PHP with FCGId, right?
Thanks Rogerio
On my suexec.log I see:
[2012-01-04 20:32:27]: uid: (1184/gtogintercambiomaster) gid: (630/630) cmd: php5.fcgi [2012-01-04 20:32:27]: directory is writable by others: (/home/gtogintercambiomaster/fcgi-bin)
I've chmoded 744 /home/gtogintercambiomaster/fcgi-bin, but it still doesn't work.
Please help
I guess I know what might have happend... it seems chmod 775 * -R was run on the /home directory. For example, i have another folder like this:
I've just created a new virtualserver to see how the default permissions are, and I got.
So the question, is there a way or script to fix file/folder permissions on each virtualserver?
Thanks
chmod 755 on the fcgi-bin did work.
So I run on the /home directory:
That made the sites online again. But I still need to fix the other directories permissions. How do I do that?
Thanks
Howdy,
Well, having 755 permissions on your directories should be good.
What is it you're looking to tweak exactly?
-Eric
Hi Eric,
The problem is "chmod 775 * -R" was run on the /home directory. So every folder and file for all virtual severs now has 775 permissions, except the fcgi-bin folders that I changed to 755 to put the websites back online. I'm concerned about security. I can't leave the permissions like that, can I?
Thanks Rogerio
Well, it would be difficult to fix all the files/directories in that hierarchy -- but what you could do is go into /home, and set all the directories there to "700". That would make it so that, regardless of what the files/directories under there are set to, folks who shouldn't be able to view them wouldn't have access.
-Eric
Ok Eric, I've done that. Thanks a lot. - Rogerio
With FCGID all dirs need 755 and files 644.
Dirs without php files doesn't matter can be 777 or whatever you need.
Change all permissions for folders from 777 to 755
execute in shell:
find /home/*/public_html -type d -exec chmod 755 {} \;
Change all permissions for files from 666 to 644
find /home/*/public_html -type f -exec chmod 644 {} \;
another problem is .htaccess clean all php_value and php_flag
find /home -type f -name '.htaccess' -exec grep -Hrn 'php_value' '{}' \;
find /home -type f -name '.htaccess' -exec grep -Hrn 'php_flag' '{}' \;
Check your php.conf
If you have fileuploader, by default FCGI only upload 100k, need changes in
FcgidMaxRequestLen 5120000
5 M in this case
Excellent bitpt, thank you very much.