Quick preface - i'm a new to managing my own servers. I'm on Ubuntu 14.04 running Apache. I ran into some problems setting up Craft which i was hoping someone might be able to shed a bit of light on what i got wrong. I have a user with sudo privileges, lets say 'user1'.
I used a simple PHP script to find out what user PHP is running as:
<?php echo exec('whoami'); ?>
Which came out as 'www-data'. In terminal as 'user1' i created a new group 'craftpermissions' and added 'user1' and 'www-data' to this group. I then set the group 'craftpermissions' as the owner of the following directories:
/craft/app/ /craft/config/ /craft/storage/
I then set permissions on those three folders to 775 using:
sudo chmod -R 775 /var/www/myvirtualhostaddress/craft/app/
However when i visited
mydomainname.com/index.php/admin/ i still got the error saying php could not write to the /config folder.
In the end i set permissions on the folder to 777 so i could crack on with installation and it worked fine, but i'd like to do it properly as i think 777 is a bit of a no-no? Or does it not matter too much if craft folder is one directory above my web root?
Any guidance much appreciated.
/craft/app everything is owned by craftpermissions except
.. which is owned by the group created when i made user1:
drwxr-xr-x 7 user1 user1 4096 Aug 25 06:44 ..
does this refer to the directory above it? When i run on /craft/storage/ it appears as:
drwxrwxrwx 3 user1 craftpermissions 4096 Aug 25 09:18 . drwxr-xr-x 7 user1 user1 4096 Aug 25 06:44 .. drwxr-xr-x 6 www-data www-data 4096 Aug 25 09:19 runtime.
/craft/config appears as
drwxrwxrwx 3 user1 craftpermissions 4096 Aug 25 09:19 . drwxr-xr-x 7 user1 user1 4096 Aug 25 06:44 .. -rwxrwxrwx 1 user1 craftpermissions 671 Aug 25 06:44 db.php -rwxrwxrwx 1 user1 craftpermissions 220 Aug 25 06:44 general.php -rw-r--r-- 1 www-data www-data 255 Aug 25 09:19 license.key drwxrwxrwx 2 user1 craftpermissions 4096 Aug 25 06:45 redactor -rwxrwxrwx 1 user1 craftpermissions 844 Aug 25 06:44 routes.php