Back to Techies Corner

Changing Directory Permissions

Background

I want to start hosting my own webserver like a few colleagues of mine. So the first step it would seem to me is to move "DevSite" off its current M$ IIS webserver onto Apache on the virtual machine that is my Linux testbed - I think it makes sense. Once that is done and working, I can copy the 'published' local copy off M$ IIS also, but onto the real LAMP server I have built that will become my Internet-facing webserver.

The first step was to install an FTP server, which YUM told me was 'vsftpd', which I duly did. (It appeared not to install, but it turned out it had.) Next step was to be to use CuteFTP on my desktop to copy the DevSite files from IIS to Apache, and that's when I hit the problem!

Problem

Configuring CuteFTP to connect to the server was no problem. At least not once I'd stopped trying to connect as root. (Naughty naughty!) But then of course trying to write to the directory was refused, because it is owned by the user:group of root for the both. Time for a new strategy!

Solution

  1. Create a new group called 'webadmin' using addgroup command
  2. Next make root and the user you log the FTP client into the FTP server with members of the new webadmin group. Not at all easy via ssh command line. Safest way is to edit the /etc/group file, reading the man page to see how to.
  3. Next use chown to change the user:group of the /var/www/html directory from root:root to root:webadmin.
  4. Then the final step is to use chmod to change group read/exectute to read/write/execute using 775 as the value for the /var/www/html directory, and voila!