Knowledgebase

chown -R nobody:nobody and wordpress

Posted by y0us3f, 05-26-2011, 06:59 AM
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

Posted by care4server, 05-26-2011, 09:24 AM
if you had set phpo handler as dso or cgi change it to suphp

Posted by y0us3f, 05-26-2011, 10:29 AM
thanks for you reply how can I change to suphp in DA ?

Posted by jon-f, 05-26-2011, 10:36 AM
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

Posted by y0us3f, 05-26-2011, 10:54 AM
got it http://help.directadmin.com/item.php?id=197 do i need to do something after i change to suphp ?

Posted by y0us3f, 05-26-2011, 10:59 AM
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))

Posted by jon-f, 05-26-2011, 11:11 AM
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?

Posted by y0us3f, 05-26-2011, 11:49 AM
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

Posted by y0us3f, 05-26-2011, 11:51 AM
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 ?

Posted by jon-f, 05-26-2011, 12:06 PM
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

Posted by y0us3f, 05-26-2011, 12:28 PM
It started now , but I see Internal Server Error when I open my site ...

Posted by jon-f, 05-26-2011, 12:29 PM
make sure the php_flags are out of your .htaccess

Posted by y0us3f, 05-26-2011, 12:44 PM
Hey jon , there is no php_flags in .htaccess and all scripts on my site aren't working

Posted by y0us3f, 05-26-2011, 12:46 PM
is there anyway to go back for now ?

Posted by jon-f, 05-26-2011, 12:55 PM
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

Posted by y0us3f, 05-26-2011, 12:59 PM
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

Posted by durbz, 05-26-2011, 01:06 PM
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.

Posted by y0us3f, 05-26-2011, 01:06 PM
How to tail -f /var/log/httpd/error_log ? -bash: -f: command not found

Posted by jon-f, 05-26-2011, 01:11 PM
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

Posted by y0us3f, 05-26-2011, 01:12 PM

Posted by y0us3f, 05-26-2011, 01:31 PM
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 ?

Posted by jon-f, 05-26-2011, 01:45 PM
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.

Posted by y0us3f, 05-26-2011, 08:56 PM
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

Posted by jon-f, 05-26-2011, 09:03 PM
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.

Posted by jon-f, 05-26-2011, 09:20 PM
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

Posted by y0us3f, 05-26-2011, 09:38 PM
changed 777 to 755 chown to the user still same problem ....

Posted by y0us3f, 05-26-2011, 09:42 PM
That's all i get

Posted by y0us3f, 05-26-2011, 09:51 PM
oh ok i just saw ur post ... sorry will do now

Posted by y0us3f, 05-26-2011, 09:57 PM
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 ?

Posted by jon-f, 05-26-2011, 10:04 PM
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.

Posted by y0us3f, 05-26-2011, 10:41 PM
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 ?

Posted by jon-f, 05-26-2011, 11:54 PM
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.

Posted by y0us3f, 05-27-2011, 05:59 PM
Thanks for everything , I learn new things everyday

Posted by y0us3f, 05-29-2011, 09:43 AM
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

Posted by jon-f, 05-29-2011, 10:56 AM
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

Posted by y0us3f, 05-29-2011, 11:04 AM
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

Posted by y0us3f, 05-30-2011, 07:44 AM
Still getting the high load average mails , i get Error establishing a database connection sometimes , just rebooted the server

Posted by y0us3f, 05-30-2011, 07:54 AM
Just rebooted worked for like 5 mins , and now Error establishing a database connection again !

Posted by jon-f, 05-31-2011, 03:20 PM
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

Posted by y0us3f, 05-31-2011, 04:16 PM
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 ?

Posted by jon-f, 05-31-2011, 05:14 PM
make sure the ct_alert and other email alert options for csf are disabled, mainly ct_alert will be the culprit if you are getting ddos

Posted by y0us3f, 06-03-2011, 04:50 AM
Hey , I have a problem now .. I think mysqld and httpd services grow bigger everyday until i get a problem site cant make connections to the database , I checked the service monitor I see mysqld (pid 948 1038 1050 1198 1209 1216 1248 5188 5189 5190 5191 5192 5193 5195 5196 5197 5198 18079 18088 18092 18114 18132 18134 18137 18139 18141 18153 18162 18176 18179 18195 18199 18212 18216 18230 18231 18236 18247 19128 19298 19380 19628 19723 19725 19864 20136 21379 21382 21438 21439 21447 21513 21541 21544 21545 21552 21576 21582 21660 21727 21732 21743 21782 21784 21843 21845 21847 21849 21851 21853 21860 21862 21866 21867 21920 21929 21976 22018 22034 22051 22060 22063 22127 22213 22215 22240 22303 22948 22983 24126 24840 24844 24846 26087 26128 26295 26460 26472 26540 26577 27231 27982 30773 32309 32317 32319 32356 32507 32676 ) When the numbers grow , it stops working. I had to (Stop) the service and (start) it again now its only mysqld (pid 1453 1454 1455 1456 1457 1458 1460 1461 1462 1463 ) and its working..



Was this answer helpful?

Add to Favourites Add to Favourites

Print this Article Print this Article

Also Read
Data lost (Views: 624)


Language:

Client Login

Email

Password

Remember Me

Search