AH00526: Syntax error on line 1 of /etc/apache2/other/le_http_01_challenge_pre.conf:

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. https://crt.sh/?q=example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is:
prestodigital.ddns.net
I ran this command:
sudo certbot --apache
It produced this output:
Error while running apachectl configtest.

AH00526: Syntax error on line 1 of /etc/apache2/other/le_http_01_challenge_pre.conf:

Invalid command ‘RewriteEngine’, perhaps misspelled or defined by a module not included in the server configuration
My web server is (include version):
Server version: Apache/2.4.34 (Unix)
Server built: Feb 22 2019 20:20:11

The operating system my web server runs on is (include version):
Mac OS X 10.14.6
My hosting provider, if applicable, is:
(self)
I can login to a root shell on my machine (yes or no, or I don’t know):
yes
I’m using a control panel to manage my site (no, or provide the name and version of the control panel):
nope - doing it via terminal
The version of my client is (e.g. output of certbot --version or certbot-auto --version if you’re using Certbot):certbot 1.2.0

(nevermind) I solved it, I found the article that mentioned the three modules I needed loaded by Apache, it’s running and my secure link works - thanks for the fish

Well, even if you’ve fixed the issue in your situation, I think you’ve uncovered a bug in certbot anyway: IMHO it should check for mod_rewrite and raise an error if there is no mod_rewrite installed or enabled. Or somehow enable it, if that’s possible.

1 Like

actually (in my case) all three modules
ssl_module
socache_shmcb_module
rewrite_module

weren’t being loaded…

As far as I can see, certbot checks if those modules are loaded or not and enables them if not loaded. But it doesn’t do that for mod_rewrite when performing the challenges as far as I can tell.

Just (sort of?) confirmed: running certbot 1.2.0.dev0 and commenting the LoadModule for mod_rewrite results in this error.

OK, it seems the module handeling is only for Ubuntu and Debian. All other flavors of *nix won’t have this automatic enabeling of modules it seems. And as @presto is using MacOS, it seems to reason this is indeed the issue: mod_rewrite needs to be enabled manually.

But even so, I’d say certbot should raise an error checking for mod_rewrite. Not failing with RewriteEngine on when mod_rewrite isn’t enabled.

Filed an issue on Github :slight_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.