I’ve created a virtual server and installed Wordpress onto it.
But I’m getting “500 internal server error” and, looking at the error logs, it says:
(104)Connection reset by peer: [client 127.0.0.1:33268] mod_fcgid: error reading data from FastCGI server
[client 127.0.0.1:33268] End of script output before headers: index.php
I am assuming that this relates to PHP in some fashion, as that’s what these errors indicate, but I’m not sure quite what exactly’s wrong here. Googling the problem suggests this might have something to do with suexec and file permissions, perhaps.
Can anyone please assist me with this?
Addendum: I tried changing all the file permissions to 0750 (as that appears to be the default value in the server settings page, so I thought that’d be the one to try first).
Now it’s saying “access denied” and the error log is “mod_fcgid: stderr: PHP Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0”.
So it does appear to be a file permissions thing, albeit that 0750 clearly isn’t right. With suexec, isn’t the PHP being run with the virtual server owner’s user account, so why isn’t the “7” in 750 good enough, as surely that grants the owner full permissions?
Revert all changes with file permissions (seriously do it!) and then check if the owner/group of each file/folder match the Virtual server owner. I suspect you uploaded the files as root and now owner/group is set to root/root instead of VS_owner/VS_owner.
Yeah you may want to ensure that all your files/folders are owned as the Virtual Server owner. One way to reset the permissions is by going into Limits and Validation -> Validate Virtual Servers -> Fix Permissions.
Once the permissions are correct, if you still aren’t seeing anything helpful in the Apache logs – try going into Server Configuration -> Website Options, and change the PHP Execution Mode to “CGI”. It tends to produce better errors than FCGID, and may offer more helpful messages in your error log.
Ah, yes. Should have thought of that. Uploaded as my admin user rather than “root:root” but essentially the same problem.
Wordpress is now up and running.
Thanks a bunch.
It was the file permissions. Copied and extracted the files as the admin user so, of course, they were owned by the admin, not the virtual server owner. D’oh!
But thanks for the pointer to the “Fix Permissions”. I just fixed it manually via the shell, but if there’s actually a button in Virtualmin that I can press that sorts it out for me, I’ll rather be using that, as that sounds far simpler.
Thanks for the tips.
same frustrating problem here - but oddly enough, restarting apache fixed it for me. very strange!