0

I was about to install opencart on my Ubuntu 14.04 LTS.

I will describe my exact steps-

  1. Extracted the opencart.zip.
  2. gksudo nautilus
  3. Pasted the opencart folder into /var/www/html
  4. Now while accessing localhost/open, it says Forbidden Access.

I checked the permission of /open, it was drwx------ 7 root root 4096 Oct 26 17:26 open. So basically, it was 700 (I'm not sure though), but I got a sense that permissions needed to be provided to access them.

So I fired terminal, and went on a spree to give all folders a permission of 755 and files - 644.

Three questions-

  1. Was I right till here or not ?

  2. If yes, what is the correct way to set permissions ? I did chmod for all folders & files individually (with the help of wildcards, obviously). This is actually a very hectic step. There are hundreds of files and folders, so this must not be the right way. What am I missing ?

  3. Even last time, I messed up with some permissions of some folders in /www, and it rendered me to install Ubuntu. Either there has to be a way to fiddle with /www or should I go with changing default /www-data directory ? (No idea how to go ahead with that).

I really want to stick with Linux but this permission thingy is always nagging me.

PS: Right now, if I access /open, it opens a blank page.

Thanks, help much appreciated.

1

1 Answer 1

0

You shouldn't create contents of /var/www as root user (that's what you did with gksudo nautilus). Instead, you should add your user to www-data group and put the contents to /var/www as a user.

This way, both you and the web server will have access to the data, and you will be able to manage the contents of /var/www without having to modify permissions manually.

Not the answer you're looking for? Browse other questions tagged .