I have setup apache according to this article https://help.ubuntu.com/community/ApacheMySQLPHP and I have created a new site config in /etc/apache2/sites-available/mysite
and changed the document root and directory to :
DocumentRoot /home/gapton/public_html
<Dictory />
..
..
</Directory>
<Directory /home/gapton/public_html/>
...
...
...
...
</Directory>
and I sudo a2dissite default && sudo a2ensite mysite
to disable and enable them, restarted apache2 and things are working.
I then setup vsftpd and config the vsftpd.conf
file to :
local_enable=YES
write_enable=YES
connect via Notepad++ with the user 'gapton' and I created a file called test.php
under home/gapton/public_html
. It would not be readable by Apache it seems. I did sudo chmod -R 755 ~/public_html
and it would load alright.
However any subsequent files created via vsftpd will not be readable.
Since I have logged in to the only account gapton
when connecting via FTP, then any newly created file should be owned by gapton
right? What happens when apache tries to access a file/folder location, what credentials does it access it by?
How do I config it so that all files created by gapton
can be read by apache? (Also, is it at all advisable?)
Thanks.
I found the problem.
In older version of vsftpd, the umask they apply when writing file was by default 022.
In the current version, such default value has been changed to 077. This mask read 4
write 2
and execute 1
for everyone except the owner.
Changing the umask value in the vsftpd.conf
file back to 022 has solved my problem. Hope this help future users of vsftpd facing the same issue.