Trouble switching from mod_php to mod_suphp..??

Discussion in 'Apache' started by angelleye, Mar 3, 2012.

  1. #1
    I've got a simple LAMP stack setup locally to use for a test server. I've got a few virtual hosts already configured and they were working fine except for some permissions issues I was having because of the mod_php handler.

    To fix this I followed this guide to install SuPHP: http://www.binarytides.com/blog/install-suphp-on-ubuntu-linux/

    Everything went exactly like the guide shows, but now when I try to load a PHP page in any of my current sites I get an Internal Server Error and it won't load.

    On my production server I have WHM/Cpanel and I can actually switch back and forth between the two pretty easily. When I'm on the regular Apache mode I have permissions issues, when I switch to SuPHP (CGI) I don't have the issues. My sites never stop loading, though.

    Here, I can see two separate php.ini config files.

    - /etc/php5/apache2/php.ini (Configuration for mod_php)
    - /etc/php5/cgi/php.ini (Configuration for scripts run via CGI)

    So it seems like maybe my current sites are still looking at the mod_php version instead of my new CGI version..?? I'm not sure if I'm on the right track or not but I can't think of any other reason these wouldn't be working. Unfortunately, without a nice little drop-down like CPanel or Plesk would give me I have no idea how to switch my site to use to the new handler.

    Any information on this would be greatly appreciated. Thanks!
     
    angelleye, Mar 3, 2012 IP
  2. RHS-Chris

    RHS-Chris Well-Known Member

    Messages:
    1,007
    Likes Received:
    35
    Best Answers:
    10
    Trophy Points:
    150
    #2
    Hello there,

    When using SuPHP, incorrect file and folders permissions will cause 500 errors. Files should have a max chmod of 644, and folders should be 755. Any 777 permissions will throw out the 500 error. Here are a couple of commands to help change your permissions:

    
    find /home/*/public_html -type d -perm 0777 -exec chmod 755 {} \;
    find /home/*/public_html -type f -perm 0666 -exec chmod 644 {} \;
    
    Code (markup):
    This is assuming that your web files are stored in /home/username/public_html, if they are not, you will have to adjust the paths accordingly.

    Regards,
    Chris
     
    RHS-Chris, Mar 3, 2012 IP
  3. angelleye

    angelleye Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks for the reply. I had read about that and checked all of those while I've been trying to figure this out. I used your commands to see if that would catch anything I missed and it doesn't seem to be finding anything. Either that or it's doing something and still not fixing it. It's not really giving me any sort of response at all, and unfortunately, I'm still stuck.

    Should my group be something else? Right now my owner is the username of the account I created for the site, and the group is "users". Should the group be something else?
     
    Last edited: Mar 3, 2012
    angelleye, Mar 3, 2012 IP
  4. angelleye

    angelleye Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Turns out I just needed to update the docroot value in /etc/suphp/suphp.conf
     
    angelleye, Mar 4, 2012 IP