Can’t upload media to my Raspberry Pi WordPress server

you need to change the owner of the wordpress folder to www-data. For example, if you put your wordpress folder in /var/www/my_new_wordpress_site, you will need to run the following command: sudo chown -R www-data:www-data /var/www/my_new_wordpress_site

How do I know the script file name in a Bash script?

For reading through a symlink1, which is usually not what you want (you usually don’t want to confuse the user this way), try: IMO, that’ll produce confusing output. “I ran foo.sh, but it’s saying I’m running bar.sh!? Must be a bug!” Besides, one of the purposes of having differently-named symlinks is to provide different functionality … Read more

bash sh – command not found 

Remove ; from the end of your script lines. This doesn’t happen in my bash, so I’m not sure what exactly is wrong, but my guess is this: ; is a separator of commands. Since your last command ends in ;, your bash probably expects another command after. Since the script finishes, though, it reads an empty command, which … Read more

What does ‘bash -c’ do?

Quoting from man bash: -c string If the -c option is present, then commands are read from string.If there are arguments after the string, they are assigned to the positional parameters, starting with $0. The command quoted by you would append the text in heredoc (i.e. the text in VirtualHost tag) to the file /etc/apache2/sites-available/magento-store.com.