Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

First of, I need to state I'm a complete ignorant when it comes to server administration on Ubuntu, and I'm doing what I can. I have been trying to do this for hours with no luck.

Basically, I want to create a Ubuntu user whose home directory is /var/www/SITE, and prefered it is chroot'd to it. The chroot part is not so important right now, as first I prefer to make anything work. The user should be able to upload files here and the webserver (www-data user?) should be able to pick them up with no problem.

I was able to create the user and give it the home directory /var/www/SITE. (the user is "anders"). I gave him a password, and "anders" can connect to FTP just fine and upload files.

But here's where things don't work: While my user can upload files to that /var/www/SITE directory, when I access the webpage on my browser I get a Forbidden error. Note that anders is also a member of the www-data group. I can fix this by running

sudo chmod g+s /var/www/SITE/* anders -R

but this is of course not ideal. Ideally the files should "work" as soon as I upload them. What's the right way to fix this?

If it matters (don't think so), I'm editing my files in Coda 2 and anders is the user for it.

share|improve this question
    
What is the actual problem you are trying to solve? –  Michael Hampton Jul 2 '13 at 1:05
    
[...]But here's where things don't work: While my user can upload files to that /var/www/SITE directory, when I access the webpage on my browser I get a Forbidden error. Note that anders is also a member of the www-data group. I can fix this by running sudo chmod g+s /var/www/SITE/* anders -R but this is of course not ideal. Ideally the files should "work" as soon as I upload them. What's the right way to fix this?[...] –  Andy Ibanez Jul 2 '13 at 1:21
    
It just occurred to me that this issue may be related to the user that runs the vsftpd daemon... Let's see... –  Andy Ibanez Jul 2 '13 at 1:23
    
That doesn't explain anything about the real problem you're trying to solve. –  Michael Hampton Jul 2 '13 at 1:26
    
The real problem I'm trying to solve is that when I upload an .html file via FTP and then I access it with my web browser, I get a Forbidden error. This can be circumvented by issuing the command I mentioned above, but it's a workaround and it's a workaround people with no direct access to the webserver will be able to do when they upload their pages via FTP. –  Andy Ibanez Jul 2 '13 at 1:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.