Results 1 to 6 of 6

Thread: Lamp /var/www folder (making it writable)

  1. #1
    Join Date
    Jul 2008
    Beans
    3

    Exclamation Lamp /var/www folder (making it writable)

    Hello i just switched from osx and am using ubuntu 10.10. im trying to setup a local server and am having trouble moving files into the localhost folder (/var/www) i know i need to change permissions of the folder to be able to place files in it. i was told to use chmod, but i dont know what that is or how to use it, if anyone can help me by providing a step by step to making that folder writable i would really appreciate it, thank you in advance

  2. #2
    Join Date
    Jun 2010
    Location
    Highlands, Scotland
    Beans
    153
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Lamp /var/www folder (making it writable)

    i think its
    Code:
    sudo chown <username> /var/www
    that will make <username> the owner of the directory

  3. #3
    Join Date
    Mar 2009
    Location
    Western Hemisphere.
    Beans
    136
    Distro
    Ubuntu

    Re: Lamp /var/www folder (making it writable)

    Assuming you've got files in /var/www already, you'll want to change ownership recursively:
    Code:
     sudo chown -R <username> /var/www
    Alternatively, you could change the permissions
    Code:
    sudo chmod -R a+rwX /var/www
    if you want all users to be able to make changes.

    Probably the most correct thing to do, however, is to make a group to access the folder:

    Code:
    sudo groupadd www
    sudo useradd -g <username> www
    sudo chown -R :www /var/www
    sudo chmod -R g+rwX /var/www
    sudo chmod g+s /var/www
    This creates a new group, adds you to the group, gives the group ownership and read and write permissions to the folder, and ensures that files created in the folder will continue to be owned by the group.

    Hope that helps!

  4. #4
    Join Date
    Mar 2009
    Location
    Western Hemisphere.
    Beans
    136
    Distro
    Ubuntu

    Re: Lamp /var/www folder (making it writable)

    One thing about my last post has been bugging me. If you already have folders in /var/www then
    Code:
    chmod g+s /var/www
    would not be enough to set the setgid flag for all subfolders.

    Something more like
    Code:
    find /var/www -type d -exec chmod g+s '{}' \;
    should work to recursively set the setgid flag on all subdirectories. This is useful if you want to ensure that the group owner remains www for all files created in the folder.

    Of course if your /var/www has no subfolders, then the original command is fine.

  5. #5
    Join Date
    May 2012
    Beans
    1

    Re: Lamp /var/www folder (making it writable)

    I still get a 550 error when I try to do add/remove files with FTP client.
    Last edited by Iglebekk; May 9th, 2012 at 03:03 PM. Reason: Added more info

  6. #6
    Join Date
    Jul 2007
    Location
    Magic City of the Plains
    Beans
    Hidden!
    Distro
    Xubuntu 16.10 Yakkety Yak

    Re: Lamp /var/www folder (making it writable)

    Old thread closed. If you have a question, please start a new thread.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •