1

I got the error:

-bash: syntax error near unexpected token `newline'

while executing:

a2ensite <span style="color: #ff0000;">mysite.conf</span>

I am following this tutorial: https://subinsb.com/ubuntu-linux-create-localhost-website/

  • 2
    That seems like an error in the tutorial (presumably the author intended to color the mysite.conf argument but the raw HTML code got displayed) – steeldriver May 20 '18 at 23:05
4

Actually you want to tell to apache2 to enable a site configuration file named mysite.conf:

a2ensite mysite.conf

The rest part of the line is HTML code that shouldn't be displayed in this way. As @steeldriver said this is ан error in the tutorial. In result the syntax is completely wrong... This code contains the semicolon character ; that can be used as newline token in Bash - the default user's shell in Ubuntu.

The command a2ensite expects name of any file located in /etc/apache2/sites-available. The name must end with .conf. The command creates symbolic links for these files into the directory /etc/apache2/sites-enabled/, thus they become enabled, when you reload the Apache's configuration.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.