Jump to content

Problems with SuPHP


DDT

Recommended Posts

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.

Link to comment
Share on other sites

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 by TheSidewinder
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

  • 5 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated