Question

VSFTPD cant do operations on /var/www/mysite.com

Posted December 7, 2019 268 views
Linux BasicsLAMP Stack

i’m really bad at linux however have been able to setup a webhost, ssl and mysql, phpmyadmin on my ubuntu 18.04 digitalocean server, I also setup a vsftpd server however it’s not working as I expected it to work because permissions are not working. Whenever I do anything in /var/www/mydomain.net (my local root), it gives me an operation failed error. It worked before I changed the local_root to /var/www/mydomain.net (before that it was
/home/$USER/ftp)

edited by bobbyiliev

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

Maybe just try creating a new user and set Apache to run as the user:

sudo adduser your-new-user

To set your Apache service to run as the new user. To do that edit /etc/apache2/envvars and change APACHE_RUN_USER and APACHE_RUN_GROUP from www-data to your user. Set the ownership of the /var/www/html to be owned by the new user:

sudo chown -R your-new-user:your-new-user /var/www/html

Then just restart Apache.

After that use that user to connect to your server and it would have access to that directory. Here’s a nice article by DigitalOcean that you could take a look on how to get started with VSFTPD:

https://www.digitalocean.com/community/tutorials/how-to-set-up-vsftpd-for-a-user-s-directory-on-ubuntu-16-04

by Melissa Anderson
FTP, short for File Transfer Protocol, is a network protocol that was once widely used for moving files between a client and server. It has since been replaced by faster, more secure, and more convenient ways of delivering files. Many casual Internet users expect to download...
Submit an Answer