Skip to content

File 'options-ssl-apache.conf' included in autocreated '[sitename]-le-ssl.conf' has potentially problematic vhost_combined LogFormat #9769

Closed

Description

@CollegiateComputer

If you're having trouble using Certbot and aren't sure you've found a bug or
request for a new feature, please first try asking for help at
https://community.letsencrypt.org/. There is a much larger community there of
people familiar with the project who will be able to more quickly answer your
questions.

My operating system is (include version):

Ubuntu 22.04.3 LTS

I installed Certbot with (snap, OS package manager, pip, certbot-auto, etc):

snap

I ran this command and it produced this output:

command: certbot --apache
output: N/A (completed successfully)
options-ssl-apache.conf contents:

# This file contains important security parameters. If you modify this file
# manually, Certbot will be unable to automatically provide future security
# updates. Instead, Certbot will print and log an error message with a path to
# the up-to-date file that you will need to refer to when manually updating
# this file. Contents are based on https://ssl-config.mozilla.org

SSLEngine on

# Intermediate configuration, tweak to your needs
SSLProtocol             all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
SSLCipherSuite          ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384
SSLHonorCipherOrder     off
SSLSessionTickets       off

SSLOptions +StrictRequire

# Add vhost name to log entries:
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" vhost_combined
LogFormat "%v %h %l %u %t \"%r\" %>s %b" vhost_common

Certbot's behavior differed from what I expected because:

The LogFormat directive defined for vhost_combined in options-ssl-apache.conf is preceded by the comment # Add vhost name to log entries: but appears to not actually include vhost (%v) and instead actually override what is the default LogFormat directive for vhost_combined configured in the apache2.conf for a standard installation of Apache on, at least, Ubuntu, but likely also Debian, which is:

LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined

This default LogFormat directive does include vhost (%v) and, based on the precedence of an Include as part of a site configuration, could end up being overridden by the Let's Encrypt options-ssl-apache.conf vhost_combined LogFormat directive. Unless there is a technical reason to do otherwise, it may make sense to change the LogFormat directive for vhost_combined in options-ssl-apache.conf to:

LogFormat "%v %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" vhost_combined

Otherwise, if this is not feasible for some reason, it may make sense to change the comment as it is potentially confusing due to the disparity between what it says it's doing versus what's actually being done.

Here is a Certbot log showing the issue (if available):

Logs are stored in /var/log/letsencrypt by default. Feel free to redact domains, e-mail and IP addresses as you see fit.

N/A

Here is the relevant nginx server block or Apache virtualhost for the domain I am configuring:

<IfModule mod_ssl.c>
    <VirtualHost *:443>
        ServerAdmin [email protected]
        ServerName example.com
        DocumentRoot /var/www/example.com/html
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log vhost_combined

        SSLCertificateFile /etc/letsencrypt/live/example.com/fullchain.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem
        Include /etc/letsencrypt/options-ssl-apache.conf
    </VirtualHost>
</IfModule>

Activity

  1. p-windeurope commented on Aug 2, 2024

    @p-windeurope

    I agree on this one, it makes no sense to call it vhost_combined if there's no vhost name included in the string. It's very misleading to say the least. Additionally this vhost_combined format is a verbatim copy of httpd's default combined format.

    Also, and more importantly, what's the point of including LogFormat directive in the first place? I don't feel like there's a meaningful relation between SSL and (access) logs (the logging is essentially the same whether SSL is in place or not).

  2. olaulau commented on Apr 15, 2025

    @olaulau

    same for me, very annoying bug (and not so easy to find as the conf is outside of apache folder)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions