2

I am trying to add virtual host for a site but cannot enable it.

I have added the configuration file(.conf) in site-available folder. when I try to enable it by running

a2ensite <site.net>.conf

it says,

ERROR: Site <site.net> does not exist!

There are already few other sites running on the server without any hiccup. Facing this issue for the first time.

Screenshot: enter image description here

Gerald Schneider
  • 23,274
  • 8
  • 57
  • 89
sabhos
  • 23
  • 3

2 Answers2

3

You post the output of sites-availble, the correct folder should be sites-available. You either somehow managed to rename the directory with all configs in it and the next restart of apache will break all your sites, or you created a second folder with configs in it, from which apache won't read your new file. Either way, fix the directory name.

Lenniey
  • 5,220
  • 2
  • 18
  • 29
1

You don't need the .conf suffix for a2ensite:

a2ensite  <site.net>

should work.

If not, you can always manually create a symlink into sites-enabled.

Sven
  • 98,649
  • 14
  • 180
  • 226
  • tried without .conf already. same error. I understand, it can be done manually. but the question is, why it's not working in the first place. – sabhos Apr 19 '18 at 09:19
  • Additionally, tried now to create the symlink manually. The file was created but it was empty. @sven – sabhos Apr 19 '18 at 09:26