1

All websites points to a directory listing ("Index of") of /var/www/html and when I click on any sites of the list, I see a duplicated domain and tld.

A Syntax error is given, regarding:

line 219 of /etc/apache2/apache2.conf

Facts:

  • The sites worked fine until today noon, when I added a virtual host (which I removed since then).
  • All sites are Wordpress based and are minimal.
  • All sites include an .htaccess file.
  • There are no from either journalctrl -xe, apachectl -t, tail /var/log/auth.log, or tail /var/log/apache2/error.log.
  • In the Zone file of each site, A and Cname records are just fine.

What may cause this problem?

Update:

Associated error:

Syntax error on line 219 of /etc/apache2/apache2.conf: Could not open configuration file /etc/apache2/sites-enabled/domain.tld

Note: I used apachectl -t to find this error.

1

If you did no major change in the server environment and if after a2ensite domain.tld.conf you cannot restart the apache service, this should solve it:

  1. Check for syntax errors in one of the Vhost files (this is most probably it).
  2. Make sure you have an extra empty row in the end of each Vhost file.

Answer regarding question update:

To solve the syntax error described in the question update above:

a2dissite domain.tld

Note that "domain.tld" deals with the old website you no longer have and to which a symlink stayed in sites-enabled.

  • Was my pleasure! and good to hear from you! – JohnDoea Apr 22 '17 at 16:08

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.