The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

mod_rewrite broken by enabling suexec

Discussion in 'General Discussion' started by Lanh, Oct 9, 2009.

  1. Lanh

    Lanh Registered

    Joined:
    Mar 23, 2009
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    I have recently enabled suexec, (PHP5 running under suPHP), on my server and after chowning the files correctly I have found that any site which relies on rewrite rules in the htaccess file is effectively broken.

    Luckily this only affects my personal sites, unluckily, it affects every single one of them.

    I have been googling for about 14 hours to find out how to re-enable the rewrite rules so that all my internal links work once again but have been completely unable to find any information beyond people talking about custom php.ini files.

    At this point I get completely lost due to the sheer lack of any documentation, (in plain english), about how to write a custom php.ini file to re-enable mod_rewrite functionality to my personal accounts.

    Could someone please, either tell me what to do, or point me in the direction of instructions, written full and in plain english, about how to do this please?
     
  2. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    SuPHP and SuExec has ABSOLUTELY NO EFFECT on Mod_ReWrite commands whatsoever so your rewrites should be perfectly fine!

    However, if you use "php_flag" or "php_admin" commands in your .htaccess file, that is an entirely different matter and will cause your site to fail with and error 500 condition.

    Likewise, if you have any scripts with permission 777 or located in a folder with permission 777, you will again get an error 500 condition because unsafe permission 777 is not permitted. The good news is that it is no longer required either for any of your scripts! PHP scripts could be set as tight as 400 and still work with the typical setting being 600 or 640 as the normal standard permission settings under SuPHP.

    The third problem issue is if you have any pre-existing accounts before the conversion that had the ownership set to user "nobody". The ownership of these files would need to be reset to the actual real owner.

    I have a script that automatically fixes all these issues and have published the link and setup instructions on this forum community already. Search my previous posts for more details.

    EDIT: Nevermind the search, here you go:
    Code:
    # wget [url="http://forums.cpanel.net"]http://www.myserverexpert.com/build/dso2su.sh[/url]
    # chmod 700 ./dso2su.sh
    # ./dso2su.sh
    
     
    #2 Spiral, Oct 9, 2009
    Last edited: Oct 9, 2009
  3. Lanh

    Lanh Registered

    Joined:
    Mar 23, 2009
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Hi Spiral,

    Thanks for that mate, I appreciate it. Everything I was reading up about it was saying that it deactivated mod_rewrite and talked about custom php.ini, so I'd been looking for information about that and that only.

    Your post made me look at something else, and I was able to fix the problem that I was facing.

    You have no idea how much I appreciate that.

    Thank you.
     
Loading...

Share This Page