Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 590
  • Last Modified:

How to set the same permision of Apache with file/folder of Proftpd?

I use proftpd to get upload-file of user. Each user have a folder to upload.
I want to do a web module (Apache), with it, user can delete, move files/folders uploaded by Proftpd
But Apache have not permision to manipulate with file/folder uploaded by proftpd.

How can I resolve this problem
Thank you very much!
0
bxglxbxglx2000
Asked:
bxglxbxglx2000
  • 4
  • 3
1 Solution
 
svgmucCommented:
I assume your web server runs as apache:web.

If you upload in the $HOME of the user:

<Directory ~>
    UserOwner apache
    GroupOwner web
</Directory>

If you have a separate structure of upload direcories like /var/www/username/upload:

<Directory /var/www/*/upload>
    UserOwner apache
    GroupOwner web
</Directory>
0
 
bxglxbxglx2000Author Commented:
Thank you
I try as your guide, but not success!
Is there anymore setting with Umask?

I found some information here:
http://forums.proftpd.org/smf/index.php?topic=3311.0

But I don't how know to apply...

0
 
svgmucCommented:
Well, it will only work for new files and you have to give apache:web the correct permissions to the users' upload directories (rwx) and at least passthrough permissions (x) for every parent directory.

Does the apache error_log show anything?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
bxglxbxglx2000Author Commented:
Yes, but how to set  Umask?

and My apache log announce: permissiion deny!
It can not write to Directory created (both old or new) by proftpd


0
 
svgmucCommented:
The Umask won't help you there, you have to permit access to the directories for the web server.

chgrp web /var/www/username/upload
chmod g+rwx /var/www/username/upload
0
 
bxglxbxglx2000Author Commented:
I don't understand user/group much
- When I list file upload by proftpd, I see Owner = 5500
but 5500 not found in /etc/passwd or /etc/group

So, how can I continue?

( I want apache and proftpd both have the same permision on File/Folder of each other)
0
 
bxglxbxglx2000Author Commented:
oh, I've resolved my problem!

My way:

groupadd -g 5500 ftpgroup
adduser -u 5500 -s /bin/false -d /bin/null -c "proftpd_user" -g apache ftpuser

- In config file of proftpd:
If we want apache can manipulate on subfolder created by ftp, so we need set umask = 002, ==> subfolder created by ftp will has 775 of permission

and don't forget home dir:
CreateHome on 775 dirmode 775

0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now