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.

owner permissions suexec set up?

Discussion in 'General Discussion' started by Frano8, Dec 6, 2008.

  1. Frano8

    Frano8 Member

    Joined:
    Nov 30, 2008
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    Hello,

    new to cpanel and whm so hi to the community!

    Got whm and cpanel installed ok last week and migrating sites across as we speak.

    All pretty much ok with the end tweaks here and there.

    My biggest issue at the moment is ownership/permissions issue, specifically for joomla sites. I have reserached this and pinned it down to using suexec.

    However I have this enabled and despite my permissions being set correctly i still have write issues?

    Is there another step I have missed to the setup and what advice can anyone give me to allow scripts to run as the owner instead of nobody.

    I hope their is a solution that will update server wide as I have fair few sites all running similar php scripts.

    Thanks

    Frano
     
  2. stdout

    stdout Well-Known Member

    Joined:
    Apr 10, 2003
    Messages:
    189
    Likes Received:
    5
    Trophy Points:
    18
    Location:
    Nelspruit, Mpumalanga, South Africa
    cPanel Access Level:
    Root Administrator
    Frano,
    * Generate a script which will correct ownerships and permissions under /home/*/public_html

    Code:
    grep '/home' /etc/passwd | cut -d: -f1 | awk {'print "chown -R /home/"$1"/public_html; chown :nobody /home/"$1"/public_html; chmod -R 755 /home/"$1"/public_html"'} > ~/fix_ownerships.sh
    * Run the generated script: "sh ~/fix_ownerships.sh".

    If after running the script you're still seeing 500/Internal Server Errors, the issue most likely related "php_flag" or "php_value" entries in the account's .htaccess file. Simply rename the .htaccess or comment out the lines.
     
  3. Frano8

    Frano8 Member

    Joined:
    Nov 30, 2008
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    Thanks stdout,

    this is a bit beyond my understanding but i'll give it a go.

    I dont have any internal server errors though? its just my permissions are set correctly but the scripts dont run due to ownership issues (I believe).

    Is this still the solution to my problem?

    Thanks
     
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,447
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Recompile apache with SuPHP. That's really what you're seeking long term.
     
  5. stdout

    stdout Well-Known Member

    Joined:
    Apr 10, 2003
    Messages:
    189
    Likes Received:
    5
    Trophy Points:
    18
    Location:
    Nelspruit, Mpumalanga, South Africa
    cPanel Access Level:
    Root Administrator
    My mentioned command/script will correct permissions and ownerships under /home/*/public_html.
    This is what you ultimately need to do with suPHP.
     
  6. Frano8

    Frano8 Member

    Joined:
    Nov 30, 2008
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    Thanks people,

    But according to my whm suphp is running?

    I even tried recompling apache as indicated?

    It looks like suphp is running. Is there anything else I need to do for it to kick in? Reboot maybe?

    Thanks
     
  7. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,447
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Easy way to test if things work for you, (since you mentioned Joomla) upload a theme, or some other com or mod for it. When you use the built in tools in Joomla to do this it creates directories and moves files to them.

    If you're not running SuPHP the directories won't be made and no files would be moved properly. Anything it does do, will have owner of nobody.

    And yes, once you've got SuPHP going, it's important that directories are all set permissions wise to 755 and files 644. No matter what any scripts install instructions tell you.
     
  8. Frano8

    Frano8 Member

    Joined:
    Nov 30, 2008
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    Which was the reason for my first post.

    Joomla is installed and working fine for the most part, and the permissions are set correctly but highlighted as unwriteable in the admin section.

    As far as I can tell this seems like a classic ownership issue and all I have to do is ensure suphp is running correctly.

    despite indications in WHM that it is, I ahve a feeling I have missed something or need to take some other steps first.

    I am going to have another look from fresh now and will post if I fix, however, I am still open to suggestions?

    Thanks for taking the time to respond everyone.

    Frano
     
  9. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,447
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Have you looked at your files via your FTP client to check owner and permissions? If owner is set wrong, you'll need to change them to the user who owns them of course.
    You could try the script mentioned above, or if you're familiar with shell you could fix them for this one account manually with this command:

    chown -R usernamehere:usernamehere /home/usernamehere/public_html/joomladirectory

    If you're not familiar with shell you might hire someone to fix this for you, or contact your host.


    Once you've got SuPHP setup and file owner and perms right, you should be good to go.

    Lots of threads on moving to SuPHP on these forums with lots of details you might want to know more about.
     
  10. Frano8

    Frano8 Member

    Joined:
    Nov 30, 2008
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    I ran the script above and all went OK.

    except I cant access the site now from the temp url:

    http:myserver/~username/

    or the main url?

    I could access this before?

    Is this conected? Or is there a setting in WHm that also needs changing?

    Francis
     
  11. rhenderson

    rhenderson Well-Known Member

    Joined:
    Apr 21, 2005
    Messages:
    785
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Oklahoma
    cPanel Access Level:
    Root Administrator
    Yes WHM >> Main >> Security >> Security Center >> Tweakmod_userdir Security

    As for SuPHP is it set to run in WHM >> Main >> Service Configuration >> Apache Configuration >> Configure Suexec and PHP under Php5 Handler?
     
  12. Frano8

    Frano8 Member

    Joined:
    Nov 30, 2008
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    I have the userdir mod tweak unselected, is this correct?

    I have tried to access the URL with it set to on and off but still no luck with either setting.

    My settiungs for PHP are:

    Default PHP Version (.php files) 5
    PHP 5 Handler dso
    PHP 4 Handler none

    Apache suEXEC on

    Again is this right?

    Francis
     
  13. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,447
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Check that page again and click the drop down list beside PHP 5 Handler, that says DSO. You'll find SuPHP listed there as well. ;)
     
  14. Frano8

    Frano8 Member

    Joined:
    Nov 30, 2008
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    I tried the drop down list next to PHP 5 and the options I have are:

    DSO
    CGI
    None

    Is suphp something I need to install elsewhere?

    Thanks

    Frano
     
  15. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,447
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    During the setup for upgrading Apache, yes.
     
  16. Frano8

    Frano8 Member

    Joined:
    Nov 30, 2008
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    And there is the answer!

    Infopro thanks for the advice and for all future forum users who have the same issue.

    suphp needs installing from an apache update:

    >> Software >> Apache Update

    Step 5

    Thanks again.

    Frano
     
  17. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,447
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    How's that Joomla site working now? :)
     
  18. Frano8

    Frano8 Member

    Joined:
    Nov 30, 2008
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    1
    All good as far as I can tell.

    I have another joomla site that I have jsut transferred and one of the modules is not displaying but I think its a path issue and that the hosting environment is good now.

    Thanks for asking.

    Francis
     
  19. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,447
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Could be that a directory for it is set to 777. change that to 755 as needed.
     
Loading...

Share This Page