Jump to content



Photo

Ubuntu Permissions for public_html directory

ubuntu apache permission public_html

  • Please log in to reply
3 replies to this topic

#1 thatguyandrew1992

thatguyandrew1992

    Neowinian Senior

  • Tech Issues Solved: 4
  • Joined: 22-January 09

Posted 04 September 2014 - 20:32

I have a web server running ubuntu and I made the public_html dir different from the standard www directory. I did chown www-data:www-data on the public_html folder (Was that the right thing to do?)

 

Now when I ftp into the server with my user account, I guess I don't have permission anymore. I can't create a new a file for instance via ftp and in the terminal I get access denied.

 

What can I do to give my user the appropriate permissions to still create files and do other standard operations? (I wanted to ask so I don't mess up the permissions :) )




#2 Brian M.

Brian M.

    Neowinian Senior

  • Tech Issues Solved: 11
  • Joined: 07-January 05
  • Location: London, UK

Posted 04 September 2014 - 20:36

You don't need to chown to www-data:www-data. The group permissions are redundant, since www-data will have permission as owner.

 

I'd either chown to www-data:<group your user is in> or <your user>:www-data - ensuring that you set the correct permissions too.



#3 OP thatguyandrew1992

thatguyandrew1992

    Neowinian Senior

  • Tech Issues Solved: 4
  • Joined: 22-January 09

Posted 04 September 2014 - 20:55

You don't need to chown to www-data:www-data. The group permissions are redundant, since www-data will have permission as owner.

 

I'd either chown to www-data:<group your user is in> or <your user>:www-data - ensuring that you set the correct permissions too.

Okay so I did  "groups adminUser"

Which gave me "adminUser : adminUser"

So then I did "sudo chown -R www-data:adminUser ./public_html"

I still get Permission denied in the terminal.

Is this a permission issue with adminUser group?



#4 OP thatguyandrew1992

thatguyandrew1992

    Neowinian Senior

  • Tech Issues Solved: 4
  • Joined: 22-January 09

Posted 07 September 2014 - 18:59

Okay I got it, I had to do the following

Add user to group www-data

chown -R www-data:www-data to the html folder

chmod g+rw to html folder

chmod +s to the html folder