So I'm trying to understand the correct permissions for file directories in order to install a module. I've installed drupal, and I try to install a module, which looks like so:
But When I click install it takes me here:
I then wanted to test if it was permissions preventing it from installing, so I chmod'd everything to 777 in the sites folder just to see, and yes, the module then installed easily and correctly. But of course, 777 on everything is insecure, so I quickly installed drupal again from scratch. So now when I check the permissions they look like this
html/sites$ ls -l
total 16
drwxr-xr-x 5 6226 6226 4096 Jun 17 18:38 all
dr-xr-xr-x 3 6226 6226 4096 Jul 19 20:08 default
-rw-r--r-- 1 6226 6226 2365 Jun 17 18:38 example.sites.php
-rw-r--r-- 1 6226 6226 904 Jun 17 18:38 README.txt
So after an installation the all folder has r-x permissions and the default has r-x as well for group and other. (A side question being, what do I make of the user and group, "6226", "4096","2365", and "904"?)
The "modules" folder, inside "all" folder where they get downloaded is also set to r-x.
html/sites/all$ ls -l
total 12
drwxr-xr-x 2 6226 6226 4096 Jun 17 18:38 libraries
drwxr-xr-x 2 6226 6226 4096 Jun 17 18:38 modules
drwxr-xr-x 2 6226 6226 4096 Jun 17 18:38 themes
I don't know if this seems right to me. Shouldn't it be able to write to the folder to download the module from an external source?
Thanks for all the feedback in advance, I look forward to hearing what people have to say.
Edit, more details:
Linux myhostname 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
ubuntu@myhostname:/var/www/html/sites/all/modules$ ls -la
total 12
drwxr-xr-x 2 www-data 6226 4096 Jun 17 18:38 .
drwxr-xr-x 5 6226 6226 4096 Jun 17 18:38 ..
-rw-r--r-- 1 www-data 6226 952 Jun 17 18:38 README.txt
Okay! So. after reinstalling and repeatedly chowning folders until I made it past that request for FTP details, I finally got it to ATTEMPT to download the file. All I had to do after a fresh install was sudo chown www-data /var/www/html/sites/default
. What confuses me is why that would work. Beause before and after chowning, the permissions were dr-xr-xr-x 3 www-data 6226 4096 Jul 20 09:03 default
for the default folder. So my understanding is that the owner, group, and others could all all read and execute, so why would changing the owner even matter?
Now when attempting to "Install from a URL" after chowning default, a loading bar appears and says "Completed 100%", and then this screen appears instead of the FTP login request: