Univention Bugzilla – Bug 54905
univention-add-vhost apache configuration causes syntax error
Last modified: 2022-06-28 13:00:53 CEST
When creating a vhost with univetion-add-vhost --conffile /path/to/config.conf the config is written with IncludeOptional /path/to/config.con[f]. Example: univention-add-vhost --conffile /etc/apache2/conf-enabled/letsencrypt-proxy.conf sso.elearning.domain.de 80 Which results in this configfile (/etc/apache2/sites-enabled/univention-vhost.conf): <VirtualHost *:80> ServerName sso.elearning.domain.de IncludeOptional /etc/apache2/conf-enabled/letsencrypt-proxy.con[f] </VirtualHost> Most likely the cause is a wrong regex in /etc/univention/templates/files/etc/apache2/sites-available/univention-vhosts.conf print(" IncludeOptional %s" % re.sub(r'^(.*)(.)$', r'\1[\2]', file)) The '[\2]' seems to be the only occurence where the *.con[f] can come from. https://httpd.apache.org/docs/2.4/en/mod/core.html#includeoptional states that IncludeOptional only takes one argument, so the regex seems to be wrong in the above line as there shouldn't be a second result set.