Page 1 of 2 12 LastLast
Results 1 to 40 of 42
  1. #1
    Join Date
    Jan 2011
    Location
    Kuwait
    Posts
    85

    Talking chown -R nobody:nobody and wordpress

    Hello guys , I had a problem before with wordpress not allowing me to Auto Upgrade (takes me to FTP Page)

    then i found the solution somewhere

    chown -R nobody:nobody /home/user/public_html

    it worked fine , but now everytime I do it , it doesnt work anymore

    I cant auto-upgrade my wordpress , or edit Themes ..

    sorry but im new in this whole Dedicated Server permissions and SSH

    can anyone help me ?

    thanks

  2. #2
    Join Date
    Sep 2010
    Location
    home
    Posts
    515
    if you had set phpo handler as dso or cgi change it to suphp

  3. #3
    Join Date
    Jan 2011
    Location
    Kuwait
    Posts
    85
    thanks for you reply

    how can I change to suphp in DA ?

  4. #4
    Join Date
    May 2006
    Posts
    1,398
    Quote Originally Posted by y0us3f View Post
    Hello guys , I had a problem before with wordpress not allowing me to Auto Upgrade (takes me to FTP Page)

    then i found the solution somewhere

    chown -R nobody:nobody /home/user/public_html

    it worked fine , but now everytime I do it , it doesnt work anymore

    I cant auto-upgrade my wordpress , or edit Themes ..

    sorry but im new in this whole Dedicated Server permissions and SSH

    can anyone help me ?

    thanks
    well you would have to compile suphp in custombuild, I thought DA came with default suphp now, not sure. Anyway you should have not chowned the entire public html to nobody, should be user:apache.

    Also WP upgrade uses FTP so permissions should be normal as it will get and install files as the user.

    Also if you compiled suphp and did not fix the permissions it will still not work, have to fix those permissions first

  5. #5
    Join Date
    Jan 2011
    Location
    Kuwait
    Posts
    85
    got it http://help.directadmin.com/item.php?id=197

    do i need to do something after i change to suphp ?

  6. #6
    Join Date
    Jan 2011
    Location
    Kuwait
    Posts
    85
    jon-f thanks for your reply bro and the advice

    i will change it to user:apache

    what do u mean "fix those permissions first" ?

    in Wordpress now i cant upgrade automatically .. and I cant edit themes either

    and I found this solution from a post , that i'll have to type chown -R nobody:nobody /home/user/public_html everytime i want to upgrade or edit themes

    and it worked first , and after i finish i type this :
    chown -hR user /home/user/public_html

    ((btw not only the auto upgrade + editing themes on wordpress not working , PHP cant edit or upload files))

  7. #7
    Join Date
    May 2006
    Posts
    1,398
    first off you need to know what the issue is with your php, if it is running as nobody or suphp/cgi. You only need to chmod 777 your content and theme directories to edit in wordpress, not chown it.

    OK, when chowning public_html must be user:apache for the file then chown -R user:user public_html/*
    Fixing your permissions is important first. then if you are running php as nobody chmod the directories your themes are in or anything you need php to edit as 777


    So in a nutshell to make folders and files world writeable 666 for files, 777 for folders.
    if php is running as nobody its another user hence the folders/files need to be world writeable.

    With suphp you do not need world writeable directories.

    Its a good ideal to run a server with suphp/cgi anyway as it keeps the best permissions and security, However if this the only site on this server then running php as nobody and chmodding files and folders to world writeable is not a problem.

    you understand that?

  8. #8
    Join Date
    Jan 2011
    Location
    Kuwait
    Posts
    85
    oh dear i messed up everything

    im getting this now : Invalid command 'php_admin_flag', perhaps misspelled or defined by a module not included in the server configuration

    after suphp

  9. #9
    Join Date
    Jan 2011
    Location
    Kuwait
    Posts
    85
    and the site now cant open , DA showing HTTPD service stopped and i cant start it , how can I make it work again ? change everything back to normal ?

  10. #10
    Join Date
    May 2006
    Posts
    1,398
    NO, thats not a problem. There is no php_flags in suphp. You need to comment that out of .htaccess and find the equivalent to make a php.ini.
    You can tail -f /var/log/httpd/error_log and see why it is not starting

  11. #11
    Join Date
    Jan 2011
    Location
    Kuwait
    Posts
    85
    It started now , but I see Internal Server Error when I open my site ...

  12. #12
    Join Date
    May 2006
    Posts
    1,398
    make sure the php_flags are out of your .htaccess

  13. #13
    Join Date
    Jan 2011
    Location
    Kuwait
    Posts
    85
    Hey jon , there is no php_flags in .htaccess

    and all scripts on my site aren't working

  14. #14
    Join Date
    Jan 2011
    Location
    Kuwait
    Posts
    85
    is there anyway to go back for now ?

  15. #15
    Join Date
    May 2006
    Posts
    1,398
    recompile it. What is wrong now?
    Are you still getting error?
    Go in shell and tail -f /var/log/httpd/error_log
    see what error is, post it here

    you will need to visit the page and cause error while tailing the log to see what the error is

  16. #16
    Join Date
    Jan 2011
    Location
    Kuwait
    Posts
    85
    Yeh , Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request

    on all scripts and pages

    wordpress , uploader , and vbulletin forums

  17. #17
    Join Date
    Dec 2005
    Location
    Swansea, United Kingdom
    Posts
    348
    As Jon suggested, you need to: tail -f /var/log/httpd/error_log

    Whilst visiting your site(s), so we can actually help you. We need to know what's actually causing the internal server errors.

  18. #18
    Join Date
    Jan 2011
    Location
    Kuwait
    Posts
    85
    How to tail -f /var/log/httpd/error_log ?

    -bash: -f: command not found

  19. #19
    Join Date
    May 2006
    Posts
    1,398
    tail -f /var/log/httpd/error_log
    enter that in shell.


    Also, make sure no files or folders are chmod 666 or 777 while in suphp/cgi because it will error on world or group writeable files. We will know more when we see your error log

  20. #20
    Join Date
    Jan 2011
    Location
    Kuwait
    Posts
    85
    Code:
    [Thu May 26 11:27:01 2011] [notice] caught SIGTERM, shutting down
    [Thu May 26 11:27:02 2011] [warn] RSA server certificate CommonName (CN) `localh                               ost' does NOT match server name!?
    [Thu May 26 11:27:02 2011] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin                               /suexec)
    [Thu May 26 11:27:03 2011] [warn] RSA server certificate CommonName (CN) `localh                               ost' does NOT match server name!?
    [Thu May 26 11:27:03 2011] [notice] Apache/2.2.19 (Unix) mod_ssl/2.2.19 OpenSSL/                               0.9.8e-fips-rhel5 DAV/2 configured -- resuming normal operations
    [Thu May 26 12:03:20 2011] [notice] caught SIGTERM, shutting down
    [Thu May 26 12:03:21 2011] [warn] RSA server certificate CommonName (CN) `localh                               ost' does NOT match server name!?
    [Thu May 26 12:03:21 2011] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin                               /suexec)
    [Thu May 26 12:03:22 2011] [warn] RSA server certificate CommonName (CN) `localh                               ost' does NOT match server name!?
    [Thu May 26 12:03:22 2011] [notice] Apache/2.2.19 (Unix) mod_ssl/2.2.19 OpenSSL/                               0.9.8e-fips-rhel5 DAV/2 configured -- resuming normal operations

  21. #21
    Join Date
    Jan 2011
    Location
    Kuwait
    Posts
    85
    yeh and i have some folders with 777 permission and they're alot i think , is there anyway i can get it back to normal instead of suphp ... till i change the permissions and try again ?

  22. #22
    Join Date
    May 2006
    Posts
    1,398
    you need to visit the page and cause the error while tailing the log. Did you make sure to take out php_flags ffrom htaccess?
    Your public_html folder should be owned by user(your username):apache and everything inside, NOT the folder itself should be owned by user:user

    folders should be chmod 755, files 644.

    I am trying to help you but please have some initiative here, no one can walk you through everything step by step.

  23. #23
    Join Date
    Jan 2011
    Location
    Kuwait
    Posts
    85
    thanks bro i appreciate your help

    i did chown -hR user:apache /home/user/public_html

    and when I did the tail , yes i visited the page that was showing the error , actually all scripts showing the error

    don't know what next to do

  24. #24
    Join Date
    May 2006
    Posts
    1,398
    Quote Originally Posted by y0us3f View Post
    thanks bro i appreciate your help

    i did chown -hR user:apache /home/user/public_html

    and when I did the tail , yes i visited the page that was showing the error , actually all scripts showing the error

    don't know what next to do
    No, you are not listening, You do NOT recursively chown public_html

    you chown user:apache public_html

    cd inside public_html and chown -R user:user *

    Example
    chown user:apache public_html
    cd public_html
    chown -R user:user *


    Then
    tail -f /var/log/httpd/error_log

    Visit the site while you have this command open, see the error log for the server error, paste the error here or follow what the problem is then fix.

    Also again, did you check .htaccess? Post your htaccess code as well

    UPDATE seen you seen the error log while visiting the site. paste that error here
    Last edited by jon-f; 05-26-2011 at 09:08 PM.

  25. #25
    Join Date
    May 2006
    Posts
    1,398
    Sorry for double post WHT Ops. If all sites are posting that error it may be a handler issue. Either way need to see the errors in error_log to determine that

  26. #26
    Join Date
    Jan 2011
    Location
    Kuwait
    Posts
    85
    changed 777 to 755

    chown to the user

    still same problem ....

  27. #27
    Join Date
    Jan 2011
    Location
    Kuwait
    Posts
    85
    Code:
    [[email protected] ~]# tail -f /var/log/httpd/error_log
    [Thu May 26 18:23:15 2011] [error] [client 123.125.71.***] File does not exist: /                                    var/www/html/404.shtml
    [Thu May 26 18:47:30 2011] [error] [client 91.121.81.***] File does not exist: /                                    var/www/html/horde
    [Thu May 26 18:47:30 2011] [error] [client 91.121.81.***] File does not exist: /                                    var/www/html/404.shtml
    [Thu May 26 18:47:30 2011] [error] [client 91.121.81.***] File does not exist: /                                    var/www/html/horde
    [Thu May 26 18:47:30 2011] [error] [client 91.121.81.***] File does not exist: /                                    var/www/html/404.shtml
    [Thu May 26 19:56:35 2011] [notice] caught SIGTERM, shutting down
    [Thu May 26 19:59:09 2011] [warn] RSA server certificate CommonName (CN) `localh                                    ost' does NOT match server name!?
    [Thu May 26 19:59:09 2011] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin                                    /suexec)
    [Thu May 26 19:59:10 2011] [warn] RSA server certificate CommonName (CN) `localh                                    ost' does NOT match server name!?
    [Thu May 26 19:59:10 2011] [notice] Apache/2.2.19 (Unix) mod_ssl/2.2.19 OpenSSL/                                    0.9.8e-fips-rhel5 DAV/2 configured -- resuming normal operations
    
    [[email protected] ~]#
    [[email protected] ~]# tail -f /var/log/httpd/error_log
    [Thu May 26 18:23:15 2011] [error] [client 123.125.71.***] File does not exist: /var/www/html/404.shtml
    [Thu May 26 18:47:30 2011] [error] [client 91.121.81.***] File does not exist: /var/www/html/horde
    [Thu May 26 18:47:30 2011] [error] [client 91.121.81.***] File does not exist: /var/www/html/404.shtml
    [Thu May 26 18:47:30 2011] [error] [client 91.121.81.***] File does not exist: /var/www/html/horde
    [Thu May 26 18:47:30 2011] [error] [client 91.121.81.***] File does not exist: /var/www/html/404.shtml
    [Thu May 26 19:56:35 2011] [notice] caught SIGTERM, shutting down
    [Thu May 26 19:59:09 2011] [warn] RSA server certificate CommonName (CN) `localhost' does NOT match server name!?
    [Thu May 26 19:59:09 2011] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
    [Thu May 26 19:59:10 2011] [warn] RSA server certificate CommonName (CN) `localhost' does NOT match server name!?
    [Thu May 26 19:59:10 2011] [notice] Apache/2.2.19 (Unix) mod_ssl/2.2.19 OpenSSL/0.9.8e-fips-rhel5 DAV/2 configured -- resuming normal operations
    That's all i get

  28. #28
    Join Date
    Jan 2011
    Location
    Kuwait
    Posts
    85
    oh ok i just saw ur post ... sorry will do now

  29. #29
    Join Date
    Jan 2011
    Location
    Kuwait
    Posts
    85
    done everything ... still showing the same thing . but the good news .. that the problems is magically gone !

    everything is working now i guess but the admin CP for wordpress is not working ?

  30. #30
    Join Date
    May 2006
    Posts
    1,398
    Quote Originally Posted by y0us3f View Post
    done everything ... still showing the same thing . but the good news .. that the problems is magically gone !

    everything is working now i guess but the admin CP for wordpress is not working ?
    the error log you pasted is not showing any internal server error. What do you mean showing the same thing? Is everything working now? I would assume it is permissions. There also may be an htaccess in your wp-admin directory, check that as well.

  31. #31
    Join Date
    Jan 2011
    Location
    Kuwait
    Posts
    85
    Ok thanks alot bro for your help , everything is now fully working and the auto upgrade too !

    but after all that mess ... did I do anything that affect the server security ?

    and security holes for suphp that needs to be fixed ?


  32. #32
    Join Date
    May 2006
    Posts
    1,398
    here is issue with suphp - it is good for shared hosting environment and not dealing with permissions and such - having to chmod world writeable because of scripts and so on.

    Now, on a dedicated server, no shared hosting, running php as nobody is fine. Anyway do not worry about all this. Suphp with latest php is secure, of course you need overall server wide security though - csf, mod security, maldet and just overall security.

    I have a guide to some security tips on my blog
    http://gid0.net/guides-and-scripts/
    also some other guides and walk thrus there as well.

    Good luck, you have a lot to learn to run a server.

  33. #33
    Join Date
    Jan 2011
    Location
    Kuwait
    Posts
    85
    Thanks for everything , I learn new things everyday

  34. #34
    Join Date
    Jan 2011
    Location
    Kuwait
    Posts
    85
    Hey , after doing this i've noticed that the system is under huge load

    Warning: The system load average is 44.77 <--

    but before , after like 5 days of the httpd service restart i receive

    Warning: The system load average is 14.12

    but 44.77 ? first time

  35. #35
    Join Date
    May 2006
    Posts
    1,398
    suphp and cgi uses more resources the dso, but shouldnt be that much of difference. do top and monitor to see which user it causing the issues. Then tail the domlog in /var/log/httpd/domains/domain.com.log and see whats going on, could be ddos

  36. #36
    Join Date
    Jan 2011
    Location
    Kuwait
    Posts
    85
    I did top , i see

    6781 apache 15 0 10668 3320 1336 S 1.0 0.2 0:00.06 httpd

    many of them working


    6856 (username) 16 0 73960 59m 4460 R 21.9 3.4 0:00.66 php-cgi

    This one too ,

    and this

    6857 mysql 15 0 81520 21m 2228 S 18.6 1.2 0:00.56 mysqld

  37. #37
    Join Date
    Jan 2011
    Location
    Kuwait
    Posts
    85
    Still getting the high load average mails , i get Error establishing a database connection sometimes , just rebooted the server

  38. #38
    Join Date
    Jan 2011
    Location
    Kuwait
    Posts
    85
    Just rebooted worked for like 5 mins , and now

    Error establishing a database connection

    again !

  39. #39
    Join Date
    May 2006
    Posts
    1,398
    maybe under attack, need to see what is going on in access log for the domain, what kind of requests and such. check netstat and everything,

    You need a good firewall like csf, and enable connection tracking, turn off drop logging, etc; Lots of info on the forum for configuring for ddos protection

  40. #40
    Join Date
    Jan 2011
    Location
    Kuwait
    Posts
    85
    Thanks , I don't think im under attack , things are back to normal now

    I have CSF installed and enabled , and i'll take your advice and see what they have in the forum for ddos protection

    things are back to normal now.

    Today SSH was very slow (while logging in only) but its fine now

    and something weird happened : Warning: 1904 emails have been sent yesterday

    how to track sent emails ? and from where ?

Page 1 of 2 12 LastLast

Similar Threads

  1. chown question
    By saj in forum Hosting Security and Technology
    Replies: 3
    Last Post: 08-31-2009, 10:16 AM
  2. Chown and nobody problem
    By Chikita in forum Hosting Security and Technology
    Replies: 6
    Last Post: 03-01-2007, 04:17 AM
  3. Chown
    By andy18 in forum Hosting Security and Technology
    Replies: 3
    Last Post: 10-22-2002, 06:19 PM
  4. chown help
    By carpman in forum Hosting Security and Technology
    Replies: 2
    Last Post: 11-03-2001, 07:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •