2

I just set up an Apache web server on my Raspberry Pi, along with MySQL and PHP5. To upload files I set up vsftpd.

The ftp connection sent me to my pi user home directory, instead of /var/www. So I changed Pi home directory to /var/www and then changed it again to it's previous home.

FTP now sends me to /var/www, but whenever I upload files, there are now other problems. Apache sends a 403 Forbidden every time unless I manually chmod the files inside /var/www uploaded via ftp.

5
  • It sounds like you need to adjust the write privilege of www to allow the user to write to this directory. You can adjust user/*groups*<-- so that the FTP user is within a privileged group for directory www or just use a privileged user account. You will need to work around this issue to make sure that you are not opening a security hole of course. Write permission is contained within the directory that is being written to. You would have to make your adjustments on the directory. You absolutely do not want to open access to 'other'. Stay within 'user' and 'group'.
    – closetnoc
    Aug 20, 2014 at 16:48
  • @closetnoc, While this approach is acceptable, I disagree for security reasons. Let the FTP default to the '/home/username' directory, and setup virtual hosting, so that /home/username/public_html is hosted on the users behalf. In practice, I never adjust permissions in a directory created for a running daemon/service.
    – eyoung100
    Aug 20, 2014 at 21:21
  • @ECarterYoung I actually agree with you! The Raspberry Pi (raspberrypi.org) is not likely to be a web server on the Internet. It is too cute for that.
    – closetnoc
    Aug 20, 2014 at 21:40
  • In combination with both of our comments, Joe why are you running a Web Server on a Raspberry Pi? It's usually used for prototyping etc, but you may be asking too much from it by using it for a Server.
    – eyoung100
    Aug 20, 2014 at 21:51
  • Do yourself a favor and use rsync instead of ftp.
    – the
    Aug 22, 2014 at 13:06

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.