I'm having a bit of trouble with deploying websites to my server.
I deploy Rails/Sinatra applications through Capistrano and Git; PHP websites I just upload through an FTP-server, for now.
However, I keep running into '403 Forbidden' errors. I'm confused why..
When deploying a PHP website, I upload it through the FTP and I log in using the domainname as the user. (Say the user is 'dinosaur.be', the directory it'll get uploaded to is '/home/dinosaur.be/'). The problem here is that my Apache won't get access to these files. They're uploaded (and thus owned) by user 'dinosaur.be'. I have messed around a bit with chown and when I execute chown -R apache:apache . in the website directory, Apache will stop giving me these 403 errors.. However, if I do that, the user doesn't have access anymore to it's own home directory.
I tried adding the apache user to the dinosaur.be group, but that didn't really work out, as far as I can tell.
When doing this with a Sinatra application and Passenger, deployed through Capistrano, I get a 403 error no matter what user I set as the owner of the files. I think my virtual host in the apache config file is pointed to the right directory (in this case: /home/dinosaur.be/appname/current/public), but I'm hopelessly confused.
I realise this is probably basic server administration stuff, but I'm just getting started.. Hopefully someone can give me some pointers here. Thanks a lot!