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.
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.
Do the user and group "www" exist? If not, you either asked for the wrong user and group or you forgot to create them.
I think so as it comes afer this command
sudo mkdir -p /var/www/example.com/public_html
Thanks for the reply.
You can see the info about the user www using the id utility.
If there is no such user, it will say so and you can then add it using the regular methods for adding a user.Code:id www id forbes
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.
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
Of course there is also a way to do that with the GUI but it varies from distro to distro.Code:sudo adduser www
Ok thanks, I will have to leave now and try it later and then see how it goes
Hi,
Are you following a set of instructions?
Could the instructions be wrong and that www should be www-data?
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
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?
Bookmarks