Page 1 of 4 123 ... LastLast
Results 1 to 10 of 38

Thread: Chown command

  1. #1
    Join Date
    Jun 2008
    Location
    North East England
    Beans
    184
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Chown command

    forbes@forbes-Satellite-Pro-2100:~$ sudo chown -R www:www /var/www/example.com/public_html
    [sudo] password for forbes:
    chown: invalid user: `www:www'
    forbes@forbes-Satellite-Pro-2100:~$

    Can anyone please tell me why this command will not work.

  2. #2
    Join Date
    Aug 2011
    Location
    52° N 6° E
    Beans
    2,186
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: Chown command

    Do the user and group "www" exist? If not, you either asked for the wrong user and group or you forgot to create them.

  3. #3
    Join Date
    Jun 2008
    Location
    North East England
    Beans
    184
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Chown command

    I think so as it comes afer this command
    sudo mkdir -p /var/www/example.com/public_html
    Thanks for the reply.

  4. #4
    Join Date
    Sep 2006
    Beans
    7,227
    Distro
    Lubuntu Development Release

    Re: Chown command

    You can see the info about the user www using the id utility.

    Code:
    id www
    id forbes
    If there is no such user, it will say so and you can then add it using the regular methods for adding a user.

  5. #5
    Join Date
    Jun 2008
    Location
    North East England
    Beans
    184
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Chown command

    forbes@forbes-Satellite-Pro-2100:~$ sudo chown -R www:www /var/www/example.com/public_html
    [sudo] password for forbes:
    chown: invalid user: `www:www'
    forbes@forbes-Satellite-Pro-2100:~$ id www
    id: www: No such user
    forbes@forbes-Satellite-Pro-2100:~$ id forbes
    You are correct no user, what I am trying to do is move a website that I host myself onto another computer and as it is more than six years since I built the site and used a laptop as a server I have forgot how to get it on the internet. I am copying commands from a Howto so how do I get a user.

  6. #6
    Join Date
    Sep 2006
    Beans
    7,227
    Distro
    Lubuntu Development Release

    adduser

    If you are the only user on the new system you could just give ownership of that directory to yourself and not worry about adding another user.

    Otherwise, to create a user and group, use adduser

    Code:
    sudo adduser www
    Of course there is also a way to do that with the GUI but it varies from distro to distro.

  7. #7
    Join Date
    Jun 2008
    Location
    North East England
    Beans
    184
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Chown command

    Ok thanks, I will have to leave now and try it later and then see how it goes

  8. #8
    Join Date
    Dec 2008
    Location
    UK
    Beans
    413
    Distro
    Xubuntu 12.04 Precise Pangolin

    Re: Chown command

    Hi,

    Are you following a set of instructions?

    Could the instructions be wrong and that www should be www-data?

  9. #9
    Join Date
    Jun 2008
    Location
    North East England
    Beans
    184
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Chown command

    I am having trouble what I should have in the root var after making the requested change
    Step One— Create a New Directory

    The first step in creating a virtual host is to a create a directory where we will keep the new website’s information.

    This location will be your Document Root in the Apache virtual configuration file later on. By adding a -p to the line of code, the command automatically generates all the parents for the new directory.
    sudo mkdir -p /var/www/example.com/public_html


    Change the root extension to match the directory that we made in Step One. If the document root is incorrect or absent you will not be able to set up the virtual host.
    server {
    listen 80; ## listen for ipv4; this line is default and implied
    #listen [::]:80 default ipv6only=on; ## listen for ipv6

    root /var/www/example.com/public_html;
    index index.html index.htm;

    # Make site accessible from http://localhost/
    server_name example.com;


    }
    Last edited by ex-para; September 20th, 2013 at 02:05 PM. Reason: correction

  10. #10
    Join Date
    Sep 2006
    Beans
    7,227
    Distro
    Lubuntu Development Release

    choice of web server?

    mkdir -p will make a directory including any parent directories that it needs.

    But about the virtual host, which web server have you installed? nginx or Apache2?

Page 1 of 4 123 ... LastLast

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
  •