I love what I do.

I love technology and education. Maybe you like knitting. Cool. My thing is educational technology.

Please feel free to leave a comment...

Linux server with lots of students - assigning individual read / write for students in /var/www

Monday, April 25, 2016

I use (and love) linode for my web hosting, email, database, and other linux needs. I'll be using linode for my web applications class next year (about 15 students). I had a problem thinking how would I enable students to write to a web directory (var/www) without giving them all SUDO access (and allowing them to write into another students directory). 

This took me some time to find a solution, and it is beautifully simple (of course). Click here to see the thread

If you make /var/www writeable by its group and add the user to the group, that user will not have to use sudo. 

Try this: 

sudo adduser www-data 

sudo chown -R www-data:www-data /var/www 

sudo chmod -R g+rwX /var/www 

 

The user should then be able to edit /var/www/ files without hassle. The first line adds the user to the www-data group, the second line clears up any files with messed up ownership, and the third makes it so that all users who are members of the www-data group can read and write all files in /var/www. If you are logged in as you need to log out and log back in for the group membership to take effect. I confirm this works.



Commenting is not available in this channel entry.

Avatar

Bill MacKenty, Chief Zuccini

I make a difference in the life of kids. You want to tell me what's more rewarding?

Avatar

Resume

This is my full resume. It has all my work experience since I graduated from college in 1992, including certifications, professional memberships, and descriptions of my work.

Avatar

Polish Resume

This is my full resume translated into Polish. My wife tells me it is a literal translation, and as such might convey a slightly different meaning to Polish speakers.