public_html permissions for local development
Posted
by
maGz
on Ask Ubuntu
See other posts from Ask Ubuntu
or by maGz
Published on 2012-12-10T22:44:17Z
Indexed on
2012/12/10
23:18 UTC
Read the original article
Hit count: 226
I know this question has popped up a couple times, but I can't seem to find a definitive answer to my issue, so please bear with me. I have Ubuntu Server 12.04 setup in VirtualBox for PHP development and testing (Drupal plus other PHP sites using Yii framework). My question is in 3 parts...
1) If I create a public_html
folder under /home/myuser
, do I need to give ownership of that folder to the Apache www-data
group? If so, are there any specific permissions I should be setting? 755
? (Btw, I am following this guide to create the public_html directory and set up multiple virtual hosts per site I create and test)
I previously had all of my sites under /var/www
, but ran into massive permission denied errors whenever I tried to sFTP to it, either through FileZilla or PhpStorm. This is what I had previously done:
sudo chgrp www-data /var/www
sudo chmod -R 775 /var/www
sudo chmod -R g+s /var/www
sudo usermod -G www-data [my_ftp_user]
2) The second part of my question is this: If I create my PHP project and files in Windows through PhpStorm, and then upload via sFTP, will permissions get affected?
3) Once I am satisfied with my developed project, would it be advisable to move and test them under /var/www
to see how it would fair in a production-ish environment?
I would really appreciate the help and advice here. I'm learning more as I go along, but dealing with Linux files and permissions is a bit of a new ballgame for me! Thank you
© Ask Ubuntu or respective owner