Apache Config Parsing Errors


#1

I’m using letsencrypt-auto to configure with the Apache plugin. It is having trouble parsing my Apache configuration. Can someone tell me what is wrong here?

Command: ./letsencrypt-auto --agree-dev-preview --server https://acme-v01.api.letsencrypt.org/directory auth --apache

Error:
The apache plugin is not working; there may be problems with your existing configuration.
The error was: PluginError((‘There has been an error in parsing the file (%s): %s’, u’/etc/apache2/mods-enabled/alias.conf’, u’Syntax error’),)

/var/log/letsencrypt/letsencrypt.log:
2015-10-31 17:00:20,598:DEBUG:letsencrypt.cli:Root logging level set at 30
2015-10-31 17:00:20,603:INFO:letsencrypt.cli:Saving debug log to /var/log/letsencrypt/letsencrypt.log
2015-10-31 17:00:20,606:DEBUG:letsencrypt.cli:letsencrypt version: 0.0.0.dev20151030
2015-10-31 17:00:20,607:DEBUG:letsencrypt.cli:Arguments: [’–agree-dev-preview’, ‘–server’, ‘https://acme-v01.api.letsencrypt.org/directory’, ‘–apache’]
2015-10-31 17:00:20,611:DEBUG:letsencrypt.cli:Discovered plugins: PluginsRegistry(PluginEntryPoint#apache,PluginEntryPoint#webroot,PluginEntryPoint#null,PluginEntryPoint#manual,PluginEntryPoint#standalone)
2015-10-31 17:00:20,623:DEBUG:letsencrypt.cli:Requested authenticator apache and installer apache
2015-10-31 17:00:21,190:DEBUG:letsencrypt.plugins.disco:Other error:(PluginEntryPoint#apache): (‘There has been an error in parsing the file (%s): %s’, u’/etc/apache2/mods-enabled/alias.conf’, u’Syntax error’)
Traceback (most recent call last):
File “/home/clete2/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt/plugins/disco.py”, line 103, in prepare
self._initialized.prepare()
File “/home/clete2/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt_apache/configurator.py”, line 153, in prepare
self.check_parsing_errors(“httpd.aug”)
File “/home/clete2/.local/share/letsencrypt/local/lib/python2.7/site-packages/letsencrypt_apache/augeas_configurator.py”, line 64, in check_parsing_errors
raise errors.PluginError(msg)
PluginError: (‘There has been an error in parsing the file (%s): %s’, u’/etc/apache2/mods-enabled/alias.conf’, u’Syntax error’)
2015-10-31 17:00:21,192:DEBUG:letsencrypt.display.ops:No candidate plugin
2015-10-31 17:00:21,193:DEBUG:letsencrypt.display.ops:No candidate plugin
2015-10-31 17:00:21,194:DEBUG:letsencrypt.cli:Selected authenticator None and installer None

/etc/apache2/mods-enabled/alias.conf -> …/mods-available/alias.conf:

# Aliases: Add here as many aliases as you need (with no limit). The format is
# Alias fakename realname
#
# Note that if you include a trailing / on fakename then the server will
# require it to be present in the URL. So “/icons” isn’t aliased in this
# example, only “/icons/”. If the fakename is slash-terminated, then the
# realname must also be slash terminated, and if the fakename omits the
# trailing slash, the realname must also omit it.
#
# We include the /icons/ alias for FancyIndexed directory listings. If
# you do not use FancyIndexing, you may comment this out.

    Alias /icons/ "/usr/share/apache2/icons/"

    <Directory "/usr/share/apache2/icons">
            Options FollowSymlinks
            AllowOverride None
            Require all granted
    </Directory>

#2

Ubuntu Wily, apache2-2.4.12-2ubuntu2.


#3

I am having the same problem on Wily. If I disable a mod file, it just says there is an error in the next one. Perhaps it is an issue with Wily?


#4

Issue seems to also to be related to elements such as <IfModule mod_ssl.c> in conf files. I comment out those lines, it works for that conf file.

I added this as a note in an existing Github issue https://github.com/letsencrypt/letsencrypt/issues/1294#issuecomment-153581276