DDT Posted July 6, 2009 Share Posted July 6, 2009 We added suPHP to my server ast night and the techs had to tweak some sites and owners here and there to get everything working but I maintained an open connection to WHMCS the whole time because I was providing the information on passwords & such so I never noticed we were killing WHMCS. After they were through I logged out. Went to log back in and OOPS--- Now I get an Error message anytime WHMCS attempts to go from unsecured to secure including logging into admin panels. So we cannot answer tickets or basically do anything. Does anyone have any exoerience with cuPHP and/or where there might be "owners" in WHMCS that are "nobody" and need to be changed to the account? Any help GREATLY appreciated (to the point I would PayPal you a few $$ if you have an idea how to solve this) Because I am in USA WHMCS support only works during our night and so they are not responding. Error msg below: Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, webmaster@n.com and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. 0 Quote Link to comment Share on other sites More sharing options...
TheSidewinder Posted July 6, 2009 Share Posted July 6, 2009 (edited) You might try this. (You'll need root access to do it: it's needed to change ownership for "nobody") Open an SSH session as root, change directory to the WHMCS install (IMPORTANT!), then input: chown -R user:user * (repeat with *.* and .*) where "user" is the account-holder's name. Check that the install directory is owned by the account-user, too. That may not solve all the problems. Also check to see (again in the install directory) that it and all the sub-directories are set to 755, and all the files down the tree are set to 644. You can set files more strictly than 644 (i.e. 444 for config files) but not less strict. I had to do this in a number of accounts after I activated suPHP, and for things other than WHMCS as well. (e.g. Forum software) EDIT: Thought of something else. I've you've moved your attachments, downloads, and templates directories out of the default WHMCS install directory, check and fix those too, as above. Edited July 6, 2009 by TheSidewinder 0 Quote Link to comment Share on other sites More sharing options...
ckh Posted July 6, 2009 Share Posted July 6, 2009 Log into your cpanel and see what the actual error is. The internal server error that is displayed is generic, but, the cpanel error log will give you more info. It may have to do with permissions. If you had directories/folders chmod'd to 777 you will probably have to change them to 755, but, the error log will let you know for sure and what files are causing the problems. 0 Quote Link to comment Share on other sites More sharing options...
uberhost Posted July 8, 2009 Share Posted July 8, 2009 Another cause for 500 errors after switching to suPHP is found in .htaccess files. suPHP does not allow php flags, but instead you must create a php.ini for the user account and just put in the lines that you need. Check your .htaccess files for any lines beginning with "php" and comment those out. This should solve the 500 Internal Server Errors. 0 Quote Link to comment Share on other sites More sharing options...
brianoz Posted July 9, 2009 Share Posted July 9, 2009 That message indicates a problem with suPHP, which can be one (or more) of the following: a directory is writable to group or other - fix: chmod go-w -R public_html, ie should be mode 755 or 750 a .php file is writable to group or other, fix chmod go-w -R public_html, ie should be mode 644 or 640 a php_xxx directive in .htaccess as mentioned In addition, public_html must be group nobody and permission 750. If you're really stuck, a sysadmin can look in the suphp error log which will give details for the failure. If you run the following commands from your home directory you should be able to fix it in one hit: chmod -R go-w public_html chown -R myuser:myuser public_html chgrp nobody public_html chmod 750 public_html find . -name .htaccess | xargs grep -l php_ /dev/null | xargs replace php_ '#php_' -- (The last one will comment out any .htaccess php_ directives, but you'll have to create php.ini files instead) 0 Quote Link to comment Share on other sites More sharing options...
Daniel Posted July 9, 2009 Share Posted July 9, 2009 cd /path/to/whmcs find -type f -exec chmod 644 {} \; find -type d -exec chmod 755 {} \; chown -R username:username * find -type f -name .htaccess -exec replace 'php_' '#php_' -- {} \; Should get you sorted 0 Quote Link to comment Share on other sites More sharing options...
hightekhosting Posted July 10, 2009 Share Posted July 10, 2009 Is this a cPanel server? If so, login to your server via SSH and perform the following commands in order: /scripts/postsuexecinstall /scripts/chownpublichtmls cd /home find -perm 777 -exec chmod 755 {} \; -print find -perm 666 -exec chmod 644 {} \; -print /scripts/fixsuexeccgiscripts This will change all directory ownerships to their corresponding owers/accounts as well as configure all necessary permissions for each site We run this on every server we ever implement suPHP into and its our saving grace! Try it! Regards, Dale 0 Quote Link to comment Share on other sites More sharing options...
brianoz Posted July 10, 2009 Share Posted July 10, 2009 We run this on every server we ever implement suPHP into and its our saving grace! Except it's: find /home -perm 777 ... or better still: find /home -perm -2 ... In other words, the find command needs a directory argument. Other than that the advice is absolutely spot-on! 0 Quote Link to comment Share on other sites More sharing options...
LeMarque Posted August 8, 2009 Share Posted August 8, 2009 Oldish thread, I know; but Thanks to both Hightek and brianoz! Fixed my suPhp problem. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.