-1

I am trying to setup WordPress on CentOs6 for the first time and facing issue with proper file permission. I am using Linode VPS hosting and have chosen centOS6 as my OS.I am able to install WordPress at following location

/var/www/html/wordpress

As per WordPress doc Wordpress folder should have 755 permission.I have cross checked using WinSCP, and folder permission has been set as 755

But still while I am trying to update / create something new inside my WordPress installation, I am getting an error indicating that it is not able to create directory.

I have noticed one more issue, there is an .htaccess file inside wordpress folder and its permission are also 755, but still Wordpress says

If your .htaccess file were writable, we could do this automatically, but it isn’t so these are the mod_rewrite rules you should have in your .htaccess file.

It seems that there is something wrong with file permission but being new to Linux and its file permissions, I am not sure what is wrong and how it can be fixed

can any one suggest me where I am doing wrong

Umesh Awasthi
  • 81
  • 1
  • 8

1 Answers1

2

The main problem here is you lack of understanding of the UNIX permissions model and the tools you are using. You should spend some time learning how UNIX file permissions work and and how to manipulate them with chown(1) and chmod(1).

I suspect that some (or all) of the files in /var/www/html... are owned by root and have their group set to root.

The httpd process will be running as user apache. Out of the box the Apache user will not have access to files owned by root:root except through the other triad. You could make the files other writeable but that's generally not a good idea if it can be avoided.

A better solution is to change the ownership of the files and directories so that they are owned by apache and group apache. You can then make the files owner or group writeable.

user9517
  • 115,471
  • 20
  • 215
  • 297
  • @lain: I am fully agree about your point about knowledge regarding unix model.I was doing all work in Window and this is first time I am dealing with Linux and its permission model. – Umesh Awasthi Dec 08 '13 at 17:15