Problems with FTP on Ubuntu linode
I am running Ubuntu 10.4 with Apache2
1) First Question
Following one fo the guides floating around here, I created a username:group, lets call it travis:filetransfer, and set the home to /srv/www/domain.com/. I can login to my server via FileZilla with that user, and it properly starts off in the /domain.com/ directory. However, it cannot write to that dir or any subdirs. I've done everything down to the "wrong way" of even chmod'ing the dir to 777, and with my limited knowledge of chown, i did "chown travis:filetransfer /srv/www/domain.com
For those cringing, I've chmod the directory back to 755, and chown'd back to root:root.
Why can't this user name do anything? I know it is going to be a config somewhere, or that I haven't fully grasped the user/user group stuff yet.
2) I came up with the first question because of the issue for my second question:
I got a WordPress blog installed and running on my domain. When trying to use the built in plug/theme installer, it asks for my ftp login info. So I used [IPAddy]:22 and my root login/password. Whether I choose FTP or FTPS, after about 15 seconds, it simply returns to a "Failed to connect to [IPAddy]:22". After some searching around, I see some people stated they were able to get this to work by doing something with the www-data group, or the apache group (or user?), but then other areas say this is incorrect. One site looked promising by having me set something using
/usr/sbin/setsebool -P httpd_can_network_connect=1
Hoever, I do not have this command.
Sorry if this got long winded, just trying to trim off any of the usual questions incase I've already tried something you were gonna suggest. I've been running sites from shared hosts for years, and on a whim wanted to give this VPS a shot, and if I can get past some of these snags, I'll eventually migrate all my sites to my VPS.
Thanks in advance for any help.
8 Replies
@telijah:
So I used [IPAddy]:22 and my root login/password. Whether I choose FTP or FTPS, after about 15 seconds, it simply returns to a "Failed to connect to [IPAddy]:22".
22 is SSH and SFTP. Filezila can connect using SFTP, mind.
FTP and FTPS are 21. Do you have an FTP(S) server installed at all?
Pure-FTPd, vsFTPd, proFTPd?
orb: I imagine I DO need one for Wordpress, as it's only options are FTP and FTPS.
I'll go look up installing vsFTPd as I've seen a lot of documentation on that one already, unless you guys see other reasons to go with another. I don't need terribly "powerful" or feature rich options. As long as I can setup a user and assign any home directory I'd like.
Thanks for the info guys.
pre-package
Remember, you want to use FTP only as a last resort. Wordpress connecting via 127.0.0.1 is safe (well, as far as one can use "wordpress" and "safe" together). Letting your users upload files via it… not so much.
@telijah:
I'll go look up installing vsFTPd as I've seen a lot of documentation on that one already, unless you guys see other reasons to go with another. I don't need terribly "powerful" or feature rich options. As long as I can setup a user and assign any home directory I'd like.
That's what I currently use on one server for site updates, and yes, it's pretty easy to isolate the directory used for each authenticated user through per-user config files. The users don't have to exist as actual users on the system if you don't want, but can simply be used for FTP authentication, then appearing as a guest account in terms of filesystem protections.
As for the FTP vs. SFTP question, for me it was part a legacy issue on the part of clients, but also when I went looking I really found no decent way to provide SFTP with each user locked into a configured directory, and that didn't require actual login accounts on the system.
vsftpd also supports FTPS which (client support permitting - FileZilla does for example) can keep things just as secure.
– David
However, the script places Wordpress in a directory rather than in the public root. This was going to create lots of problems for our migration, so we did a clean LAMP (Ubuntu) install and then a fresh WP install in the public root. Everything seems to work except I get the exact same error the OP described when I try to add plugins.
I tried CHMODing the contents dir to 777 and that didn't help at all.
I guess my question is this. What is in the all-in-one Wordpress stack script that solves this problem? Does it install FTP as well? Somehow it makes the plugin download/upgrade work. Does anyone know how? I'm thinking this might be a simpler way to solve the problem.
Also, I'm going to request a root option be added to the script if I can find the right thread on this forum. This would make life a lot easier.