0

I changed an Apache reverse proxy configuration, to add a new hostname.

I don't usually manage webservers / proxies, though I basically replicated the existing structure:

  • created a separate mysite.com.conf file with the relevant VirtualHost directives inside the sites-available folder
  • created a symlink named mysite.com.conf in the sites-enabled folder pointing toward the new file
  • restarted Apache with systemctl restart apache2

Everything works as expected, the website is reachable and such. There's only a small thing that puzzles me: if I do a2query -s I can see the new host I added in the command output.

But, while all the others are listed like:

Mine is instead:

  • mysite.com (enabled by unknown)

From where does that unknown come from and how do I fix it?

watery
  • 143
  • 12

1 Answers1

1

On Debian (and so, on Ubuntu as well), the preferred way to create sites is to create them in the /etc/apache2/sites-available directory (named something.conf), then run the a2ensite something command, where something is the name of the config file without the extension.

Similarly, enabling config snippets (these are in the /etc/apache2/conf-available directory) and modules (from the mods-available directory) should be done by using the a2enconf and a2enmod commands.

These commands have a corresponding "disable" pair, named a2dissite, a2disconf and a2dismod, and they write a status to the /var/lib/apache2 directory, from which the a2query script reads the info. If there is a config file which doesn't have an entry in /var/lib/apache, then it is there by "unknown".

Lacek
  • 7,233
  • 24
  • 28