Jump to content
  • 0

Christopher


Question

Hi, following on with your tutorial, i was editing the  " sudo nano /etc/apache2/envvars " file which had the following lines ,

export APACHE_RUN_USER=www-data
export APACHE_RUN_GROUP=www-data

If you don’t know what the username is, you can use the whoami command to find it out

pi@WP:~ $ whoami
pi

I then went back to  " sudo nano /etc/apache2/envvars "  and changed 

export APACHE_RUN_USER=www-data          to    APACHE_RUN_USER=pi
export APACHE_RUN_GROUP=www-data       to    APACHE_RUN_GROUP=pi

 then an the following and the following results

pi@WP:~ $ sudo chown -Rf $(pi):$(pi) /var/www/html
bash: pi: command not found
bash: pi: command not found
pi@WP:~ $ 

Please assist at your earliest convenience, much appreciated. 

Thanks. Chris

Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0
14 hours ago, Christopher said:

Hi, following on with your tutorial, i was editing the  " sudo nano /etc/apache2/envvars " file which had the following lines ,

export APACHE_RUN_USER=www-data
export APACHE_RUN_GROUP=www-data

If you don’t know what the username is, you can use the whoami command to find it out

pi@WP:~ $ whoami
pi

I then went back to  " sudo nano /etc/apache2/envvars "  and changed 

export APACHE_RUN_USER=www-data          to    APACHE_RUN_USER=pi
export APACHE_RUN_GROUP=www-data       to    APACHE_RUN_GROUP=pi

 then an the following and the following results

pi@WP:~ $ sudo chown -Rf $(pi):$(pi) /var/www/html
bash: pi: command not found
bash: pi: command not found
pi@WP:~ $ 

Please assist at your earliest convenience, much appreciated. 

Thanks. Chris

Hi Chris,
The command should be,
$ sudo chown -Rf pi:pi /var/www/html

Here, chown expects an username and a group name. 



$(pi) is used to run the pi command and substitute the result in the command sudo chown -Rf $(pi):$(pi) /var/www/html. There is no command pi. Thats why you get this error.

If you want to use command substitution here, the command will be,
$ sudo chown -Rf $(whoami):$(whoami) /var/www/html


Wishing you all the best.
Shovon

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...