0

I have create a small LAMP server with Apache 2.4 and PureFTP but i have configured the folder of user /home/user1/ with chmod permission username:username for pureftp in this case via filezille i can edit and upload file but apache can't read or write file, if config apache:apache or root:root all work but via fizilla i can't upload or edit file.

I'm not that good with permission and this is my first LAMP installation =)

File permission for folder 755 and 644 for files, user and group for /home is root for /home/username is the respective user.

Run apache with nobody user and nobody group

etc/passwd for nobody: nobody:x:99:99:Nobody:/:/sbin/nologin etc/group for nobody: nobody:x:99:

Please can you help me?

I use Centos 7 x64.

Thanks.

2
  • 1
    Why don't you make a default folder like /var/www/html as document root of your apache server and make the same folder as home folder for your ftp user. That would solve your problem. Don't change permissions or ownership of users home folder. You'd end up loosing ssh acces of your server. Sep 22, 2017 at 10:36
  • Because i have configured the /home with 100GB of space for multiple users Sep 22, 2017 at 10:38

1 Answer 1

0

In unix not only "destination permissions" matter, also the permissons along the whole path to reach the destination.

So make sure directories have at least "search" permissions "x" An make sure files have at least read "r", so user nobody can read them.

"namei" is a good tool to check those:

Try:

namei -mol /path/to/directory/file 

if your system version does not recognize -mol, you may use "-mx" as alternative which seems compatible with older versions of namei.

2
  • dr-xr-xr-x root root / drwxr-xr-x root root home drwxr-xr-x username username username Sep 26, 2017 at 22:10
  • @user3477026 what about the upload directory, I see access but I don't see write for the upload directory. In apache check the appropiate <Directory entry specifies the filesystem path giving permissions too. For further detail, show what you request and the answer you get as well as the server error log. Sep 27, 2017 at 11:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .