Question
Using ProFTP and Wordpress Together in /var/www/
I’ve set up a Wordpress installation. I’d like to be able to SFTP into the wp-content
directory in Wordpress to create a custom theme by saving files directly to the server in the theme directory.
I followed this SFTP using ProFTPd tutorial and modified a few other things in /etc/proftpd/modules.conf
:
- I set
DefaultRoot
to/var/www/
- As I had issues creating files (despite being able to connect and see the structure of
/var/www/
, I also created a directory configuration directive:
<Directory /var/www/>
<Limit STOR CWD MKD RMD DELE XRMD XMKD>
AllowAll
</Limit>
</Directory>
I still had issues creating files or this point and assumed it was a result of some unix permissions issues. I went to the var/www/
directory and entered the following two commands:
sudo chown -R username:username *
sudo chmod -R 0755 *
At this point, the .htaccess
file is still owned by www-data
but everything else is owned by my unix username (not root
). At this point, I could finally SFTP into my server and post files. Terrific!
…Except… When I use Wordpress at this point, I have trouble installing themes or plugins due, I assume, to (yet again) a unix a permissions issue. The error message I get is Unpacking the package… Could not create directory..
I’m no unix expert but it seems like in order to SFTP files into /var/www/
I need to own the files, but that prevents Wordpress from installing items through its web interface.
Can anyone help me configure things in such a way that things will work whether I manually SFTP or try to install a theme or plugin from Wordpress?
Thank you so much for reading. I hope this explanation was helpful.
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.
×
after you upload files via sftp, you may need to change permissions on those files/folders. this command:
sudo chown -R www-data:www-data /var/www
should do the trick. …
Although, I am wondering> why not just use open-ssh server, which comes installed by default on Ubuntu servers.
Any pros out there that can answer: does proFTPd have some features that do not come with open-ssh?