Before I install vsftpd, I want to make sure I and a co-worker can access /var/www/html. Currently the directories are owned by apache:apache with 774 permissions. My intent would be to add ftp to the apache group.
Both users are members of the apache group.
Will this work? Do I need to make changes?
Thank you for your advice...
Todd
How to configure vsftpd for access to /var/www/html
-
- Posts: 2019
- Joined: 2015/02/17 15:14:33
- Location: Bulgaria
- Contact:
Re: How to configure vsftpd for access to /var/www/html
Most probably you nees to tell SELinux that both httpd and ftp will access same folders.
So, first - change the default domain as follows (public_content_rw_t for rw access and public_content_t for ro):
If you need apache to have write access (rw_t), then you should enable the following:
And possibly this one:
Also if you want to allow the vsftpd to write there also:
To see if selinux is still preventing something use(setroubleshoot-server package is needed):
So, first - change the default domain as follows (public_content_rw_t for rw access and public_content_t for ro):
Code: Select all
semanage fcontext -a -t public_content_t "/var/www/html/document_root(/.*)?"
&& restorecon -RFvv /var/www/html/
Code: Select all
setsebool -P allow_httpd_anon_write
Code: Select all
setsebool -P allow_httpd_sys_script_anon_write
Code: Select all
setsebool -P allow_ftpd_anon_write
Code: Select all
sealert -a /var/log/audit/audit.log