What does 'bash -c' do?

Solution 1:

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.

Solution 2:

The manual page for Bash (e.g. man bash) says that the -c option executes the commands from a string; i.e. everything inside the quotes.

Solution 3:

Check out the man pages, either on your machine or on the Internet, like this one.

Quote:

-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.