Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm having a great time using one of my Linux dedicated servers, but I've run into a backbreaker of a problem.
The website on this server uses Wordpress, but for some reason Wordpress can't write to any files or directorys on the server. All folder permissions are 755. Using 777 works, but leaves me open to obvious security risks.
I thought that maybe it was to do with ownership or similar, so I've used SSH and CHOWN to make sure the domain is set to the correct permissions, which they are.
All I can think of is that the problem is something to do with permissions. 777 works but 755 doesn't. This indicates that the site isn't recognising itself as the owner?
I've had such a great experience with Linux thusfar, but this problem is so odd that it's tainting an otherwise flawless record.
I hope someone can offer any advice, no matter how small. Anything to help me with this problem would be hugely appreciated. Thanks in advance.
use "ls -l \path\to\dir" to check who owns the files in question.
Make sure the owner is the same one running wordpress.
Use chown to change the owner of the file. use chgrp to change the group so that both are running on the same user/owner.
Be mindful of the implications of changing owner/groups before you start chowning away.
Michael
Quote:
Originally Posted by louse101
Hi,
I'm having a great time using one of my Linux dedicated servers, but I've run into a backbreaker of a problem.
The website on this server uses Wordpress, but for some reason Wordpress can't write to any files or directorys on the server. All folder permissions are 755. Using 777 works, but leaves me open to obvious security risks.
I thought that maybe it was to do with ownership or similar, so I've used SSH and CHOWN to make sure the domain is set to the correct permissions, which they are.
All I can think of is that the problem is something to do with permissions. 777 works but 755 doesn't. This indicates that the site isn't recognising itself as the owner?
I've had such a great experience with Linux thusfar, but this problem is so odd that it's tainting an otherwise flawless record.
I hope someone can offer any advice, no matter how small. Anything to help me with this problem would be hugely appreciated. Thanks in advance.
Thank you Michael. I ran the command but as expected, the owner and group are identical throughout the domain's directories. Only in the ROOT of the server are the owners and groups different (set to root).
Any suggestions? This is the first time I've ever run into a problem like this.
In some cases, when I encounter issues where directories need to be writeable but fail cause they are owned by the user who install or resides in the users home directory, changing from 755 to 777 is bad in some cases, in other situations, you can sometimes get away with changing the permissions to 775 and have the group ownership set to whatever apache runs as, which would be the user attempting to access the files that are not writeable on a group level.
Say for instance, I have a directory that is 755 that is owned by me and set to my own group. The application running needs write access to this directory but thru the web interface it's running as nobody for apache. I would need to set the group ownership as nobody and change it to 775 in order to allow nobody to have write access to this directory. In this case, nobody usually is an account that you can't login with, so it's more secure than allowing with a permission of 777.
If you're still concerned with changing the permissions, you should submit your concerns to Wordpress to see if they can't create a workaround with their software. Perhaps in such cases, these directories that need full access should be treated like /tmp directories, where usually anyone has full access.
So full access doesn't work either? Like the Wordpress docs say, in some cases chmod 777 is necessary to get it working.
Perhaps if you shared the directory it needs to write to, the permissions of that directory and the user that apache runs under, we could be of more help.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.