Desai Posted October 6, 2008 Share Posted October 6, 2008 Greetings good people, As the subject say, I can't make any changes inside my "default-site" directory. I'm a total noob to Apache and not very good with the Linux terminal. Thanks all D Quote Link to comment https://forums.phpfreaks.com/topic/127169-absoloute-beginner-has-problems-modifying-files-in-ubuntud-lamp/ Share on other sites More sharing options...
DarkWater Posted October 6, 2008 Share Posted October 6, 2008 What's the default-site directory's full path? Quote Link to comment https://forums.phpfreaks.com/topic/127169-absoloute-beginner-has-problems-modifying-files-in-ubuntud-lamp/#findComment-657828 Share on other sites More sharing options...
trq Posted October 6, 2008 Share Posted October 6, 2008 Theres a few things I do to make administering websites on Debian easier, rather then needing to sudo all the time. The first is to create a new group www, join that group, then give that group permissions to write to the /var/www directory. sudo addgroup www sudo gpasswd -a yourusername www You can also make yourself an administer of the www group, this will allow you to add and remove users from the group. sudo gpasswd -A yourusername From there all you really need do is set the permissions properly on the /var/www directory and its conents. sudo chmod ugo-wrx /var/www sudo chmod u+wrx,g+wrxs,o+rx /var/www find /var/www -type f sudo chmod u+rw,g+rw,o+r {} \; find /var/www -type d sudo chmod u+rwx,g+rwx,o+rx {} \; You should now be able to freely write / read from within the /var/www directory and any files you create will belong to you and the www group. Theres more you can do including creating a similar policy for the /etc/apache2/sites-* directories. Hopefully this small example will give you the idea. Quote Link to comment https://forums.phpfreaks.com/topic/127169-absoloute-beginner-has-problems-modifying-files-in-ubuntud-lamp/#findComment-657844 Share on other sites More sharing options...
Desai Posted October 6, 2008 Author Share Posted October 6, 2008 Theres a few things I do to make administering websites on Debian easier, rather then needing to sudo all the time. The first is to create a new group www, join that group, then give that group permissions to write to the /var/www directory. sudo addgroup www sudo gpasswd -a yourusername www You can also make yourself an administer of the www group, this will allow you to add and remove users from the group. sudo gpasswd -A yourusername From there all you really need do is set the permissions properly on the /var/www directory and its conents. sudo chmod ugo-wrx /var/www sudo chmod u+wrx,g+wrxs,o+rx /var/www find /var/www -type f sudo chmod u+rw,g+rw,o+r {} \; find /var/www -type d sudo chmod u+rwx,g+rwx,o+rx {} \; You should now be able to freely write / read from within the /var/www directory and any files you create will belong to you and the www group. Theres more you can do including creating a similar policy for the /etc/apache2/sites-* directories. Hopefully this small example will give you the idea. Geesh, I always have silly problems like this when using Linux. Gonna give it a try now, but I really don't like using the terminal all the time Q: In "sudo gpasswd -a yourusername www", should "gpasswd" be replaced by my password? Thanks D Quote Link to comment https://forums.phpfreaks.com/topic/127169-absoloute-beginner-has-problems-modifying-files-in-ubuntud-lamp/#findComment-657869 Share on other sites More sharing options...
Desai Posted October 6, 2008 Author Share Posted October 6, 2008 What's the default-site directory's full path? I think it's "/var/www/" Maybe an easier solution to all this is to change the path to my site to a directory I already have full rights to? Or would that mean other problems later when trying to run a script? Thanks for all your help D Quote Link to comment https://forums.phpfreaks.com/topic/127169-absoloute-beginner-has-problems-modifying-files-in-ubuntud-lamp/#findComment-657870 Share on other sites More sharing options...
Desai Posted October 6, 2008 Author Share Posted October 6, 2008 What's the default-site directory's full path? sorry it's /usr/share/apache2/default-site/ D Quote Link to comment https://forums.phpfreaks.com/topic/127169-absoloute-beginner-has-problems-modifying-files-in-ubuntud-lamp/#findComment-657893 Share on other sites More sharing options...
trq Posted October 6, 2008 Share Posted October 6, 2008 Q: In "sudo gpasswd -a yourusername www", should "gpasswd" be replaced by my password? No, gpasswd is a command, used to add users to groups. That line will add you to the www group. Also, I just realised. These lines.... find /var/www -type f sudo chmod u+rw,g+rw,o+r {} \; find /var/www -type d sudo chmod u+rwx,g+rwx,o+rx {} \; Should be.... find /var/www -type f -exec sudo chmod u+rw,g+rw,o+r {} \; find /var/www -type d -exec sudo chmod u+rwx,g+rwx,o+rx {} \; find /var/www -type f -exec sudo chown :www {} \; find /var/www -type d -exec sudo chown :www {} \; Quote Link to comment https://forums.phpfreaks.com/topic/127169-absoloute-beginner-has-problems-modifying-files-in-ubuntud-lamp/#findComment-657936 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.